Interface IndCpaCipher

  • All Known Implementing Classes:
    AesCtrJceCipher

    public interface IndCpaCipher
    This 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 Detail

      • encrypt

        byte[] encrypt​(byte[] plaintext)
                throws java.security.GeneralSecurityException
        Encrypts plaintext. 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.GeneralSecurityException
        Decrypts ciphertext.
        Returns:
        the resulting plaintext.
        Throws:
        java.security.GeneralSecurityException