diff --git a/src/index.html b/src/index.html index 6a24a1f..c918077 100644 --- a/src/index.html +++ b/src/index.html @@ -119,6 +119,18 @@

+ +
+ + +

Valid entropy values include:

@@ -207,6 +219,13 @@
+
@@ -973,6 +992,12 @@

+

PBKDF2

+

What is PBKDF2 (Password Based Key Derivation Function 2) ?

+

Please refer to this wikipedia article for more detail. + Mail about PBKDF2 security here.

+

Wallet software that implement BIP39 only use 2048 iterations as a norm. Increasing this parameter will increase security against brute force attack, but you will need to store this new parameter. However, as long as you back up your BIP39 seed there will not be risk to lost your fund. To access them with custom PBKDF2 iterations, use this file (or other) to compute your targeted BIP39 seed.

+

Using less than 2048 PBKDF2 iterations is insecure without strong optional BIP39 Passphrase.

License

Please refer to the software license for more detail. diff --git a/src/js/index.js b/src/js/index.js index 578c57f..8151cd0 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -44,6 +44,9 @@ DOM.entropyWordIndexes = DOM.entropyContainer.find(".word-indexes"); DOM.entropyChecksum = DOM.entropyContainer.find(".checksum"); DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length"); + DOM.pbkdf2Rounds = DOM.entropyContainer.find(".pbkdf2-rounds"); + DOM.pbkdf2CustomInput = DOM.entropyContainer.find("#pbkdf2-custom-input"); + DOM.pbkdf2InfosDanger = $(".PBKDF2-infos-danger"); DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning"); DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); DOM.phrase = $(".phrase"); @@ -147,6 +150,8 @@ DOM.autoCompute.on("change", delayedPhraseChanged); DOM.entropy.on("input", delayedEntropyChanged); DOM.entropyMnemonicLength.on("change", entropyChanged); + DOM.pbkdf2Rounds.on("change", pbkdf2RoundsChanged); + DOM.pbkdf2CustomInput.on("change", pbkdf2RoundsChanged); DOM.entropyTypeInputs.on("change", entropyTypeChanged); DOM.phrase.on("input", delayedPhraseChanged); DOM.showSplitMnemonic.on("change", toggleSplitMnemonic); @@ -349,6 +354,24 @@ entropyChangeTimeoutEvent = setTimeout(entropyChanged, 400); } + function pbkdf2RoundsChanged() { + if (DOM.pbkdf2Rounds.val() == "custom") { + PBKDF2_ROUNDS = DOM.pbkdf2CustomInput.val(); + DOM.pbkdf2CustomInput.removeClass("hidden"); + } else { + PBKDF2_ROUNDS = DOM.pbkdf2Rounds.val(); + DOM.pbkdf2CustomInput.addClass("hidden"); + } + ispbkdf2Rounds2048(); + phraseChanged(); + } + function ispbkdf2Rounds2048() { + if (PBKDF2_ROUNDS == 2048) { + DOM.pbkdf2InfosDanger.addClass("hidden"); + } else { + DOM.pbkdf2InfosDanger.removeClass("hidden"); + } + } function entropyChanged() { // If blank entropy, clear mnemonic, addresses, errors if (DOM.entropy.val().trim().length == 0) { diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js index 1e52d9d..00d0523 100644 --- a/src/js/jsbip39.js +++ b/src/js/jsbip39.js @@ -28,7 +28,9 @@ var Mnemonic = function(language) { - var PBKDF2_ROUNDS = 2048; + var DOM = {}; + DOM.entropyContainer = $(".entropy-container"); + PBKDF2_ROUNDS = DOM.entropyContainer.find(".pbkdf2-rounds").val(); var RADIX = 2048; var self = this;