@@ -5971,7 +5972,7 @@ body { font-family: Arial; }
Open Source JavaScript Client-Side Bitcoin Wallet Generator
-
+
Single Wallet
@@ -5984,7 +5985,9 @@ body { font-family: Arial; }
Generating Bitcoin Address...
- MOVE your mouse around to add some extra randomness...
+ MOVE your mouse around to add some extra randomness...
+ OR type some random characters into this textbox
+
- MOVE your mouse around to add some extra randomness...
+ MOVE your mouse around to add some extra randomness...
+ OR type some random characters into this textbox
+
@@ -6276,7 +6279,7 @@ body { font-family: Arial; }
- Version History (v2.7.5)
+ Version History (v2.7.6)
(PGP)
527B 5C82 B1F6 B2DB 72A0
ECBF 8749 7B91 6397 4F5A @@ -6655,11 +6658,16 @@ ninja.seeder = { // seed function exists to wait for mouse movement to add more entropy before generating an address seed: function (evt) { if (!evt) var evt = window.event; - - // seed a bunch (minimum seedLimit) of times based on mouse moves + // seed a bunch (minimum seedLimit) of times SecureRandom.seedTime(); + // seed key press character + if (evt.which) { + SecureRandom.seedInt8(evt.which); + } // seed mouse position X and Y - if (evt) SecureRandom.seedInt16((evt.clientX * evt.clientY)); + else if (evt) { + SecureRandom.seedInt16((evt.clientX * evt.clientY)); + } ninja.seeder.seedCount++; // seeding is over now we generate and display the address @@ -6669,23 +6677,18 @@ ninja.seeder = { document.getElementById("generate").style.display = "none"; document.getElementById("menu").style.visibility = "visible"; } + var poolHex; if (SecureRandom.poolCopyOnInit != null) { + var poolHex = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); + document.getElementById("seedpooldisplay").innerHTML = poolHex; } else { - document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.pool); - } - }, - - // If user has not moved the mouse or if they are on a mobile device - // we will force the generation after a random period of time. - forceGenerate: function () { - // if the mouse has not moved enough - if (ninja.seeder.seedCount < ninja.seeder.seedLimit) { - SecureRandom.seedTime(); - ninja.seeder.seedCount = ninja.seeder.seedLimit - 1; - ninja.seeder.seed(); + var poolHex = Crypto.util.bytesToHex(SecureRandom.pool); + document.getElementById("seedpool").innerHTML = poolHex; + document.getElementById("seedpooldisplay").innerHTML = poolHex; } + document.getElementById("mousemovelimit").innerHTML = (ninja.seeder.seedLimit - ninja.seeder.seedCount); } }; @@ -8902,10 +8905,7 @@ if (ninja.getQueryString()["testnet"] == "true" || ninja.getQueryString()["testn } if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["showseedpool"] == "1") { document.getElementById("seedpoolarea").style.display = "block"; - } -// if users does not move mouse after random amount of time then generate the key anyway. -setTimeout(ninja.seeder.forceGenerate, ninja.seeder.seedLimit * 100); diff --git a/src/bitaddress-ui.html b/src/bitaddress-ui.html index 079fff5..bf12c9b 100644 --- a/src/bitaddress-ui.html +++ b/src/bitaddress-ui.html @@ -110,7 +110,7 @@ //main.css - +
ECBF 8749 7B91 6397 4F5A @@ -6655,11 +6658,16 @@ ninja.seeder = { // seed function exists to wait for mouse movement to add more entropy before generating an address seed: function (evt) { if (!evt) var evt = window.event; - - // seed a bunch (minimum seedLimit) of times based on mouse moves + // seed a bunch (minimum seedLimit) of times SecureRandom.seedTime(); + // seed key press character + if (evt.which) { + SecureRandom.seedInt8(evt.which); + } // seed mouse position X and Y - if (evt) SecureRandom.seedInt16((evt.clientX * evt.clientY)); + else if (evt) { + SecureRandom.seedInt16((evt.clientX * evt.clientY)); + } ninja.seeder.seedCount++; // seeding is over now we generate and display the address @@ -6669,23 +6677,18 @@ ninja.seeder = { document.getElementById("generate").style.display = "none"; document.getElementById("menu").style.visibility = "visible"; } + var poolHex; if (SecureRandom.poolCopyOnInit != null) { + var poolHex = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); + document.getElementById("seedpooldisplay").innerHTML = poolHex; } else { - document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.pool); - } - }, - - // If user has not moved the mouse or if they are on a mobile device - // we will force the generation after a random period of time. - forceGenerate: function () { - // if the mouse has not moved enough - if (ninja.seeder.seedCount < ninja.seeder.seedLimit) { - SecureRandom.seedTime(); - ninja.seeder.seedCount = ninja.seeder.seedLimit - 1; - ninja.seeder.seed(); + var poolHex = Crypto.util.bytesToHex(SecureRandom.pool); + document.getElementById("seedpool").innerHTML = poolHex; + document.getElementById("seedpooldisplay").innerHTML = poolHex; } + document.getElementById("mousemovelimit").innerHTML = (ninja.seeder.seedLimit - ninja.seeder.seedCount); } }; @@ -8902,10 +8905,7 @@ if (ninja.getQueryString()["testnet"] == "true" || ninja.getQueryString()["testn } if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["showseedpool"] == "1") { document.getElementById("seedpoolarea").style.display = "block"; - } -// if users does not move mouse after random amount of time then generate the key anyway. -setTimeout(ninja.seeder.forceGenerate, ninja.seeder.seedLimit * 100); diff --git a/src/bitaddress-ui.html b/src/bitaddress-ui.html index 079fff5..bf12c9b 100644 --- a/src/bitaddress-ui.html +++ b/src/bitaddress-ui.html @@ -110,7 +110,7 @@ //main.css - +
@@ -123,7 +123,7 @@
Open Source JavaScript Client-Side Bitcoin Wallet Generator
-
+
Single Wallet
@@ -136,7 +136,9 @@
Generating Bitcoin Address...
- MOVE your mouse around to add some extra randomness...
+ MOVE your mouse around to add some extra randomness...
+ OR type some random characters into this textbox
+
- MOVE your mouse around to add some extra randomness...
+ MOVE your mouse around to add some extra randomness...
+ OR type some random characters into this textbox
+
@@ -428,7 +430,7 @@
- Version History (v2.7.5)
+ Version History (v2.7.6)
(PGP)
527B 5C82 B1F6 B2DB 72A0
ECBF 8749 7B91 6397 4F5A diff --git a/src/main.css b/src/main.css index c35b23f..118120e 100644 --- a/src/main.css +++ b/src/main.css @@ -24,6 +24,9 @@ body { font-family: Arial; } #btcaddress, #btcprivwif, #detailaddress, #detailaddresscomp, #detailprivwif, #detailprivwifcomp { font-family: monospace; font-size: 1.25em; } #seedpoolarea { display: none; } +#seedpooldisplay { font-family: monospace; font-size: 0.75em; width: 600px; padding: 10px; word-wrap: break-word; } +#generate { font-family: monospace; font-size: 1.25em; height: 275px; text-align: left; position: relative; padding: 5px; border: 2px solid green; } +#generate span { padding: 5px 5px 0 5px; } #keyarea { height: 250px; } #keyarea .pubaddress { float: none; display: block; padding: 0; height: auto; } #keyarea .label { text-decoration: none; } @@ -39,8 +42,6 @@ body { font-family: Arial; } #main { position: relative; text-align: center; margin: 0px auto; width: 1005px; } #logo { width: 578px; height: 80px; } -#generate { font-family: monospace; font-size: 1.25em; height: 158px; text-align: left; position: relative; padding: 5px; border: 2px solid green; } -#generate span { padding: 5px 5px 0 5px; } #paperarea { min-height: 120px; display: none; } #paperarea .keyarea { border: 2px solid green; border-top: 0; } diff --git a/src/ninja.misc.js b/src/ninja.misc.js index c50de73..928c3b3 100644 --- a/src/ninja.misc.js +++ b/src/ninja.misc.js @@ -10,11 +10,16 @@ ninja.seeder = { // seed function exists to wait for mouse movement to add more entropy before generating an address seed: function (evt) { if (!evt) var evt = window.event; - - // seed a bunch (minimum seedLimit) of times based on mouse moves + // seed a bunch (minimum seedLimit) of times SecureRandom.seedTime(); + // seed key press character + if (evt.which) { + SecureRandom.seedInt8(evt.which); + } // seed mouse position X and Y - if (evt) SecureRandom.seedInt16((evt.clientX * evt.clientY)); + else if (evt) { + SecureRandom.seedInt16((evt.clientX * evt.clientY)); + } ninja.seeder.seedCount++; // seeding is over now we generate and display the address @@ -24,23 +29,18 @@ ninja.seeder = { document.getElementById("generate").style.display = "none"; document.getElementById("menu").style.visibility = "visible"; } + var poolHex; if (SecureRandom.poolCopyOnInit != null) { + var poolHex = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); + document.getElementById("seedpooldisplay").innerHTML = poolHex; } else { - document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.pool); - } - }, - - // If user has not moved the mouse or if they are on a mobile device - // we will force the generation after a random period of time. - forceGenerate: function () { - // if the mouse has not moved enough - if (ninja.seeder.seedCount < ninja.seeder.seedLimit) { - SecureRandom.seedTime(); - ninja.seeder.seedCount = ninja.seeder.seedLimit - 1; - ninja.seeder.seed(); + var poolHex = Crypto.util.bytesToHex(SecureRandom.pool); + document.getElementById("seedpool").innerHTML = poolHex; + document.getElementById("seedpooldisplay").innerHTML = poolHex; } + document.getElementById("mousemovelimit").innerHTML = (ninja.seeder.seedLimit - ninja.seeder.seedCount); } }; diff --git a/src/ninja.onload.js b/src/ninja.onload.js index 9dcb359..2372b8e 100644 --- a/src/ninja.onload.js +++ b/src/ninja.onload.js @@ -23,7 +23,4 @@ if (ninja.getQueryString()["testnet"] == "true" || ninja.getQueryString()["testn } if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["showseedpool"] == "1") { document.getElementById("seedpoolarea").style.display = "block"; - -} -// if users does not move mouse after random amount of time then generate the key anyway. -setTimeout(ninja.seeder.forceGenerate, ninja.seeder.seedLimit * 100); \ No newline at end of file +} \ No newline at end of file diff --git a/src/securerandom.js b/src/securerandom.js index 3e5c3ee..37a1133 100644 --- a/src/securerandom.js +++ b/src/securerandom.js @@ -21,7 +21,7 @@ // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() - sr.poolSize = 256; + sr.poolSize = 512; // --- object methods --- @@ -133,12 +133,12 @@ sr.pool = new Array(); sr.pptr = 0; var t; - if (window.crypto && window.crypto.getRandomValues) { + if (window.crypto && window.crypto.getRandomValues && window.Uint8Array) { try { // Use webcrypto if available - var ua = new Uint8Array(32); + var ua = new Uint8Array(sr.poolSize); window.crypto.getRandomValues(ua); - for (t = 0; t < 32; ++t) + for (t = 0; t < sr.poolSize; ++t) sr.pool[sr.pptr++] = ua[t]; } catch (e) { alert(e); } }
ECBF 8749 7B91 6397 4F5A diff --git a/src/main.css b/src/main.css index c35b23f..118120e 100644 --- a/src/main.css +++ b/src/main.css @@ -24,6 +24,9 @@ body { font-family: Arial; } #btcaddress, #btcprivwif, #detailaddress, #detailaddresscomp, #detailprivwif, #detailprivwifcomp { font-family: monospace; font-size: 1.25em; } #seedpoolarea { display: none; } +#seedpooldisplay { font-family: monospace; font-size: 0.75em; width: 600px; padding: 10px; word-wrap: break-word; } +#generate { font-family: monospace; font-size: 1.25em; height: 275px; text-align: left; position: relative; padding: 5px; border: 2px solid green; } +#generate span { padding: 5px 5px 0 5px; } #keyarea { height: 250px; } #keyarea .pubaddress { float: none; display: block; padding: 0; height: auto; } #keyarea .label { text-decoration: none; } @@ -39,8 +42,6 @@ body { font-family: Arial; } #main { position: relative; text-align: center; margin: 0px auto; width: 1005px; } #logo { width: 578px; height: 80px; } -#generate { font-family: monospace; font-size: 1.25em; height: 158px; text-align: left; position: relative; padding: 5px; border: 2px solid green; } -#generate span { padding: 5px 5px 0 5px; } #paperarea { min-height: 120px; display: none; } #paperarea .keyarea { border: 2px solid green; border-top: 0; } diff --git a/src/ninja.misc.js b/src/ninja.misc.js index c50de73..928c3b3 100644 --- a/src/ninja.misc.js +++ b/src/ninja.misc.js @@ -10,11 +10,16 @@ ninja.seeder = { // seed function exists to wait for mouse movement to add more entropy before generating an address seed: function (evt) { if (!evt) var evt = window.event; - - // seed a bunch (minimum seedLimit) of times based on mouse moves + // seed a bunch (minimum seedLimit) of times SecureRandom.seedTime(); + // seed key press character + if (evt.which) { + SecureRandom.seedInt8(evt.which); + } // seed mouse position X and Y - if (evt) SecureRandom.seedInt16((evt.clientX * evt.clientY)); + else if (evt) { + SecureRandom.seedInt16((evt.clientX * evt.clientY)); + } ninja.seeder.seedCount++; // seeding is over now we generate and display the address @@ -24,23 +29,18 @@ ninja.seeder = { document.getElementById("generate").style.display = "none"; document.getElementById("menu").style.visibility = "visible"; } + var poolHex; if (SecureRandom.poolCopyOnInit != null) { + var poolHex = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.poolCopyOnInit); + document.getElementById("seedpooldisplay").innerHTML = poolHex; } else { - document.getElementById("seedpool").innerHTML = Crypto.util.bytesToHex(SecureRandom.pool); - } - }, - - // If user has not moved the mouse or if they are on a mobile device - // we will force the generation after a random period of time. - forceGenerate: function () { - // if the mouse has not moved enough - if (ninja.seeder.seedCount < ninja.seeder.seedLimit) { - SecureRandom.seedTime(); - ninja.seeder.seedCount = ninja.seeder.seedLimit - 1; - ninja.seeder.seed(); + var poolHex = Crypto.util.bytesToHex(SecureRandom.pool); + document.getElementById("seedpool").innerHTML = poolHex; + document.getElementById("seedpooldisplay").innerHTML = poolHex; } + document.getElementById("mousemovelimit").innerHTML = (ninja.seeder.seedLimit - ninja.seeder.seedCount); } }; diff --git a/src/ninja.onload.js b/src/ninja.onload.js index 9dcb359..2372b8e 100644 --- a/src/ninja.onload.js +++ b/src/ninja.onload.js @@ -23,7 +23,4 @@ if (ninja.getQueryString()["testnet"] == "true" || ninja.getQueryString()["testn } if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["showseedpool"] == "1") { document.getElementById("seedpoolarea").style.display = "block"; - -} -// if users does not move mouse after random amount of time then generate the key anyway. -setTimeout(ninja.seeder.forceGenerate, ninja.seeder.seedLimit * 100); \ No newline at end of file +} \ No newline at end of file diff --git a/src/securerandom.js b/src/securerandom.js index 3e5c3ee..37a1133 100644 --- a/src/securerandom.js +++ b/src/securerandom.js @@ -21,7 +21,7 @@ // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() - sr.poolSize = 256; + sr.poolSize = 512; // --- object methods --- @@ -133,12 +133,12 @@ sr.pool = new Array(); sr.pptr = 0; var t; - if (window.crypto && window.crypto.getRandomValues) { + if (window.crypto && window.crypto.getRandomValues && window.Uint8Array) { try { // Use webcrypto if available - var ua = new Uint8Array(32); + var ua = new Uint8Array(sr.poolSize); window.crypto.getRandomValues(ua); - for (t = 0; t < 32; ++t) + for (t = 0; t < sr.poolSize; ++t) sr.pool[sr.pptr++] = ua[t]; } catch (e) { alert(e); } }