Skip to content

Commit 202006c

Browse files
committed
Added beginning of header spec
1 parent 72a6638 commit 202006c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/HeaderSpec.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Header specification
2+
3+
## Header format
4+
5+
* At the start of the header, it is marked by 5 null characters (byte value 0000 0000), and then the following ASCII string: "BEGIN ENCRYPTION HEADER STRING"
6+
7+
* The end of the header is marked by the following ASCII string "END ENCRYPTION HEADER STRING", and followed by 5 null characters (byte value 0000 0000)
8+
9+
* The items in the header are as followed (square brackets representing the start and end of the header, anything in braces is related to the previous option). Newlines and tabs are not true, but simply for formatting:
10+
11+
```
12+
[
13+
-HMAC:(hash here, None)
14+
{ -HASHALGO:(PBKDF2, SHA256, bcrypt) }
15+
{ -ITERATIONS:(iterations here) }
16+
-KEYVERIFICATIONHASH:(hash here, None)
17+
{ -HASHALGO:(PBKDF2, SHA256, bcrypt) }
18+
{ -ITERATIONS:(iterations here) }
19+
-ENCRYPTMODE:(AES, RSA, etc)
20+
{ -AESMODE:(ECB, CBC, CFB, CTR) }
21+
{ -IV:(IV here) }
22+
-KEYSIZE:(int here)
23+
]
24+
```
25+
26+
## Header items
27+
28+
| Argument | Meaning | Values|
29+
| ------------- |-------------| ----- |
30+
| [HMAC](#HMAC) | The verification hash used to confirm the file hasn't changed | 128 - 512 bit byte array (16-64 bytes) |
31+
| [KEYVERIFICATIONHASH](#KEYVERIFICATIONHASH) | A hash of the key to verify if the password is correct | 128 - 512 bit byte array (16-64 bytes) |
32+
| [ENCRYPTMODE](#ENCRYPTMODE) | A string representing the encryption type | A string in the table of [ENCRYPTMODE](#ENCRYPTMODE) page |
33+
34+
###HMAC
35+
36+
###KEYVERIFICATIONHASH

docs/ignore.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)