net.spatula.utils
Class freeBSDcrypt

java.lang.Object
  |
  +--net.spatula.utils.freeBSDcrypt

public class freeBSDcrypt
extends java.lang.Object

Class containing static methods for encrypting passwords in FreeBSD md5 style.


Method Summary
static java.lang.String crypt(java.lang.String password, java.lang.String salt)
          Encrypts a password using FreeBSD-style md5-based encryption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

crypt

public static java.lang.String crypt(java.lang.String password,
                                     java.lang.String salt)
                              throws java.security.NoSuchAlgorithmException
Encrypts a password using FreeBSD-style md5-based encryption
Parameters:
password - The cleartext password to be encrypted
salt - The salt used to add some entropy to the encryption
Returns:
The encrypted password, or an empty string on error
Throws:
java.security.NoSuchAlgorithmException - if java.security does not support MD5