diff --git a/README.md b/README.md index 40d529c..2276f02 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ let hmac = Hmac::new( blake2b, //hash function ); hmac.update(random_salt); +//integers are encoded in big-endian hmac.update(argon2_time_cost); hmac.update(argon2_memory_cost); hmac.update(argon2_parallelism); @@ -182,6 +183,41 @@ Once the whole plaintext is encrypted, doby computes and appends the HMAC to the output.write(hmac.digest()); ``` +So here is what an encrypted file layout looks like: + +
Magic bytes | +4 bytes | +
---|---|
Salt | +64 bytes | +
Argon2 parameters | +Time cost: 4 bytes | +
Memory cost: 4 bytes | +|
Parallelism cost: 1 byte | +|
Encryption cipher | +1 byte | +
Ciphertext | +Exact same size as the plaintext | +
HMAC | +64 bytes | +