Java implementation of crypt(3)? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question 开发者_运维知识库Could someone point me in the direction of a crypt(3) library for java? One that generates results similar to PHP. e.g.
james => $1$uAjE75CY$XVIp.DpCuwQTG60h.r5er
/
Thanks
Update:
The password above is separated by $. The 1 represents MD5 (variation). The next token represents the salt used for the hash and the last token represents the MD5 hash. This hash is a variation from MD5 algorithm.
Try this one,
https://github.com/jonabbey/Ganymede/blob/master/src/ganymede/arlut/csd/crypto/MD5Crypt.java
I was able to use it to compare password generated by PHP crypt.
Please notice that this class uses its own MD5 class.
Apache commons codec contains two clasees for Crypt3
- org.apache.commons.codec.digest.Crypt
- org.apache.commons.codec.digest.Md5Crypt
"java crypt" gives several candidates at Google.
精彩评论