Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(WalletCrypto): use correct key block size when padding with Iso10126
Browse files Browse the repository at this point in the history
  • Loading branch information
jtormey committed Feb 5, 2016
1 parent f6d6836 commit 1b97b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var AES = {
var cipher = crypto.createCipheriv(options.mode || AES.CBC, key, salt || '');
cipher.setAutoPadding(!options.padding);

if (options.padding) dataBytes = options.padding.pad(dataBytes, KEY_BIT_LEN);
if (options.padding) dataBytes = options.padding.pad(dataBytes, KEY_BIT_LEN / 8);
var encryptedBytes = Buffer.concat([ cipher.update(dataBytes), cipher.final() ]);

return encryptedBytes;
Expand Down

0 comments on commit 1b97b5c

Please sign in to comment.