|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jas.jds.security.UnixCrypt
This class provides us with the ability to encrypt passwords when sent over the network stream
Contains static methods to encrypt and compare passwords with Unix encrypted passwords.
See John Dumas's Java Crypt page for the original source.
Method Summary | |
static java.lang.String |
crypt(java.lang.String original)
Encrypt a password given the cleartext password. |
static java.lang.String |
crypt(java.lang.String salt,
java.lang.String original)
Encrypt a password given the cleartext password and a "salt". |
static boolean |
matches(java.lang.String encryptedPassword,
java.lang.String enteredPassword)
Check that enteredPassword encrypts to encryptedPassword. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final java.lang.String crypt(java.lang.String salt, java.lang.String original)
Encrypt a password given the cleartext password and a "salt".
salt
- A two-character string representing the salt used to
iterate the encryption engine in lots of different ways. If you
are generating a new encryption then this value should be
randomised.original
- The password to be encrypted.public static final java.lang.String crypt(java.lang.String original)
Encrypt a password given the cleartext password. This method generates a random salt using the 'java.util.Random' class.
original
- The password to be encrypted.public static final boolean matches(java.lang.String encryptedPassword, java.lang.String enteredPassword)
Check that enteredPassword encrypts to encryptedPassword.
encryptedPassword
- The encryptedPassword. The first
two characters are assumed to be the salt. This string would
be the same as one found in a Unix /etc/passwd file.enteredPassword
- The password as entered by the user (or
otherwise aquired).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |