Goals:
Note: I don't like the name
trunk
and it needs to be replaced. Suggestions Requested
This document uses
jwe
instead ofencrypted
, which I think I like. It's more opinionated about how encryption must be represented, but also less likely to be abused, possibly?
Examples are truncated for clarity.
{
"type": "<sometype>",
"to": ["did:example:mediator"],
"body":{},
"attachments": [
{
"id": "x",
"hash": "<hash of jwe>",
"data": {
"jwe": {
"protected": "eyJ0...QmJaQl",
"recipients": [
{
"encrypted_key": "J1F...WLg"
}
],
"iv": "u5kIzo0m_d2PjI4m",
"ciphertext": "ABCDEFG",
"extracted": "XYZ",
"tag": "doeAoagwJe9BwKayfcduiw"
}
}
}
]
}
ABCDEFGXYZ
{
"type": "<sometype>",
"to": ["did:example:mediator"],
"body":{},
"attachments": [
{
"id": "x",
"data": {
"jwe": {
"protected": "eyJ0...QmJaQl",
"recipients": [
{
"encrypted_key": "J1F...WLg"
}
],
"iv": "u5kIzo0m_d2PjI4m",
"ciphertext_external": {'index':0,'length':7,'hash':'hash(ciphertext)'},
"extracted_external": {'index':7,'length':3,'hash':'hash(extracted)'},
"tag": "doeAoagwJe9BwKayfcduiw"
}
}
}
]
}
https://tools.ietf.org/html/rfc7515#appendix-F
{
"protected": "QmJaJ0...eyQl",
"recipients": [
{
"encrypted_key": "X5T...uVw"
}
],
"iv": "o0m_d2PjI4mu5kIz",
"ciphertext": "oag...wcdu",
"extracted": "ABCDEFGXYZ",
"tag": "e9BwKayfcduiwdoeAoagwJ"
}
Note: Because both the
ciphertext
andextracted
are packed into the next extracted, the effect is recursive.
ABCDEFGXYZ
{
"type": "<sometype>",
"to": ["did:example:mediator"],
"body":{},
"attachments": [
{
"id": "x",
"data": {
"jwe": {
"protected": "eyJ0...QmJaQl",
"recipients": [
{
"encrypted_key": "J1F...WLg"
}
],
"iv": "u5kIzo0m_d2PjI4m",
"ciphertext_external": {'index':0,'length':7,'hash':'hash(ciphertext)'},
"extracted_external": {'index':7,'length':3,'hash':'hash(extracted)'},
"tag": "doeAoagwJe9BwKayfcduiw"
}
}
}
]
}
{
"type": "<sometype>",
"to": ["did:example:mediator"],
"body":{},
"attachments": [
{
"id": "x",
"data": {
"jwe": {
"protected": "eyJ0...QmJaQl",
"recipients": [
{
"encrypted_key": "J1F...WLg"
}
],
"iv": "u5kIzo0m_d2PjI4m",
"ciphertext": "ABCDEFG",
"extracted": "XYZ",
"tag": "doeAoagwJe9BwKayfcduiw"
}
}
}
]
}
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing