You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Amend Decryption steps
decryption results in a plaintext key, not encrypted key
* amend Encryption steps
Make text more consistent by using the actual name provided in step 1.
The name ‘salt’ is only relevant for the scrypt function, not for the
actual final key data structure. It also more closely matches the
actual implementation @
https://github.com/neo-project/neo/blob/master/neo/Wallets/KeyPair.cs#L7
5
Copy file name to clipboardExpand all lines: nep-2.mediawiki
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ To keep the size of the encrypted key down, no initialization vectors (IVs) are
71
71
72
72
#Derive a key from the passphrase using scrypt
73
73
74
-
#*Parameters: passphrase is the passphrase itself encoded in UTF-8 and normalized using Unicode Normalization Form C (NFC). salt is addresshash from the earlier step, n=16384, r=8, p=8, length=64
74
+
#*Parameters: passphrase is the passphrase itself encoded in UTF-8 and normalized using Unicode Normalization Form C (NFC). Salt is the addresshash from the earlier step, n=16384, r=8, p=8, length=64
75
75
76
76
#*Let's split the resulting 64 bytes in half, and call them derivedhalf1 and derivedhalf2.
77
77
@@ -81,17 +81,17 @@ To keep the size of the encrypted key down, no initialization vectors (IVs) are
81
81
82
82
The encrypted private key is the Base58Check-encoded concatenation of the following, which totals 39 bytes without Base58 checksum:
83
83
84
-
*0x01 0x42 + flagbyte + salt + encryptedhalf1 + encryptedhalf2
#Collect encrypted private key and passphrase from user.
89
89
90
90
#Derive derivedhalf1 and derivedhalf2 by passing the passphrase and addresshash into scrypt function.
91
91
92
-
#Decrypt encryptedhalf1 and encryptedhalf2 using AES256Decrypt, merge them to form the encrypted private key.
92
+
#Decrypt encryptedhalf1 and encryptedhalf2 using AES256Decrypt, merge the two parts and XOR the result with derivedhalf1 to form the plaintext private key.
93
93
94
-
#Convert that private key into a NEO address.
94
+
#Convert that plaintext private key into a NEO address.
95
95
96
96
#Hash the NEO address, and verify that addresshash from the encrypted private key record matches the hash. If not, report that the passphrase entry was incorrect.
0 commit comments