]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/index.html
Entropy can be supplied by user
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / index.html
index 77ad35f16a7f081687225357bd032c41299664aa..cb7a7817aca290fbeb72204d79f80998db700010 100644 (file)
@@ -51,6 +51,9 @@
             .languages * {
                 padding-left: 10px;
             }
+            .monospace {
+                font-family: monospace;
+            }
         </style>
     </head>
     <body>
                 <div class="col-md-12">
                     <h2>Mnemonic</h2>
                     <form class="form-horizontal" role="form">
-                        <div class="col-sm-2"></div>
-                        <div class="col-sm-10">
-                            <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum)</p>
-                            <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
-                        </div>
                         <div class="form-group">
+                            <div class="col-sm-2"></div>
+                            <div class="col-sm-10">
+                                <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum)</p>
+                                <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
+                            </div>
+                        </div>
+                        <div class="form-group generate-container">
                             <label class="col-sm-2 control-label"></label>
                             <div class="col-sm-10">
                                 <div class="form-inline">
                                 </div>
                             </div>
                         </div>
-                            <div class="form-group">
+                        <div class="entropy-container hidden">
+                            <label for="entropy" class="col-sm-2 control-label">Entropy</label>
+                            <div class="col-sm-10">
+                                <input id="entropy" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal">
+                                <span class="help-block">
+                                    <div class="text-danger">
+                                    This is an advanced feature.
+                                    Your mnemonic may be insecure if this feature is used incorrectly.
+                                    <a href="#entropy-notes">Read more</a>
+                                    </div>
+                                    <div class="text-danger entropy-error"></div>
+                               </span>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <div class="col-sm-2"></div>
+                            <div class="col-sm-10 checkbox">
+                                <label>
+                                    <input type="checkbox" class="use-entropy">
+                                    Supply my own source of entropy
+                                </label>
+                            </div>
+                        </div>
+                        <div class="form-group">
                             <label class="col-sm-2 control-label"></label>
                             <div class="col-sm-10 languages">
                                 <a href="#english">English</a>
                                 <a href="#japanese" title="Japanese">日本語</a>
-                                <span title="Pending availability of BIP39 unit tests">Experimental:</span>
                                 <a href="#spanish"  title="Spanish">Español</a>
                                 <a href="#chinese_simplified"  title="Chinese (Simplified)">中文(简体)</a>
                                 <a href="#chinese_traditional"  title="Chinese (Traditional)">中文(繁體)</a>
                                     <button class="address-toggle">Toggle</button>
                                 </div>
                             </th>
+                            <th>
+                                <div class="input-group">
+                                    Public Key&nbsp;&nbsp;
+                                    <button class="public-key-toggle">Toggle</button>
+                                </div>
+                            </th>
                             <th>
                                 <div class="input-group">
                                     Private Key&nbsp;&nbsp;
                                 </div>
                             </th>
                         </thead>
-                        <tbody class="addresses">
+                        <tbody class="addresses monospace">
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                         but be careful - it can be easy to make mistakes if you
                         don't know what you're doing
                     </p>
+                    <h3 id="entropy-notes">Entropy</h3>
+                    <p>
+                    Entropy values must be sourced from a
+                    <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
+                    This means flipping a fair coin, rolling a fair dice, noise measurements etc. Do <strong>NOT</strong> use
+                    phrases from books, lyrics from songs, your birthday or steet address, keyboard mashing, or anything you <i>think</i>
+                    is random, because chances are <em>overwhelming</em> that it isn't random enough for the needs of this tool.
+                    </p>
+                    <p>
+                    The random mnemonic generator on this page uses a
+                    <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>,
+                    and can generally be trusted more than your own intuition about randomness.
+                    If cryptographic randomness isn't available in your browser, this page will show a warning and <i>will not generate
+                    random mnemonics</i>.
+                    </p>
+                    <p>
+                    <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
+                    </p>
                 </div>
             </div>
 
             <tr>
                 <td class="index"><span></span></td>
                 <td class="address"><span></span></td>
+                <td class="pubkey"><span></span></td>
                 <td class="privkey"><span></span></td>
             </tr>
         </script>
         <script src="js/wordlist_french.js"></script>
         <script src="js/wordlist_italian.js"></script>
         <script src="js/jsbip39.js"></script>
+        <script src="js/entropy.js"></script>
         <script src="js/index.js"></script>
     </body>
 </html>