diff --git a/lib/walletutils.js b/lib/walletutils.js index fbce875..184cb5b 100644 --- a/lib/walletutils.js +++ b/lib/walletutils.js @@ -84,9 +84,9 @@ WalletUtils.fromSecret = function(secret) { WalletUtils.encryptMessage = function(message, privKey) { var hash = sjcl.hash.sha256.hash(privKey); var key = sjcl.codec.utf8String.toBits(hash); - key = sjcl.bitArray.clamp(key, 256); + key = sjcl.bitArray.clamp(key, 128); return sjcl.encrypt(key, message, { - ks: 256, + ks: 128, iter: 1 }); }; @@ -94,7 +94,7 @@ WalletUtils.encryptMessage = function(message, privKey) { WalletUtils.decryptMessage = function(cyphertextJson, privKey) { var hash = sjcl.hash.sha256.hash(privKey); var key = sjcl.codec.utf8String.toBits(hash); - key = sjcl.bitArray.clamp(key, 256); + key = sjcl.bitArray.clamp(key, 128); return sjcl.decrypt(key, cyphertextJson); };