public final class AesEaxJce extends Object implements Aead
EAX is an encryption mode proposed by Bellare, Rogaway and Wagner (http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf). The encryption mode is an alternative to CCM and has been proposed as a NIST standard: http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/eax/eax-spec.pdf
The parameter choices have been restricted to a small set of options:
Plans: The current implementation is slow since it uses JCA and only assumes that the encryption modes "AES/ECB/NOPADDING" and "AES/CTR/NOPADDING" are implemented. Our plan is to implement a native version of EAX.
| Modifier and Type | Field and Description |
|---|---|
static TinkFipsUtil.AlgorithmFipsCompatibility |
FIPS |
| Constructor and Description |
|---|
AesEaxJce(byte[] key,
int ivSizeInBytes) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] ciphertext,
byte[] associatedData)
Decrypts
ciphertext with associatedData as associated authenticated data. |
byte[] |
encrypt(byte[] plaintext,
byte[] associatedData)
Encrypts
plaintext with associatedData as associated authenticated data. |
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
public AesEaxJce(byte[] key,
int ivSizeInBytes)
throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] encrypt(byte[] plaintext,
byte[] associatedData)
throws GeneralSecurityException
Aeadplaintext with associatedData as associated authenticated data.
The resulting ciphertext allows for checking authenticity and integrity of associated data
(associatedData), but does not guarantee its secrecy.encrypt in interface Aeadplaintext - the plaintext to be encrypted. It must be non-null, but can also
be an empty (zero-length) byte arrayassociatedData - associated data to be authenticated, but not encrypted. Associated data
is optional, so this parameter can be null. In this case the null value
is equivalent to an empty (zero-length) byte array.
For successful decryption the same associatedData must be provided
along with the ciphertext.GeneralSecurityExceptionpublic byte[] decrypt(byte[] ciphertext,
byte[] associatedData)
throws GeneralSecurityException
Aeadciphertext with associatedData as associated authenticated data.
The decryption verifies the authenticity and integrity of the associated data, but there are
no guarantees wrt. secrecy of that data.decrypt in interface Aeadciphertext - the plaintext to be decrypted. It must be non-null.associatedData - associated data to be authenticated. For successful decryption
it must be the same as associatedData used during encryption.
Can be null, which is equivalent to an empty (zero-length) byte array.GeneralSecurityException