Java实现的crypt(3)? [英] Java implementation of crypt(3)?

查看:381
本文介绍了Java实现的crypt(3)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以指点我的java的crypt(3)库吗?一个生成类似于PHP的结果。例如



james => $ 1 $ uAjE75CY $ XVIp.DpCuwQTG60h.r5er /



谢谢



更新:



上面的密码由$分隔。 1代表MD5(变异)。下一个标记表示用于散列的盐,最后一个标记表示MD5散列。这个散列是MD5算法的一个变体。

解决方案

尝试这个,



https:// github .com / jonabbey / Ganymede / blob / master / src / ganymede / arlut / csd / crypto / MD5Crypt.java



我能够使用它比较PHP crypt生成的密码。



请注意,此课程使用自己的MD5课程。


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.

这篇关于Java实现的crypt(3)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