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

Commit

Permalink
Merge pull request #112 from blockchain/pairing
Browse files Browse the repository at this point in the history
fix(Pairing): convert password to hex before encrypting
  • Loading branch information
Pernas committed Feb 9, 2016
2 parents 92df68a + febbf8a commit 31bf65e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,9 @@ function decryptAndInitializeWallet(success, error, decrypt_success, build_hd_su
MyWallet.makePairingCode = function(success, error) {
try {
MyWallet.securePost('wallet', { method : 'pairing-encryption-password' }, function(encryption_phrase) {
success('1|' + MyWallet.wallet.guid + '|' + WalletCrypto.encrypt(MyWallet.wallet.sharedKey + '|' + WalletStore.getPassword(), encryption_phrase, 10));
var pwHex = new Buffer(WalletStore.getPassword()).toString('hex');
var encrypted = WalletCrypto.encrypt(MyWallet.wallet.sharedKey + '|' + pwHex, encryption_phrase, 10);
success('1|' + MyWallet.wallet.guid + '|' + encrypted);
}, function(e) {
error(e);
});
Expand Down

0 comments on commit 31bf65e

Please sign in to comment.