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.

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Apache commons codec contains two clasees for Crypt3

  • org.apache.commons.codec.digest.Crypt
  • org.apache.commons.codec.digest.Md5Crypt

Comments

0

"java crypt" gives several candidates at Google.

3 Comments

yes, found all those but they are not generating passwords similar to that of php crypt().
@James Is it a requirement that the generated passwords (Java, PHP) are the same?
You are aware that most crypt-implementation needs a salt?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.