| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TYPE
The AES encryption type
|
| Constructor and Description |
|---|
AESCrypt(java.lang.String password)
Creates a new AESCrypt
|
| Modifier and Type | Method and Description |
|---|---|
int |
decrypt(byte[] input,
int offset,
int length,
byte[] output,
int outOffset)
Decrypts the input
|
int |
encrypt(byte[] input,
int offset,
int length,
byte[] output,
int outOffset)
Encrypts the input
|
int |
getBlockSize()
Returns the size of the block of the encryption or decryption
|
int |
getDecryptOutputSize(int inputSize)
Returns the maximum size the output buffer needs to be
|
int |
getEncryptOutputSize(int inputSize)
Returns the maximum size the output buffer needs to be
|
public static final java.lang.String TYPE
public AESCrypt(java.lang.String password)
password - The encryption passwordpublic int encrypt(byte[] input,
int offset,
int length,
byte[] output,
int outOffset)
throws javax.crypto.ShortBufferException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
Cryptencrypt in interface Cryptinput - The input to be encryptedoffset - The offset into the input buffer where the input startslength - The length of the inputoutput - The output bufferoutOffset - The offset into the output buffer where to store the outputjavax.crypto.BadPaddingExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.ShortBufferExceptionjava.security.InvalidAlgorithmParameterExceptionjava.security.InvalidKeyExceptionCrypt.encrypt(byte[], int, int, byte[], int)public int decrypt(byte[] input,
int offset,
int length,
byte[] output,
int outOffset)
throws javax.crypto.ShortBufferException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
Cryptdecrypt in interface Cryptinput - The input to be decryptedoffset - The offset into the input buffer where the input startslength - The length of the inputoutput - The output bufferoutOffset - The offset into the output buffer where to store the outputjavax.crypto.BadPaddingExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.ShortBufferExceptionjava.security.InvalidAlgorithmParameterExceptionjava.security.InvalidKeyExceptionCrypt.decrypt(byte[], int, int, byte[], int)public int getEncryptOutputSize(int inputSize)
CryptgetEncryptOutputSize in interface CryptinputSize - The size of the input to be encryptedCrypt.getEncryptOutputSize(int)public int getDecryptOutputSize(int inputSize)
CryptgetDecryptOutputSize in interface CryptinputSize - The size of the input to be decryptedCrypt.getDecryptOutputSize(int)public int getBlockSize()
CryptgetBlockSize in interface CryptCrypt.getBlockSize()