Interface Cipher
-
- All Known Implementing Classes:
AES128CBC,AES128CTR,AES192CBC,AES192CTR,AES256CBC,AES256CTR,BaseCipher,BlockCipher,BlowfishCBC,NoneCipher,StreamCipher,TripleDESCBC
public interface CipherWrapper for a cryptographic cipher, used either for encryption or decryption.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCipher.Mode
-
Method Summary
Modifier and Type Method Description intgetBlockSize()intgetIVSize()voidinit(Cipher.Mode mode, byte[] key, byte[] iv)Initialize the cipher for encryption or decryption with the given private key and initialization vectorvoidupdate(byte[] input, int inputOffset, int inputLen)Performs in-place encryption or decryption on the given data.
-
-
-
Method Detail
-
getBlockSize
int getBlockSize()
- Returns:
- the block size for this cipher
-
getIVSize
int getIVSize()
- Returns:
- the size of the initialization vector
-
init
void init(Cipher.Mode mode, byte[] key, byte[] iv)
Initialize the cipher for encryption or decryption with the given private key and initialization vector- Parameters:
mode- whether this instance wil encrypt or decryptkey- the key for the cipheriv- initialization vector
-
update
void update(byte[] input, int inputOffset, int inputLen)Performs in-place encryption or decryption on the given data.- Parameters:
input- the subjectinputOffset- offset at which to startinputLen- number of bytes starting atinputOffset
-
-