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
9caf32be
Commit
9caf32be
authored
Jan 15, 2015
by
Gustav Simonsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code comments
parent
47d3b3dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
key_store_passphrase.go
crypto/key_store_passphrase.go
+4
-6
No files found.
crypto/key_store_passphrase.go
View file @
9caf32be
...
@@ -22,9 +22,8 @@
...
@@ -22,9 +22,8 @@
*/
*/
/*
/*
This key store behaves as KeyStorePlaintextFile with the difference that
This key store behaves as KeyStorePlain with the difference that
the private key is encrypted and encoded as a JSON object within the
the private key is encrypted and on disk uses another JSON encoding.
key JSON object.
Cryptography:
Cryptography:
...
@@ -39,9 +38,9 @@ Cryptography:
...
@@ -39,9 +38,9 @@ Cryptography:
Encoding:
Encoding:
1. On disk, ciphertext, salt and IV are encoded
as a
JSON object.
1. On disk, ciphertext, salt and IV are encoded
in a nested
JSON object.
cat a key file to see the structure.
cat a key file to see the structure.
2. byte arrays are
ASCII HEX encoded as
JSON strings.
2. byte arrays are
base64
JSON strings.
3. The EC private key bytes are in uncompressed form [7].
3. The EC private key bytes are in uncompressed form [7].
They are a big-endian byte slice of the absolute value of D [8][9].
They are a big-endian byte slice of the absolute value of D [8][9].
4. The checksum is the last 32 bytes of the plaintext byte array and the
4. The checksum is the last 32 bytes of the plaintext byte array and the
...
@@ -205,7 +204,6 @@ func DecryptKey(ks keyStorePassphrase, keyId *uuid.UUID, auth string) (keyBytes
...
@@ -205,7 +204,6 @@ func DecryptKey(ks keyStorePassphrase, keyId *uuid.UUID, auth string) (keyBytes
return
keyBytes
,
err
return
keyBytes
,
err
}
}
// plain crypto/rand. this is /dev/urandom on Unix-like systems.
func
getEntropyCSPRNG
(
n
int
)
[]
byte
{
func
getEntropyCSPRNG
(
n
int
)
[]
byte
{
mainBuff
:=
make
([]
byte
,
n
)
mainBuff
:=
make
([]
byte
,
n
)
_
,
err
:=
io
.
ReadFull
(
crand
.
Reader
,
mainBuff
)
_
,
err
:=
io
.
ReadFull
(
crand
.
Reader
,
mainBuff
)
...
...
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