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
8af42d42
Commit
8af42d42
authored
Jan 21, 2015
by
Gustav Simonsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CamelCase aesCBCDecrypt
parent
1f8290ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
crypto.go
crypto/crypto.go
+2
-2
key_store_passphrase.go
crypto/key_store_passphrase.go
+1
-1
No files found.
crypto/crypto.go
View file @
8af42d42
...
...
@@ -156,7 +156,7 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
*/
passBytes
:=
[]
byte
(
password
)
derivedKey
:=
pbkdf2
.
Key
(
passBytes
,
passBytes
,
2000
,
16
,
sha256
.
New
)
plainText
,
err
:=
aes
_cbc_d
ecrypt
(
derivedKey
,
cipherText
,
iv
)
plainText
,
err
:=
aes
CBCD
ecrypt
(
derivedKey
,
cipherText
,
iv
)
ethPriv
:=
Sha3
(
plainText
)
ecKey
:=
ToECDSA
(
ethPriv
)
key
=
&
Key
{
...
...
@@ -171,7 +171,7 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
return
key
,
err
}
func
aes
_cbc_d
ecrypt
(
key
[]
byte
,
cipherText
[]
byte
,
iv
[]
byte
)
(
plainText
[]
byte
,
err
error
)
{
func
aes
CBCD
ecrypt
(
key
[]
byte
,
cipherText
[]
byte
,
iv
[]
byte
)
(
plainText
[]
byte
,
err
error
)
{
aesBlock
,
err
:=
aes
.
NewCipher
(
key
)
if
err
!=
nil
{
return
plainText
,
err
...
...
crypto/key_store_passphrase.go
View file @
8af42d42
...
...
@@ -178,7 +178,7 @@ func DecryptKey(ks keyStorePassphrase, keyId *uuid.UUID, auth string) (keyBytes
if
err
!=
nil
{
return
nil
,
err
}
plainText
,
err
:=
aes
_cbc_d
ecrypt
(
derivedKey
,
cipherText
,
iv
)
plainText
,
err
:=
aes
CBCD
ecrypt
(
derivedKey
,
cipherText
,
iv
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
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