0

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.

James Moore
  • 253
  • 1
  • 6
  • 14

3 Answers3

1

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.

Sergey Ponomarev
  • 2,947
  • 1
  • 33
  • 43
ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
1

Apache commons codec contains two clasees for Crypt3

  • org.apache.commons.codec.digest.Crypt
  • org.apache.commons.codec.digest.Md5Crypt
Sergey Ponomarev
  • 2,947
  • 1
  • 33
  • 43
0

"java crypt" gives several candidates at Google.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347