TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Secure Diceware Password Generator with zxcvbn entropy estimates

10 点作者 grempe将近 10 年前

5 条评论

grempe将近 10 年前
I am the author. The source code for this is available at:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;grempe&#x2F;diceware" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;grempe&#x2F;diceware</a><p>Any bug reports are welcome.<p>This was a weekend project that was forked from a project that I thought was nicely done but needed some improvements (<a href="https:&#x2F;&#x2F;github.com&#x2F;yesiamben&#x2F;diceware" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;yesiamben&#x2F;diceware</a>). Notably that project:<p>- uses the JavaScript Math.random() API which is known to not be cryptographically secure. - is not served over an HTTPS connection. - requires re-download of all files to change language. - tracks all page views with Google Analytics - leaked information about the users preferred language via a URL query string parameter. - used inline script tags which make it incompatible with lockdown via a Content Security Policy.<p>So I remedied all of these issues and re-factored and modernized the code. The source of randomness is now the well supported window.crypto.getRandomValues() API which is cryptographically secure. It now also uses a fully Bootstrap based UI and provides password strength feedback using the excellent zxcvbn library from Dropbox (<a href="https:&#x2F;&#x2F;blogs.dropbox.com&#x2F;tech&#x2F;2012&#x2F;04&#x2F;zxcvbn-realistic-password-strength-estimation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blogs.dropbox.com&#x2F;tech&#x2F;2012&#x2F;04&#x2F;zxcvbn-realistic-pass...</a>). The application will now also fully work offline (including language switches). All of the code is signed (keybase.io GPG SIGNED.md) and can be verified and run locally by cloning the repository.<p>I hope you enjoy this. I submitted a pull request to the upstream repository as well but I have not heard back anything to date.
grempe将近 10 年前
@Tomte, thanks for the comment. I agree with your points and I updated the code today to more prominently reflect the actual entropy in a Diceware password (accounting also for standard diceware word and special chars that are manually added and add less entropy). I am calculating out the full Math.log2() value as well, not using the shorter estimate (e.g. 12.9&#x2F;word). I also modified the zxcvbn and FAQ text to reflect that zxcvbn is likely overestimating entropy since it is expecting more traditional passwords and is not aware that it is calculating a diceware password. I think it is still helpful to show the zxcvbn output since it, or something like it, is likely to be used to estimate password strength on websites. Thanks for the feedback. Let me know if you have any other comments.<p>Cheers,<p>Glenn
grempe将近 10 年前
As a follow up. Today I have removed zxcvbn in favor of what I believe to be a much more accurate custom entropy calculator (which also calculates out crack time based on a trillion key&#x2F;second crack attempt, which is what Snowden estimates NSA is capable of at a minimum). Since this is working directly off of the known entropy of every Diceware word it gives a much more realistic estimate. At this point the extra download weight of zxcvbn was no longer worth it and the results are more interesting now as well. Cheers.
Tomte将近 10 年前
zxcvbn and Diceware don&#x27;t mix.<p>Sure, you can run zxcvbn over a Diceware passphrase, but it&#x27;s meaningless, since the whole premise of Diceware is that <i>the attacker may know that you&#x27;re using Diceware</i>. It is designed with that conservative mindset.<p>If you don&#x27;t care about that aspect, there are better ways to derive passphrases than Diceware.<p>Every Diceware word yields 12.9 bits of entropy, so your example passphrase yields 90 bits, not 117.
NateDad将近 10 年前
Heh, I wrote one of these recently, except mine&#x27;s in go: <a href="https:&#x2F;&#x2F;github.com&#x2F;natefinch&#x2F;diceware" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;natefinch&#x2F;diceware</a>