rsa format spec done

This commit is contained in:
2020-09-17 15:29:09 -04:00
parent 1bc4d1d135
commit 99a01d843e
5 changed files with 558 additions and 148 deletions

View File

@@ -16,30 +16,42 @@ PRIVATE:
4.0.0.0 uint32 allocator for 4.0.0.0.0
4.0.0.0.0 public key #1 keytype (string)
4.0.0.1 uint32 allocator for 4.0.0.1.0
4.0.0.1.0 public key #1 payload (bytes)
4.0.0.1.0 public exponent ("e")
4.0.0.2 uint32 allocator for 4.0.0.2.0
4.0.0.2.0 modulus ("n")
4.0.1 uint32 allocator for private key #1 (4.0.1.0 to 4.0.1.5, inclusive?)[0]
4.0.1.0 Checksum (random uint32) #1 (should match 4.0.1.1)
4.0.1.1 Checksum (random uint32) #2 (should match 4.0.1.0)
4.0.1.2 (virtual) Copy of public key (copy of 4.0.0.0 to 4.0.0.1, inclusive)
4.0.1.2 (virtual) Copy of public key (with flipped e/n) (copy of 4.0.0.0 to 4.0.0.1, inclusive)
4.0.1.2.0 uint32 allocator for 4.0.1.2.0.0
4.0.1.2.0.0 public key #1 keytype (string)
4.0.1.2.1 uint32 allocator for 4.0.1.2.1.0
4.0.1.2.1.0 public key #1 payload (bytes)
4.0.1.2.1.0 modulus ("n")
4.0.1.2.2 uint32 allocator for 4.0.1.2.2.0
4.0.1.2.2.0 public exponent ("e")
4.0.1.3 uint32 allocator for 4.0.1.3.0
4.0.1.3.0 Private key #1 (bytes)
4.0.1.4 uint3 allocator for 4.0.1.4.0
4.0.1.4.0 Comment for key #1 (string)
4.0.1.5 Sequential padding to align private key to cipher blocksize (8 for unencrypted keys)[1].
4.0.1.3.0 private exponent ("d")
4.0.1.4 uint32 allocator for 4.0.1.4.0
4.0.1.4.0 CRT helper value ("q^(-1) mod p")
4.0.1.5 uint32 allocator for 4.0.1.5.0
4.0.1.5.0 prime #1 ("p")
4.0.1.6 uint32 allocator for 4.0.1.6.0
4.0.1.6.0 prime #2 ("q")
4.0.1.7 uint32 allocator for 4.0.1.7.0
4.0.1.7.0 Comment for key #1 (string)
4.0.1.8 Sequential padding to align private key to cipher blocksize (8 for unencrypted keys?)[1].
[0] If it is an encrypted key, everything below 4.0.1 is encrypted per 1.0.0, 2.0.0, and 3.0.0.
[1] Pad determined by: 8 - ((4.0.1.3 + 4.0.1.4) % 8) (??)
[1] Pad determined by ??
PUBLIC:
(Each .pub file's Base64 string contains 4.0.0.0 to 4.0.0.1 inclusive above)
(Each .pub file's Base64 string contains 4.0.0.0 to 4.0.0.2 inclusive above)
0 uint32 allocator for 0.0
0.0 Public key keytype (string)
0.0 public key #1 keytype (string)
1 uint32 allocator for 1.0
1.0 Public key payload (bytes)
1.0 public exponent ("e")
2 uint32 allocator for 2.0
2.0 modulus ("n")