Package com.google.crypto.tink.subtle
Interface IndCpaCipher
-
- All Known Implementing Classes:
AesCtrJceCipher
public interface IndCpaCipherThis interface for symmetric key ciphers that are indistinguishable against chosen-plaintext attacks.Said primitives do not provide authentication, thus should not be used directly, but only to construct safer primitives such as
Aead.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]decrypt(byte[] ciphertext)Decryptsciphertext.byte[]encrypt(byte[] plaintext)Encryptsplaintext.
-
-
-
Method Detail
-
encrypt
byte[] encrypt(byte[] plaintext) throws java.security.GeneralSecurityExceptionEncryptsplaintext. The resulting ciphertext is indistinguishable under chosen-plaintext attack. However, it does not have integrity protection.- Returns:
- the resulting ciphertext.
- Throws:
java.security.GeneralSecurityException
-
decrypt
byte[] decrypt(byte[] ciphertext) throws java.security.GeneralSecurityExceptionDecryptsciphertext.- Returns:
- the resulting plaintext.
- Throws:
java.security.GeneralSecurityException
-
-