From 90bb3e8b18c0d9c583b4512a6833d314a533b95a Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Wed, 18 Feb 2015 10:51:45 -0300 Subject: [PATCH] change key_size to 128bits on message encryption --- lib/walletutils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); };