Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
fad21fb4
Commit
fad21fb4
authored
May 13, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #963 from Gustav-Simonsson/fix_keystore_crypto_comments
Update keystore code comments
parents
b2119d89
56a5592e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
key_store_passphrase.go
crypto/key_store_passphrase.go
+7
-6
No files found.
crypto/key_store_passphrase.go
View file @
fad21fb4
...
...
@@ -28,21 +28,22 @@ the private key is encrypted and on disk uses another JSON encoding.
Cryptography:
1. Encryption key is first 16 bytes of
SHA3-256 of first 16 bytes of
scrypt derived key
from user passphrase. Scrypt parameters
1. Encryption key is first 16 bytes of
scrypt derived key
from user passphrase. Scrypt parameters
(work factors) [1][2] are defined as constants below.
2. Scrypt salt is 32 random bytes from CSPRNG.
It's stored in plain next to ciphertext in key file.
3. MAC is SHA3-256 of concatenation of ciphertext and last 16 bytes of scrypt derived key.
It's stored in plain next in the key file.
3. MAC is SHA3-256 of concatenation of ciphertext and
last 16 bytes of scrypt derived key.
4. Plaintext is the EC private key bytes.
5. Encryption algo is AES 128 CBC [3][4]
6. CBC IV is 16 random bytes from CSPRNG.
It's stored in plain next
to ciphertext in
key file.
It's stored in plain next
in the
key file.
7. Plaintext padding is PKCS #7 [5][6]
Encoding:
1. On disk, the ciphertext, MAC, salt and IV are encoded in a
nested
JSON object.
1. On disk, the ciphertext, MAC, salt and IV are encoded in a JSON object.
cat a key file to see the structure.
2. byte arrays are base64 JSON strings.
3. The EC private key bytes are in uncompressed form [7].
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment