aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/key_store_passphrase.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-02 23:02:56 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-05-12 23:18:30 +0800
commit9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98 (patch)
tree0da6e8cf6523c1d8667f0a68be648b875039806a /crypto/key_store_passphrase.go
parent58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd (diff)
downloaddexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar.gz
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar.bz2
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar.lz
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar.xz
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.tar.zst
dexon-9918b6c84e2547f3d24a6cfeb97cfcbd6cb4dc98.zip
Remove the awesome, ever misunderstood entropy mixing
Diffstat (limited to 'crypto/key_store_passphrase.go')
-rw-r--r--crypto/key_store_passphrase.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/key_store_passphrase.go b/crypto/key_store_passphrase.go
index 9d36d7b03..ee383584c 100644
--- a/crypto/key_store_passphrase.go
+++ b/crypto/key_store_passphrase.go
@@ -118,7 +118,7 @@ func (ks keyStorePassphrase) GetKeyAddresses() (addresses [][]byte, err error) {
func (ks keyStorePassphrase) StoreKey(key *Key, auth string) (err error) {
authArray := []byte(auth)
- salt := randentropy.GetEntropyMixed(32)
+ salt := randentropy.GetEntropyCSPRNG(32)
derivedKey, err := scrypt.Key(authArray, salt, scryptN, scryptr, scryptp, scryptdkLen)
if err != nil {
return err
@@ -133,7 +133,7 @@ func (ks keyStorePassphrase) StoreKey(key *Key, auth string) (err error) {
return err
}
- iv := randentropy.GetEntropyMixed(aes.BlockSize) // 16
+ iv := randentropy.GetEntropyCSPRNG(aes.BlockSize) // 16
AES256CBCEncrypter := cipher.NewCBCEncrypter(AES256Block, iv)
cipherText := make([]byte, len(toEncrypt))
AES256CBCEncrypter.CryptBlocks(cipherText, toEncrypt)