使用什么来进行密码哈希? 有什么理由不使用jBCrypt?

发布于 2024-07-14 12:03:57 字数 441 浏览 13 评论 0原文

我计划在新的 Web 应用程序中使用 jBCrypt 进行密码哈希处理,正如预期的那样成为我读过的最好的。 因为我之前没有使用过它,所以我正在研究是否有任何理由不使用它。

我有这个:

  • 我还没有在 Maven 存储库中找到它(在 mvnrepository.org 上搜索 jbcrypt 和 bcrypt),这是一个令人沮丧的事情,因为如果可能的话,我希望使用 Maven 存储库来管理我的依赖项。 如果 jBCrypt 是密码散列的最佳解决方案,我就必须设置自己的本地存储库并以这种方式提供它。 或者我只是错过了? 也许它就在那里某个地方?
  • 它只有 0.2 版本,但也许它无论如何都是稳定的,版本号低的原因还有其他原因吗?

I'm planning to use jBCrypt for password hashing in a new web application, as it is supposed to be the best from what I've read. As I haven't used it before I'm looking into if there is any reason not to use it.

I have this:

  • I haven't found it in the Maven repository (searched for jbcrypt and bcrypt at mvnrepository.org) which is a downer as I'd like to have my dependencies managed using a Maven repository if possible. If jBCrypt is the best of breed solution for password hashing I'd have to setup my own local repository and have it available that way. Or have I just missed it? Maybe it's in there somewhere?
  • It's only at version 0.2, but maybe it's stable anyway and the reason for a low version number has some other cause?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

残花月 2024-07-21 12:03:57

jBcrypt 作为密码的加密算法可能很不错; 河豚的实力比较强。 尽管 Blowfish 本身存在一些报告的实现缺陷,但我没有找到任何有关 jBcrypt 的报告。 另一方面,Blowfish 并没有像其他算法那样经过严格的测试,并且

因此,我的建议是:

  • 继续使用 jBcrypt,但在合理范围内保护您的加密密码文件 — 就像在 UNIX 系统上使用 /etc/shadow 一样。
  • 与 Nikhil 的建议相反,我会将源代码拉入您的版本控制中,原因有两个:(1) 您还可以将它们保存在哪里,因为您每次构建时都需要它们,(2) 因为有做 jBcrypt 的人总是有机会会转向其他事情,并且你不想在交付之前发现自己悬而未决(这是不可避免的,当你发现时。)在这种情况下,我会将源代码放入您的版本控制中,就像它们是您的代码一样,然后可以插入任何更改,就像您自己构建了新版本一样。 不需要比平时更复杂。

jBcrypt is probably fine as a crypto algorithm for your passwords; blowfish is relatively strong. Although there have been some reported implementation flaws in Blowfish itself, I don't find anything much reported about jBcrypt. On the other hand, Blowfish hasn't been tested nearly as heavily as other algorithms have, and a crack-style known-plaintxt attack often works better than expected, surprising crypto geeks.

So here's what I'd suggest:

  • go ahead and use jBcrypt but protect your encrypted password files to the extent you reasonably can -- as you would using /etc/shadow on a UNIX system.
  • Contrary to Nikhil's suggestion, I would pull the sources into your version control, for two reasons: (1) where else would you keep them, since you need them whenever you build, and (2) because there's always the chance the person doing jBcrypt will move on to other things, and you don't want to find yourself left dangling just before a delivery (which is inevitably when you'd find out.) In this kind of situation, I'd put the sources into your version control as if they were your on code, and then any changes can be inserted as if you'd built a new version yourself. No need to be more complicated than you normally would be.
别挽留 2024-07-21 12:03:57

至于您担心它不成熟,我建议您建立自己的 JUnit 测试,比较 jBcrypt 和更成熟的 Bcrypt 的结果,看看是否得到相同的结果,然后将这些结果贡献给 jBcrypt项目。

但这已经完成了:

...附带一组 JUnit 单元
测试以验证正确操作
库和兼容性
规范的 C 实现
bcrypt算法。

仔细研究 JUnit 测试,看看它们是否满足您的满意程度,这就是我要开始的地方......

As far as your concern that it's not mature, I was going to suggest that you set up your own JUnit tests comparing the results of jBcrypt and the more proven Bcrypt, to see if you get the same results, and then contribute those to the jBcrypt project.

But that's already been done:

... ships with a set of JUnit unit
tests to verify correct operation of
the library and compatibility with the
canonical C implementation of the
bcrypt algorithm.

Perusing the JUnit tests to see if they meet your level of satisfaction is where I'd start...

九命猫 2024-07-21 12:03:57

我怀疑稳定性会成为一个问题,因为 bcrypt 本身已经成熟,而且其微小的标准化包装器并没有做任何非凡的事情。 我对 Damien Miller 的另一个 bcrypt 包装器 python-bcrypt 很满意,它是仅适用于 0.1 版本。

我不熟悉 Maven,但是(异端警报!)我怀疑您是否需要像 bcrypt 这样简单的组件的版本控制。 引用该网站的话,从 v0.1 到 v0.2 的变化是“正确性、拼写错误和 API 调整(完全向后兼容)”,并且 TODO 列表为空。

I doubt stability is going to be an issue, since bcrypt itself is mature and its tiny, standardized wrappers don't do anything extraordinary. I'm happy with Damien Miller's other bcrypt wrapper, python-bcrypt, which is only on version 0.1.

I'm unfamiliar with Maven, but (heresy alert!) I doubt you need version control for a component as simple as bcrypt. To quote the site, the changes from v0.1 to v0.2 were "correctness, typo and API tweaks (fully backwards compatible)," and the TODO list is empty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文