|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.authentication.encryption.UnixDESEncryption
public class UnixDESEncryption
A variation of the DES algorithm (Data Encryption Standard) as used in the Unix systems for a while. It has variations intended to be used for encrypting password and it uses salting to perturb the algorithm in different ways.
This symmetric-key encryption method uses a 56-bit key to encrypt a password and as such it is now considered as insecure for many applications; in 1999 it was broken in 22 hours and 15 minutes. It was then replaced by the MD5 algorithm. It is no more supported in Silverpeas and it shouldn't be used anymore. It is the Java-based implementation of the unix encrypt command. It is based upon C source code written by Eric Young, eay@psych.uq.oz.au. This class is a renaming of the jcrypt class found at http://www.vulcanware.com/java_jcrypt/
Field Summary |
---|
Fields inherited from interface org.silverpeas.authentication.encryption.PasswordEncryption |
---|
BAD_PASSWORD_MESSAGE |
Constructor Summary | |
---|---|
UnixDESEncryption()
|
Method Summary | |
---|---|
void |
check(String password,
String digest)
Checks the specified password matches the specified digest. |
boolean |
doUnderstandDigest(String digest)
Does this encryption understand the specified digest? |
String |
encrypt(String password)
Encrypts the specified password by using a random salt (or no salt for some weakness algorithms). |
String |
encrypt(String password,
byte[] salt)
Encrypts the specified password by using the specified salt. |
byte[] |
getSaltUsedInDigest(String digest)
Gets the salt that was used to compute the specified digest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnixDESEncryption()
Method Detail |
---|
public String encrypt(String password)
encrypt
in interface PasswordEncryption
password
- the password to encrypt.
public String encrypt(String password, byte[] salt)
encrypt
in interface PasswordEncryption
password
- the password to encrypt.salt
- the salt to use to generate more entropy in the encryption of the password.
public void check(String password, String digest) throws AssertionError
check
in interface PasswordEncryption
password
- an unencrypted password.digest
- a digest of a password with which the specified password has to be matched.
AssertionError
- if the digest wasn't computed from the specified password.public byte[] getSaltUsedInDigest(String digest)
getSaltUsedInDigest
in interface PasswordEncryption
digest
- the digest from which the salt has to be get.
public boolean doUnderstandDigest(String digest)
doUnderstandDigest
in interface PasswordEncryption
digest
- the digest to analyse.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |