From fc4df8839cfa3208b19117bf8e15b3f889e015c7 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Mon, 28 Oct 2013 23:57:39 -0700 Subject: [PATCH 1/3] Added button to hide passphrase so they are not displayed as plaintext. The private key will still be displayed though. --- index.html | 5 ++++- js/brainwallet.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 67f7924..f2dc4df 100644 --- a/index.html +++ b/index.html @@ -74,8 +74,11 @@
-
+
+
+ +
diff --git a/js/brainwallet.js b/js/brainwallet.js index 010277f..f434d77 100644 --- a/js/brainwallet.js +++ b/js/brainwallet.js @@ -136,6 +136,18 @@ } } + function showHidePassphrase() { + var pass = $('#pass'); + if (pass.attr('type') == 'password') { + pass.attr('type', 'text'); + $('#hidePassphrase').html('Hide'); + } + else { + pass.attr('type', 'password'); + $('#hidePassphrase').html('Show'); + } + } + function genRandom() { $('#pass').val(''); $('#hash').focus(); @@ -1184,6 +1196,7 @@ onInput('#hash', onChangeHash); onInput('#sec', onChangePrivKey); + $('#hidePassphrase').click(showHidePassphrase); $('#genRandom').click(genRandom); $('#gen_from label input').on('change', update_gen_from ); From 2c043e4998dd877c07c9b7cc2b392bd1a1dbecb5 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 29 Oct 2013 02:20:17 -0700 Subject: [PATCH 2/3] Added PBKDF2 support (right now using 100000 iterations) for more secure hashing. This gives some extra safety for lower entropy passwords, and since it's unlikely for this page to be used too often we want to use as high number of iterations as possible (maybe higher?) Originally used CryptoJS but their PBKDF2 implementation was too slow so switched to using Stanford's more efficient sjcl library. Still need to download and cache the code. --- index.html | 4 ++++ js/brainwallet.js | 58 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index f2dc4df..298fcfb 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,9 @@ + + +