简体   繁体   English

我应该在Java中使用jBcrypt或PBKDF2进行密码加密吗?

[英]Should I use jBcrypt or PBKDF2 for password salting in Java?

Hello Everyone! 大家好!

I am still fairly new to Java programming, so please forgive me if this question is not thorough enough. 我对Java编程还是很陌生,所以如果这个问题不够彻底,请原谅我。

I am trying to find a way to salt and hash my passwords in Java for a web app that requires a password login. 我正在尝试为需要密码登录的Web应用程序寻找一种在Java中添加和散列密码的方法。

I tried to use the Bouncy Castle bcrypt and scrypt classes in order to get a method of salting, hashing, and password verification only to find out that there is no password verification method in either one of these classes. 我试图使用Bouncy Castle bcrypt和scrypt类来获得盐化,散列和密码验证的方法,只是发现这两个类中的任何一个都不存在密码验证方法。 If I am incorrect in this assessment, please let me know what the method is for password verification or if I am missing something. 如果我的评估不正确,请让我知道密码验证的方法是什么,或者如果我遗漏了什么。

As an alternative, I have decided to try out bcrypt instead before I just break down and go to PDBKF2 since there is more documentation out there for that instead of bcrypt or scrypt. 作为替代方案,我决定尝试使用bcrypt代替,然后再分解并转到PDBKF2,因为那里有更多的文档代替bcrypt或scrypt。

The problem that I am running into is that I found Mindrot's bcrypt at this website: http://www.mindrot.org/projects/jBCrypt/#download , but my concern is that it hasn't been updated in about two years. 我遇到的问题是,我在以下网站上发现了Mindrot的bcrypt:http://www.mindrot.org/projects/jBCrypt/#download,但我担心的是它大约两年没有更新。 I had a developer at my work tell me to only use encryption methods that are being constantly updated within the past six months, so it makes me really nervous to even consider it. 我有一个开发人员在工作,我告诉我只能使用在过去六个月内不断更新的加密方法,因此,即使考虑一下,我也感到非常紧张。

Has anyone out there used jBcrypt recently? 最近有没有人使用过jBcrypt? Is it still something that I can use for my project? 我还能在项目中使用它吗?

If not, where is somewhere reliable that I can get either bcrypt or scrypt with password verification? 如果不行,哪里可以通过密码验证获得bcrypt或scrypt?

Thanks in advance! 提前致谢!

You should not worry too much about jBcrypt, as far as I know, is a widely used library, and if you check author's webpage you will see that the library has been updated to resolve security issues and bugs. 据我所知,您不必担心jBcrypt是一个广泛使用的库,如果您查看作者的网页 ,将会看到该库已更新,可以解决安全性问题和错误。

The code is not so big and you can take a look, specifically, check the tests. 代码不是很大,您可以看一下,特别是检查测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM