File: FORMAT

package info (click to toggle)
python-scrypt 0.8.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 544 kB
  • sloc: ansic: 3,619; python: 549; sh: 99; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
scrypt encrypted data format
----------------------------

offset	length
0	6	"scrypt"
6	1	scrypt data file version number (== 0)
7	1	log2(N) (must be between 1 and 63 inclusive)
8	4	r (big-endian integer; must satisfy r * p < 2^30)
12	4	p (big-endian integer; must satisfy r * p < 2^30)
16	32	salt
48	16	first 16 bytes of SHA256(bytes 0 .. 47)
64	32	HMAC-SHA256(bytes 0 .. 63)
96	X	data xor AES256-CTR key stream generated with nonce == 0
96+X	32	HMAC-SHA256(bytes 0 .. 96 + (X - 1))

AES256-CTR is computed with a 256-bit AES key key_enc, and HMAC-SHA256 is
computed with a 256-bit key key_hmac, where
  scrypt(password, salt, N, r, p, 64) == [key_enc][key_hmac]