public class PBECipher
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.security.SecureRandom |
_secureRandom |
protected static int |
CHUNK_SIZE |
protected static java.lang.String |
CIPHER_ALG |
protected static java.lang.String |
DIGEST_ALG |
protected static java.lang.String |
KEY_ALG |
protected static int |
PBE_ITERATIONS |
protected static int |
SALT_SIZE |
protected static int |
SPICE_SIZE |
protected static java.lang.String |
STRING_ENCODING |
protected static byte |
WIPER |
Constructor and Description |
---|
PBECipher() |
Modifier and Type | Method and Description |
---|---|
private javax.crypto.Cipher |
createCipher(byte[] pwdAsBytes,
byte[] salt,
int mode) |
java.lang.String |
decrypt64(java.lang.String encryptedText,
java.lang.String password) |
java.lang.String |
encrypt64(java.lang.String clearText,
java.lang.String password) |
private byte[] |
getSalt(int sz) |
protected static final java.lang.String STRING_ENCODING
protected static final int SPICE_SIZE
protected static final int SALT_SIZE
protected static final int CHUNK_SIZE
protected static final byte WIPER
protected static final java.lang.String DIGEST_ALG
protected static final java.lang.String KEY_ALG
protected static final java.lang.String CIPHER_ALG
protected static final int PBE_ITERATIONS
private static final java.security.SecureRandom _secureRandom
private byte[] getSalt(int sz)
public java.lang.String encrypt64(java.lang.String clearText, java.lang.String password) throws PlexusCipherException
PlexusCipherException
public java.lang.String decrypt64(java.lang.String encryptedText, java.lang.String password) throws PlexusCipherException
PlexusCipherException
private javax.crypto.Cipher createCipher(byte[] pwdAsBytes, byte[] salt, int mode) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException