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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Master password to one password per site with bcrypt algorithm

2 点作者 qixxiq超过 12 年前
Hi all,<p>I created a password utility for myself a while ago that is becoming increasingly useful. I'm looking at turning it into a small web service, as well as open-source offline script but obviously the core algorithm is rather important (and at the moment - may be flawed).<p>I've uploaded the source as a gist if anyone cares to comment: https://gist.github.com/4088402<p>Basically it generates a bcrypt hash using the site name and the password, and then uses the value of the hash to pick out a ten letter password according to certain specifications (starts with a letter, contains atleast one other letter, one number and one symbol).<p>It seems like having the hash only dependent on the site name is a <i>bad idea</i>... but I'm not sure what other choice there is. Having the password influence it would make it significantly cheaper to find the password (which is way more important), but having just the salt there means any users using the same site name which will happen often - will have same salt.<p>There are plans for a number of very useful features (saving comments with passwords, verifying the master password when generating, etc.) but all of that can only come once the core algorithm is nailed - because that will be very hard to change.

2 条评论

ig1超过 12 年前
Don't roll your own crypto. Just don't. It's a bad idea. It's close to impossible to do it correctly even if you're an expert.<p>Just store the passwords in a file and use a well-tested and well-reviewed crypto package to encrypt it.
qixxiq超过 12 年前
Clickable: <a href="https://gist.github.com/4088402" rel="nofollow">https://gist.github.com/4088402</a>