From 2cd9465de9d031eb553304e70a1c281071588730 Mon Sep 17 00:00:00 2001 From: Will Caine Date: Fri, 22 Jan 2016 23:47:40 +0000 Subject: [PATCH] Added AES decryption to #sign Added a passphrase input to #sign which allows you to enter an AES-256 encrypted key into the private key input if you chose, which will be decrypted using the passphrase. --- index.html | 4 ++++ js/coinbin.js | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/index.html b/index.html index 95bbea9..b408b15 100644 --- a/index.html +++ b/index.html @@ -874,6 +874,10 @@ +
+ + +

diff --git a/js/coinbin.js b/js/coinbin.js index c6a1bbc..6365166 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -1196,7 +1196,18 @@ $(document).ready(function() { $("#signBtn").click(function(){ var wifkey = $("#signPrivateKey"); + var passphrase = $("#signPrivateKeyPassphrase"); var script = $("#signTransaction"); + + if(passphrase.val()!=""){ + var decrypted = CryptoJS.AES.decrypt(wifkey.val(), passphrase.val()).toString(CryptoJS.enc.Utf8); + if(coinjs.addressDecode(decrypted)){ + $(passphrase).parent().removeClass('has-error'); + wifkey.val(decrypted); + } else { + $(passphrase).parent().addClass('has-error'); + } + } if(coinjs.addressDecode(wifkey.val())){ $(wifkey).parent().removeClass('has-error');