Compare commits

...

12 Commits
0.1.0 ... 0.1.2

Author SHA1 Message Date
Ian Coleman
039a98ba5a Release v0.1.2 2017-07-03 11:00:41 +10:00
iancoleman
9dab7e5d0c Merge pull request #81 from mikeyb/naming
Add CRW / Change bip44 dropdown naming convention
2017-07-03 10:42:20 +10:00
mikeyb
534481b628 standardize dropdown naming scheme 2017-07-02 09:44:54 -07:00
mikeyb
0921f37077 Add CRW - Crown 2017-07-01 15:38:46 -07:00
Ian Coleman
f1e5d48491 Release v0.1.1 2017-06-20 11:00:01 +10:00
Ian Coleman
fe81f9b320 Rename Word Count to Raw Entropy Words
See issue 78
2017-06-20 10:58:51 +10:00
Ian Coleman
20f459ce8f Change entropy Strength to Time To Crack
See issue 78
2017-06-20 10:58:31 +10:00
iancoleman
ee42e5f712 Merge pull request #77 from krychlicki/dash_testnet
add dash testnet
2017-06-17 09:05:07 +10:00
Karol Rychlicki
c0386f3b78 add dash testnet 2017-06-16 19:30:15 +02:00
Ian Coleman
56b1275f40 Fix typo: s/litecoin/ripple 2017-06-14 13:45:11 +10:00
Ian Coleman
bba46401ad Fix formatting on changelog 2017-06-14 12:38:55 +10:00
Ian Coleman
0163fe6a38 Fix ethereum test to include hex prefix 2017-06-14 12:37:29 +10:00
6 changed files with 264 additions and 171 deletions

View File

