From 542e7bf807caaabc300e529dbf4bb0457ad6c084 Mon Sep 17 00:00:00 2001 From: OutCast3k Date: Thu, 8 Jan 2015 22:57:49 +0000 Subject: [PATCH] added the option to encrypt private keys using aes256 --- index.html | 30 +++++++++++++++++++++++++++++- js/coinbin.js | 17 +++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 3baaa5a..a83801e 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,7 @@ + @@ -191,7 +192,7 @@ - +
@@ -200,6 +201,12 @@
+ + +

Address Options

You can use the advanced options below to generate different kind of keys and addresses.

@@ -209,6 +216,27 @@
+ +
+ + + + + +
+
diff --git a/js/coinbin.js b/js/coinbin.js index c77bee4..4833ce5 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -249,6 +249,15 @@ $(document).ready(function() { $("#newBitcoinAddress").val(coin.address); $("#newPubKey").val(coin.pubkey); $("#newPrivKey").val(coin.wif); + + /* encrypted key code */ + if((!$("#encryptKey").is(":checked")) || $("#aes256pass").val()==$("#aes256pass_confirm").val()){ + $("#aes256passStatus").addClass("hidden"); + } else { + $("#aes256passStatus").removeClass("hidden"); + } + $("#newPrivKeyEnc").val(CryptoJS.AES.encrypt(coin.wif, $("#aes256pass").val())+''); + }); $("#newBrainwallet").click(function(){ @@ -259,6 +268,14 @@ $(document).ready(function() { } }); + $("#encryptKey").click(function(){ + if($(this).is(":checked")){ + $("#ase256wifkey, #aes256passform").removeClass("hidden"); + } else { + $("#ase256wifkey, #aes256passform, #aes256passStatus").addClass("hidden"); + } + }); + /* new -> multisig code */ $("#newMultiSigAddress").click(function(){