Raging Goblin

Java Crypt

A java alternative for PHP Crypt

With PHP you can use the function Crypt to hash your passwords. In Java we do not have such a function at our disposal. After a little research I found a couple of Java implementations on an ftp site created by Jonathan Abbey and James Ratcliff. I wrote a small wrapper around these crypt functions to emulate the PHP functionality. Only the algorithms MD5, SHA256 and SHA512 are supported. Feel free to extend its functionality. Java Crypt is released under the Gnu Public License.

Usage

  • From command line:
    java -jar Crypt.jar [String to encrypt] [salt]
    Eg: java -jar Crypt.jar rasmuslerdorf $6$rounds=5000$usesomesillystringforsalt$
    produces: $6$rounds=5000$usesomesillystri$D4IrlXatmP7rx3P3InaxBeoomnAihCKRVQP22JZ6EY47Wc6BkroIuUUBOov1i.S5KPgErtP/EN5mcO.ChWQW21
  • Use as library in your project:
    package: raging.goblin.crypt
    class: Crypt
    method: public static String crypt(String toCrypt, String salt) throws CryptException

Downloads

Binaries: https://docs.google.com/open?id=0B2BnX0ubpIbcaWg1dDY2Rmd5c2M
Sources: https://docs.google.com/open?id=0B2BnX0ubpIbcU3ZiOW9lTjlxb1U

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.