@@ -118,7 +118,7 @@
<div class="container">
<h1 class="text-center">Mnemonic Code Converter</h1>
<p class="version">v0.1.0</p>
<p class="version">v0.1.2</p>
<hr>
<div class="row">
<div class="col-md-12">
@@ -169,8 +169,8 @@
<div class="col-sm-7">
<textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards" data-translate-placeholder></textarea>
<div class="row">
<label class="col-sm-3 control-label" data-translate>Strength</label>
<div class="strength col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate><span class="more-info" data-translate-title title="Based on estimates from zxcvbn using Filtered Entropy">Time To Crack</span></label>
<div class="crack-time col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate>Event Count</label>
<div class="event-count col-sm-3 form-control-static"></div>
</div>
@@ -181,7 +181,7 @@
<div class="bits-per-event col-sm-3 form-control-static"></div>
</div>
<div class="row">
<label class="col-sm-3 control-label" data-translate>Word Count</label>
<label class="col-sm-3 control-label" data-translate>Raw Entropy Words</label>
<div class="word-count col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate><span class="more-info" data-translate-title title="Total bits of entropy may be less than indicated if any entropy event uses a weak source.">Total Bits</span></label>
<div class="bits col-sm-3 form-control-static"></div>
@@ -19902,6 +19902,16 @@ bitcoin.networks.clam = {
wif: 0x85,
};
bitcoin.networks.crown = {
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80,
};
bitcoin.networks.dash = {
bip32: {
public: 0x0488b21e,
@@ -19912,6 +19922,16 @@ bitcoin.networks.dash = {
wif: 0xcc,
};
bitcoin.networks.dashtn = {
bip32: {
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 0x8c,
scriptHash: 0x13,
wif: 0xef,
};
bitcoin.networks.game = {
bip32: {
public: 0x0488b21e,
@@ -43754,7 +43774,7 @@ window.Entropy = new (function() {
DOM.entropy = $(".entropy");
DOM.entropyFiltered = DOM.entropyContainer.find(".filtered");
DOM.entropyType = DOM.entropyContainer.find(".type");
DOM.entropyStrength = DOM.entropyContainer.find(".strength");
DOM.entropyCrackTime = DOM.entropyContainer.find(".crack-time");
DOM.entropyEventCount = DOM.entropyContainer.find(".event-count");
DOM.entropyBits = DOM.entropyContainer.find(".bits");
DOM.entropyBitsPerEvent = DOM.entropyContainer.find(".bits-per-event");
@@ -44309,7 +44329,7 @@ window.Entropy = new (function() {
indexText = indexText + "'";
}
// Ethereum values are different
if (networks[DOM.network.val()].name == "Ethereum") {
if (networks[DOM.network.val()].name == "ETH - Ethereum") {
var privKeyBuffer = key.privKey.d.toBuffer();
privkey = privKeyBuffer.toString('hex');
var addressBuffer = ethUtil.privateToAddress(privKeyBuffer);
@@ -44320,7 +44340,7 @@ window.Entropy = new (function() {
pubkey = ethUtil.addHexPrefix(pubkey);
}
// Ripple values are different
if (networks[DOM.network.val()].name == "Ripple") {
if (networks[DOM.network.val()].name == "XRP - Ripple") {
privkey = convertRipplePriv(privkey);
address = convertRippleAdrr(address);
}
@@ -44639,7 +44659,7 @@ window.Entropy = new (function() {
}
function clearEntropyFeedback() {
DOM.entropyStrength.text("...");
DOM.entropyCrackTime.text("...");
DOM.entropyType.text("");
DOM.entropyWordCount.text("0");
DOM.entropyEventCount.text("0");
@@ -44651,37 +44671,15 @@ window.Entropy = new (function() {
function showEntropyFeedback(entropy) {
var numberOfBits = entropy.binaryStr.length;
var strength = "extremely weak";
if (numberOfBits >= 64) {
strength = "very weak";
}
if (numberOfBits >= 96) {
strength = "weak";
}
if (numberOfBits >= 128) {
strength = "strong";
}
if (numberOfBits >= 160) {
strength = "very strong";
}
if (numberOfBits >= 192) {
strength = "extremely strong";
}
// If time to crack is less than one day, and password is considered
// strong or better based on the number of bits, rename strength to
// 'easily cracked'.
var timeToCrack = "unknown";
try {
var z = zxcvbn(entropy.base.parts.join(""));
var timeToCrack = z.crack_times_seconds.offline_fast_hashing_1e10_per_second;
if (timeToCrack < 86400 && entropy.binaryStr.length >= 128) {
strength = "easily cracked";
if (z.feedback.warning != "") {
strength = strength + " - " + z.feedback.warning;
};
}
timeToCrack = z.crack_times_display.offline_fast_hashing_1e10_per_second;
if (z.feedback.warning != "") {
timeToCrack = timeToCrack + " - " + z.feedback.warning;
};
}
catch (e) {
strength = "unknown";
console.log("Error detecting entropy strength with zxcvbn:");
console.log(e);
}
@@ -44690,7 +44688,7 @@ window.Entropy = new (function() {
var bitsPerEvent = entropy.bitsPerEvent.toFixed(2);
DOM.entropyFiltered.html(entropy.cleanHtml);
DOM.entropyType.text(entropyTypeStr);
DOM.entropyStrength.text(strength);
DOM.entropyCrackTime.text(timeToCrack);
DOM.entropyEventCount.text(entropy.base.ints.length);
DOM.entropyBits.text(numberOfBits);
DOM.entropyWordCount.text(wordCount);
@@ -44803,131 +44801,145 @@ window.Entropy = new (function() {
var networks = [
{
name: "Bitcoin",
name: "BTC - Bitcoin",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(0);
},
},
{
name: "Bitcoin Testnet",
name: "BTC - Bitcoin Testnet",
onSelect: function() {
network = bitcoin.networks.testnet;
DOM.bip44coin.val(1);
},
},
{
name: "CLAM",
name: "CLAM - Clams",
onSelect: function() {
network = bitcoin.networks.clam;
DOM.bip44coin.val(23);
},
},
{
name: "Dogecoin",
name: "CRW - Crown",
onSelect: function() {
network = bitcoin.networks.dogecoin;
DOM.bip44coin.val(3);
network = bitcoin.networks.crown;
DOM.bip44coin.val(72);
},
},
{
name: "DASH",
name: "DASH - Dash",
onSelect: function() {
network = bitcoin.networks.dash;
DOM.bip44coin.val(5);
},
},
{
name: "Ethereum",
name: "DASH - Dash Testnet",
onSelect: function() {
network = bitcoin.networks.dashtn;
DOM.bip44coin.val(1);
},
},
{
name: "DOGE - Dogecoin",
onSelect: function() {
network = bitcoin.networks.dogecoin;
DOM.bip44coin.val(3);
},
},
{
name: "ETH - Ethereum",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(60);
},
},
{
name: "GAME",
name: "GAME - GameCredits",
onSelect: function() {
network = bitcoin.networks.game;
DOM.bip44coin.val(101);
},
},
{
name: "Jumbucks",
name: "JBS - Jumbucks",
onSelect: function() {
network = bitcoin.networks.jumbucks;
DOM.bip44coin.val(26);
},
},
{
name: "Litecoin",
name: "LTC - Litecoin",
onSelect: function() {
network = bitcoin.networks.litecoin;
DOM.bip44coin.val(2);
},
},
{
name: "Namecoin",
name: "NMC - Namecoin",
onSelect: function() {
network = bitcoin.networks.namecoin;
DOM.bip44coin.val(7);
},
},
{
name: "Peercoin",
name: "PPC - Peercoin",
onSelect: function() {
network = bitcoin.networks.peercoin;
DOM.bip44coin.val(6);
},
},
{
name: "Ripple",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(144);
},
},
{
name: "ShadowCash",
name: "SDC - ShadowCash",
onSelect: function() {
network = bitcoin.networks.shadow;
DOM.bip44coin.val(35);
},
},
{
name: "ShadowCash Testnet",
name: "SDC - ShadowCash Testnet",
onSelect: function() {
network = bitcoin.networks.shadowtn;
DOM.bip44coin.val(1);
},
},
{
name: "Slimcoin",
name: "SLM - Slimcoin",
onSelect: function() {
network = bitcoin.networks.slimcoin;
DOM.bip44coin.val(63);
},
},
{
name: "Slimcoin Testnet",
name: "SLM - Slimcoin Testnet",
onSelect: function() {
network = bitcoin.networks.slimcointn;
DOM.bip44coin.val(111);
},
},
{
name: "Viacoin",
name: "VIA - Viacoin",
onSelect: function() {
network = bitcoin.networks.viacoin;
DOM.bip44coin.val(14);
},
},
{
name: "Viacoin Testnet",
name: "VIA - Viacoin Testnet",
onSelect: function() {
network = bitcoin.networks.viacointestnet;
DOM.bip44coin.val(1);
},
},
{
name: "XRP - Ripple",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(144);
},
}
]
var clients = [

View File

@@ -1,5 +1,15 @@
# 0.1.2
* Add Crown network
* Network names are displayed with currency code
# 0.1.1
* Add DASH Testnet
* Change entropy Strength to Time To Crack
# 0.1.0 2017-06-14
Add changelog
Display version number in top right
Add hex prefix to ethereum keys
* Add changelog
* Display version number in top right
* Add hex prefix to ethereum keys

View File

@@ -114,7 +114,7 @@
<div class="container">
<h1 class="text-center">Mnemonic Code Converter</h1>
<p class="version">v0.1.0</p>
<p class="version">v0.1.2</p>
<hr>
<div class="row">
<div class="col-md-12">
@@ -165,8 +165,8 @@
<div class="col-sm-7">
<textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards" data-translate-placeholder></textarea>
<div class="row">
<label class="col-sm-3 control-label" data-translate>Strength</label>
<div class="strength col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate><span class="more-info" data-translate-title title="Based on estimates from zxcvbn using Filtered Entropy">Time To Crack</span></label>
<div class="crack-time col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate>Event Count</label>
<div class="event-count col-sm-3 form-control-static"></div>
</div>
@@ -177,7 +177,7 @@
<div class="bits-per-event col-sm-3 form-control-static"></div>
</div>
<div class="row">
<label class="col-sm-3 control-label" data-translate>Word Count</label>
<label class="col-sm-3 control-label" data-translate>Raw Entropy Words</label>
<div class="word-count col-sm-3 form-control-static"></div>
<label class="col-sm-3 control-label" data-translate><span class="more-info" data-translate-title title="Total bits of entropy may be less than indicated if any entropy event uses a weak source.">Total Bits</span></label>
<div class="bits col-sm-3 form-control-static"></div>

View File

@@ -35,6 +35,16 @@ bitcoin.networks.clam = {
wif: 0x85,
};
bitcoin.networks.crown = {
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80,
};
bitcoin.networks.dash = {
bip32: {
public: 0x0488b21e,
@@ -45,6 +55,16 @@ bitcoin.networks.dash = {
wif: 0xcc,
};
bitcoin.networks.dashtn = {
bip32: {
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 0x8c,
scriptHash: 0x13,
wif: 0xef,
};
bitcoin.networks.game = {
bip32: {
public: 0x0488b21e,

View File

@@ -30,7 +30,7 @@
DOM.entropy = $(".entropy");
DOM.entropyFiltered = DOM.entropyContainer.find(".filtered");
DOM.entropyType = DOM.entropyContainer.find(".type");
DOM.entropyStrength = DOM.entropyContainer.find(".strength");
DOM.entropyCrackTime = DOM.entropyContainer.find(".crack-time");
DOM.entropyEventCount = DOM.entropyContainer.find(".event-count");
DOM.entropyBits = DOM.entropyContainer.find(".bits");
DOM.entropyBitsPerEvent = DOM.entropyContainer.find(".bits-per-event");
@@ -585,7 +585,7 @@
indexText = indexText + "'";
}
// Ethereum values are different
if (networks[DOM.network.val()].name == "Ethereum") {
if (networks[DOM.network.val()].name == "ETH - Ethereum") {
var privKeyBuffer = key.privKey.d.toBuffer();
privkey = privKeyBuffer.toString('hex');
var addressBuffer = ethUtil.privateToAddress(privKeyBuffer);
@@ -596,7 +596,7 @@
pubkey = ethUtil.addHexPrefix(pubkey);
}
// Ripple values are different
if (networks[DOM.network.val()].name == "Ripple") {
if (networks[DOM.network.val()].name == "XRP - Ripple") {
privkey = convertRipplePriv(privkey);
address = convertRippleAdrr(address);
}
@@ -915,7 +915,7 @@
}
function clearEntropyFeedback() {
DOM.entropyStrength.text("...");
DOM.entropyCrackTime.text("...");
DOM.entropyType.text("");
DOM.entropyWordCount.text("0");
DOM.entropyEventCount.text("0");
@@ -927,37 +927,15 @@
function showEntropyFeedback(entropy) {
var numberOfBits = entropy.binaryStr.length;
var strength = "extremely weak";
if (numberOfBits >= 64) {
strength = "very weak";
}
if (numberOfBits >= 96) {
strength = "weak";
}
if (numberOfBits >= 128) {
strength = "strong";
}
if (numberOfBits >= 160) {
strength = "very strong";
}
if (numberOfBits >= 192) {
strength = "extremely strong";
}
// If time to crack is less than one day, and password is considered
// strong or better based on the number of bits, rename strength to
// 'easily cracked'.
var timeToCrack = "unknown";
try {
var z = zxcvbn(entropy.base.parts.join(""));
var timeToCrack = z.crack_times_seconds.offline_fast_hashing_1e10_per_second;
if (timeToCrack < 86400 && entropy.binaryStr.length >= 128) {
strength = "easily cracked";
if (z.feedback.warning != "") {
strength = strength + " - " + z.feedback.warning;
};
}
timeToCrack = z.crack_times_display.offline_fast_hashing_1e10_per_second;
if (z.feedback.warning != "") {
timeToCrack = timeToCrack + " - " + z.feedback.warning;
};
}
catch (e) {
strength = "unknown";
console.log("Error detecting entropy strength with zxcvbn:");
console.log(e);
}
@@ -966,7 +944,7 @@
var bitsPerEvent = entropy.bitsPerEvent.toFixed(2);
DOM.entropyFiltered.html(entropy.cleanHtml);
DOM.entropyType.text(entropyTypeStr);
DOM.entropyStrength.text(strength);
DOM.entropyCrackTime.text(timeToCrack);
DOM.entropyEventCount.text(entropy.base.ints.length);
DOM.entropyBits.text(numberOfBits);
DOM.entropyWordCount.text(wordCount);
@@ -1079,131 +1057,145 @@
var networks = [
{
name: "Bitcoin",
name: "BTC - Bitcoin",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(0);
},
},
{
name: "Bitcoin Testnet",
name: "BTC - Bitcoin Testnet",
onSelect: function() {
network = bitcoin.networks.testnet;
DOM.bip44coin.val(1);
},
},
{
name: "CLAM",
name: "CLAM - Clams",
onSelect: function() {
network = bitcoin.networks.clam;
DOM.bip44coin.val(23);
},
},
{
name: "Dogecoin",
name: "CRW - Crown",
onSelect: function() {
network = bitcoin.networks.dogecoin;
DOM.bip44coin.val(3);
network = bitcoin.networks.crown;
DOM.bip44coin.val(72);
},
},
{
name: "DASH",
name: "DASH - Dash",
onSelect: function() {
network = bitcoin.networks.dash;
DOM.bip44coin.val(5);
},
},
{
name: "Ethereum",
name: "DASH - Dash Testnet",
onSelect: function() {
network = bitcoin.networks.dashtn;
DOM.bip44coin.val(1);
},
},
{
name: "DOGE - Dogecoin",
onSelect: function() {
network = bitcoin.networks.dogecoin;
DOM.bip44coin.val(3);
},
},
{
name: "ETH - Ethereum",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(60);
},
},
{
name: "GAME",
name: "GAME - GameCredits",
onSelect: function() {
network = bitcoin.networks.game;
DOM.bip44coin.val(101);
},
},
{
name: "Jumbucks",
name: "JBS - Jumbucks",
onSelect: function() {
network = bitcoin.networks.jumbucks;
DOM.bip44coin.val(26);
},
},
{
name: "Litecoin",
name: "LTC - Litecoin",
onSelect: function() {
network = bitcoin.networks.litecoin;
DOM.bip44coin.val(2);
},
},
{
name: "Namecoin",
name: "NMC - Namecoin",
onSelect: function() {
network = bitcoin.networks.namecoin;
DOM.bip44coin.val(7);
},
},
{
name: "Peercoin",
name: "PPC - Peercoin",
onSelect: function() {
network = bitcoin.networks.peercoin;
DOM.bip44coin.val(6);
},
},
{
name: "Ripple",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(144);
},
},
{
name: "ShadowCash",
name: "SDC - ShadowCash",
onSelect: function() {
network = bitcoin.networks.shadow;
DOM.bip44coin.val(35);
},
},
{
name: "ShadowCash Testnet",
name: "SDC - ShadowCash Testnet",
onSelect: function() {
network = bitcoin.networks.shadowtn;
DOM.bip44coin.val(1);
},
},
{
name: "Slimcoin",
name: "SLM - Slimcoin",
onSelect: function() {
network = bitcoin.networks.slimcoin;
DOM.bip44coin.val(63);
},
},
{
name: "Slimcoin Testnet",
name: "SLM - Slimcoin Testnet",
onSelect: function() {
network = bitcoin.networks.slimcointn;
DOM.bip44coin.val(111);
},
},
{
name: "Viacoin",
name: "VIA - Viacoin",
onSelect: function() {
network = bitcoin.networks.viacoin;
DOM.bip44coin.val(14);
},
},
{
name: "Viacoin Testnet",
name: "VIA - Viacoin Testnet",
onSelect: function() {
network = bitcoin.networks.viacointestnet;
DOM.bip44coin.val(1);
},
},
{
name: "XRP - Ripple",
onSelect: function() {
network = bitcoin.networks.bitcoin;
DOM.bip44coin.val(144);
},
}
]
var clients = [

147
tests.js
View File

@@ -281,7 +281,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Bitcoin Testnet";
return $(this).html() == "BTC - Bitcoin Testnet";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -311,7 +311,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Litecoin";
return $(this).html() == "LTC - Litecoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -341,7 +341,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Ripple";
return $(this).html() == "XRP - Ripple";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -351,7 +351,7 @@ page.open(url, function(status) {
return $(".address:first").text();
});
if (actual != expected) {
console.log("Litecoin address is incorrect");
console.log("Ripple address is incorrect");
console.log("Expected: " + expected);
console.log("Actual: " + actual);
fail();
@@ -371,7 +371,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Dogecoin";
return $(this).html() == "DOGE - Dogecoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -401,7 +401,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "ShadowCash";
return $(this).html() == "SDC - ShadowCash";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -431,7 +431,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "ShadowCash Testnet";
return $(this).html() == "SDC - ShadowCash Testnet";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -461,7 +461,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Viacoin";
return $(this).html() == "VIA - Viacoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -491,7 +491,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Viacoin Testnet";
return $(this).html() == "VIA - Viacoin Testnet";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -521,7 +521,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Jumbucks";
return $(this).html() == "JBS - Jumbucks";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -551,7 +551,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "CLAM";
return $(this).html() == "CLAM - Clams";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -571,6 +571,36 @@ page.open(url, function(status) {
});
},
// Network can be set to crown
function() {
page.open(url, function(status) {
// set the phrase and coin
var expected = "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5";
page.evaluate(function() {
$(".phrase").val("abandon abandon ability");
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "CRW - Crown";
}).prop("selected", true);
$(".network").trigger("change");
});
// check the address is generated correctly
waitForGenerate(function() {
var actual = page.evaluate(function() {
return $(".address:first").text();
});
if (actual != expected) {
console.log("CRW address is incorrect");
console.log("Expected: " + expected);
console.log("Actual: " + actual);
fail();
}
next();
});
});
},
// Network can be set to dash
function() {
page.open(url, function(status) {
@@ -581,7 +611,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "DASH";
return $(this).html() == "DASH - Dash";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -601,6 +631,35 @@ page.open(url, function(status) {
});
},
function() {
page.open(url, function(status) {
// set the phrase and coin
var expected = "yaR52EN4oojdJfBgzWJTymC4uuCLPT29Gw";
page.evaluate(function() {
$(".phrase").val("abandon abandon ability");
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "DASH - Dash Testnet";
}).prop("selected", true);
$(".network").trigger("change");
});
// check the address is generated correctly
waitForGenerate(function() {
var actual = page.evaluate(function() {
return $(".address:first").text();
});
if (actual != expected) {
console.log("DASH Testnet address is incorrect");
console.log("Expected: " + expected);
console.log("Actual: " + actual);
fail();
}
next();
});
});
},
// Network can be set to game
function() {
page.open(url, function(status) {
@@ -611,7 +670,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "GAME";
return $(this).html() == "GAME - GameCredits";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -641,7 +700,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Namecoin";
return $(this).html() == "NMC - Namecoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -671,7 +730,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Peercoin";
return $(this).html() == "PPC - Peercoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -702,7 +761,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Ethereum";
return $(this).html() == "ETH - Ethereum";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -725,7 +784,7 @@ page.open(url, function(status) {
// this private key can be imported into
// https://www.myetherwallet.com/#view-wallet-info
// and it should correlate to the address above
var expected = "8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7";
var expected = "0x8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7";
var actual = page.evaluate(function() {
return $(".privkey:first").text();
});
@@ -763,7 +822,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Slimcoin";
return $(this).html() == "SLM - Slimcoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -793,7 +852,7 @@ page.open(url, function(status) {
$(".phrase").trigger("input");
$(".network option[selected]").removeAttr("selected");
$(".network option").filter(function() {
return $(this).html() == "Slimcoin Testnet";
return $(this).html() == "SLM - Slimcoin Testnet";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -1985,7 +2044,7 @@ page.open(url, function(status) {
// 4) switch from bitcoin to litecoin
page.evaluate(function() {
$(".network option").filter(function() {
return $(this).html() == "Litecoin";
return $(this).html() == "LTC - Litecoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -2031,7 +2090,7 @@ page.open(url, function(status) {
// switch from bitcoin to clam
page.evaluate(function() {
$(".network option").filter(function() {
return $(this).html() == "CLAM";
return $(this).html() == "CLAM - Clams";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -2065,7 +2124,7 @@ page.open(url, function(status) {
// 4) switch from bitcoin to viacoin
page.evaluate(function() {
$(".network option").filter(function() {
return $(this).html() == "Viacoin";
return $(this).html() == "VIA - Viacoin";
}).prop("selected", true);
$(".network").trigger("change");
});
@@ -2795,7 +2854,7 @@ page.open(url, function(status) {
events: 1,
bits: 4,
words: 0,
strength: "extremely weak",
strength: "less than a second",
},
{
entropy: "AAAAAAAA",
@@ -2804,7 +2863,7 @@ page.open(url, function(status) {
events: 8,
bits: 32,
words: 3,
strength: "extremely weak",
strength: "less than a second - Repeats like \"aaa\" are easy to guess",
},
{
entropy: "AAAAAAAA B",
@@ -2813,7 +2872,7 @@ page.open(url, function(status) {
events: 9,
bits: 36,
words: 3,
strength: "extremely weak",
strength: "less than a second - Repeats like \"aaa\" are easy to guess",
},
{
entropy: "AAAAAAAA BBBBBBBB",
@@ -2822,7 +2881,7 @@ page.open(url, function(status) {
events: 16,
bits: 64,
words: 6,
strength: "very weak",
strength: "less than a second - Repeats like \"aaa\" are easy to guess",
},
{
entropy: "AAAAAAAA BBBBBBBB CCCCCCCC",
@@ -2831,7 +2890,7 @@ page.open(url, function(status) {
events: 24,
bits: 96,
words: 9,
strength: "weak",
strength: "less than a second",
},
{
entropy: "AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD",
@@ -2840,7 +2899,7 @@ page.open(url, function(status) {
events: 32,
bits: 128,
words: 12,
strength: "easily cracked",
strength: "2 minutes",
},
{
entropy: "AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDA",
@@ -2849,7 +2908,7 @@ page.open(url, function(status) {
events: 32,
bits: 128,
words: 12,
strength: "strong",
strength: "2 days",
},
{
entropy: "AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDA EEEEEEEE",
@@ -2858,7 +2917,7 @@ page.open(url, function(status) {
events: 40,
bits: 160,
words: 15,
strength: "very strong",
strength: "3 years",
},
{
entropy: "AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDA EEEEEEEE FFFFFFFF",
@@ -2867,7 +2926,7 @@ page.open(url, function(status) {
events: 48,
bits: 192,
words: 18,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "7d",
@@ -2875,7 +2934,7 @@ page.open(url, function(status) {
events: 1,
bits: 5,
words: 0,
strength: "extremely weak",
strength: "less than a second",
},
{
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
@@ -2883,7 +2942,7 @@ page.open(url, function(status) {
events: 52,
bits: 225,
words: 21,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks3d",
@@ -2891,7 +2950,7 @@ page.open(url, function(status) {
events: 53,
bits: 254,
words: 21,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqs3d4d",
@@ -2899,7 +2958,7 @@ page.open(url, function(status) {
events: 53,
bits: 254,
words: 21,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqs3d4d5d6d",
@@ -2907,7 +2966,7 @@ page.open(url, function(status) {
events: 53,
bits: 264,
words: 24,
strength: "extremely strong",
strength: "centuries",
},
// Next test was throwing uncaught error in zxcvbn
// Also tests 451 bits, ie Math.log2(52!)*2 = 225.58 * 2
@@ -2917,7 +2976,7 @@ page.open(url, function(status) {
events: 104,
bits: 499,
words: 45,
strength: "extremely strong",
strength: "centuries",
},
// Case insensitivity to duplicate cards
{
@@ -2926,7 +2985,7 @@ page.open(url, function(status) {
events: 2,
bits: 9,
words: 0,
strength: "extremely weak",
strength: "less than a second",
},
{
entropy: "ASas",
@@ -2934,7 +2993,7 @@ page.open(url, function(status) {
events: 2,
bits: 9,
words: 0,
strength: "extremely weak",
strength: "less than a second",
},
// Missing cards are detected
{
@@ -2943,7 +3002,7 @@ page.open(url, function(status) {
events: 51,
bits: 221,
words: 18,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d 6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
@@ -2951,7 +3010,7 @@ page.open(url, function(status) {
events: 50,
bits: 216,
words: 18,
strength: "extremely strong",
strength: "centuries",
},
{
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d 6d7d8d9dtdjd kdah2h3h 5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
@@ -2959,7 +3018,7 @@ page.open(url, function(status) {
events: 48,
bits: 208,
words: 18,
strength: "extremely strong",
strength: "centuries",
},
// More than six missing cards does not show message
{
@@ -2968,7 +3027,7 @@ page.open(url, function(status) {
events: 45,
bits: 195,
words: 18,
strength: "extremely strong",
strength: "centuries",
},
// Multiple decks of cards increases bits per event
{
@@ -3012,7 +3071,7 @@ page.open(url, function(status) {
events: 33,
bits: 184,
bitsPerEvent: 5.59,
strength: 'easily cracked - Repeats like "abcabcabc" are only slightly harder to guess than "abc"',
strength: 'less than a second - Repeats like "abcabcabc" are only slightly harder to guess than "abc"',
},
];
// use entropy