FORMAT 664 B

12345678910111213141516171819
  1. scrypt encrypted data format
  2. ----------------------------
  3. offset length
  4. 0 6 "scrypt"
  5. 6 1 scrypt data file version number (== 0)
  6. 7 1 log2(N) (must be between 1 and 63 inclusive)
  7. 8 4 r (big-endian integer; must satisfy r * p < 2^30)
  8. 12 4 p (big-endian integer; must satisfy r * p < 2^30)
  9. 16 32 salt
  10. 48 16 first 16 bytes of SHA256(bytes 0 .. 47)
  11. 64 32 HMAC-SHA256(bytes 0 .. 63)
  12. 96 X data xor AES256-CTR key stream generated with nonce == 0
  13. 96+X 32 HMAC-SHA256(bytes 0 .. 96 + (X - 1))
  14. AES256-CTR is computed with a 256-bit AES key key_enc, and HMAC-SHA256 is
  15. computed with a 256-bit key key_hmac, where
  16. scrypt(password, salt, N, r, p, 64) == [key_enc][key_hmac]