public final class AesCtrJceCipher extends Object implements IndCpaCipher
It is safe against chosen-plaintext attacks, but does not provide ciphertext integrity, thus is unsafe against chosen-ciphertext attacks.
| Modifier and Type | Field and Description |
|---|---|
static TinkFipsUtil.AlgorithmFipsCompatibility |
FIPS |
| Constructor and Description |
|---|
AesCtrJceCipher(byte[] key,
int ivSize) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] ciphertext)
Decrypts the ciphertext with counter mode decryption.
|
byte[] |
encrypt(byte[] plaintext)
Encrypts the plaintext with counter mode encryption using randomly generated iv.
|
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
public AesCtrJceCipher(byte[] key,
int ivSize)
throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] encrypt(byte[] plaintext)
throws GeneralSecurityException
encrypt in interface IndCpaCipherplaintext - the plaintext to be encrypted.GeneralSecurityExceptionpublic byte[] decrypt(byte[] ciphertext)
throws GeneralSecurityException
decrypt in interface IndCpaCipherciphertext - the ciphertext to be decrypted.GeneralSecurityException