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
Crypt
encrypt
in interface Crypt
input
- 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.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyException
Crypt.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
Crypt
decrypt
in interface Crypt
input
- 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.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyException
Crypt.decrypt(byte[], int, int, byte[], int)
public int getEncryptOutputSize(int inputSize)
Crypt
getEncryptOutputSize
in interface Crypt
inputSize
- The size of the input to be encryptedCrypt.getEncryptOutputSize(int)
public int getDecryptOutputSize(int inputSize)
Crypt
getDecryptOutputSize
in interface Crypt
inputSize
- The size of the input to be decryptedCrypt.getDecryptOutputSize(int)
public int getBlockSize()
Crypt
getBlockSize
in interface Crypt
Crypt.getBlockSize()