|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.dal.utility.PasswordBasedEncryptionUtility
public class PasswordBasedEncryptionUtility
This is a utility class to help with password-based encryption. This implementation uses PKCS#5 standard, which specifies that the Data Encryption Standard (DES) algorithm be used, combined with either MD2 (RFC 1422) or MD5 (RFC 1321) hash-code generation.
| Constructor Summary | |
|---|---|
PasswordBasedEncryptionUtility()
|
|
| Method Summary | |
|---|---|
static byte[] |
decrypt(byte[] cyphertext,
java.lang.String password)
Decrypt the specified cyphertext using the standard
salt and nIteration values. |
static byte[] |
decrypt(byte[] cyphertext,
java.lang.String password,
byte[] salt,
int nIterations)
Decrypt the specified cyphertext using the specified
salt and nIteration values. |
static byte[] |
encrypt(byte[] cleartext,
java.lang.String password)
Encrypt the specified cleartext using the standard salt
and nIteration values. |
static byte[] |
encrypt(byte[] cleartext,
java.lang.String password,
byte[] salt,
int nIterations)
Encrypt the specified cleartext using the specified
salt and nIteration values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PasswordBasedEncryptionUtility()
| Method Detail |
|---|
public static byte[] encrypt(byte[] cleartext,
java.lang.String password)
cleartext using the standard salt
and nIteration values.
cleartext - The text to be encrypted.password - The password to use to encrypt the cleartext.
public static byte[] encrypt(byte[] cleartext,
java.lang.String password,
byte[] salt,
int nIterations)
cleartext using the specified
salt and nIteration values.
cleartext - The text to be encrypted.password - The password to use to encrypt the cleartext.salt - A byte[] that gets appended to the password.nIterations - The number of times to apply the encryption.
public static byte[] decrypt(byte[] cyphertext,
java.lang.String password)
cyphertext using the standard
salt and nIteration values.
cyphertext - The text to be decrypted.password - The password to use to decrypted the cyphertext.
public static byte[] decrypt(byte[] cyphertext,
java.lang.String password,
byte[] salt,
int nIterations)
cyphertext using the specified
salt and nIteration values.
cyphertext - The text to be decrypted.password - The password to use to decrypted the cyphertext.salt - A byte[] that gets appended to the password.nIterations - The number of times to apply the decryption.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||