Interface DeterministicAeads

  • All Superinterfaces:
    DeterministicAead
    All Known Implementing Classes:
    AesSiv

    public interface DeterministicAeads
    extends DeterministicAead
    Interface for Deterministic Authenticated Encryption with multiple Associated Datas

    This interface is a generalization of DeterministicAead: DeterministicAead requires exactly one associated data, while DeterministicAeads allows a list of associated datas. If the list has size 1, the behavior must be exactly the same the methods of DeterministicAead.

    For why this interface is desirable and some of its use cases, see for example RFC 5297 section 1.3.

    Warning

    Unlike Aead, implementations of this interface are not semantically secure, because encrypting the same plaintext always yields the same ciphertext.

    • Method Detail

      • encryptDeterministicallyWithAssociatedDatas

        byte[] encryptDeterministicallyWithAssociatedDatas​(byte[] plaintext,
                                                           byte[]... associatedDatas)
                                                    throws java.security.GeneralSecurityException
        Deterministically encrypts plaintext with a list of associated authenticated data.
        Throws:
        java.security.GeneralSecurityException
      • decryptDeterministicallyWithAssociatedDatas

        byte[] decryptDeterministicallyWithAssociatedDatas​(byte[] ciphertext,
                                                           byte[]... associatedDatas)
                                                    throws java.security.GeneralSecurityException
        Deterministically decrypts ciphertext with a list of associated authenticated data.
        Throws:
        java.security.GeneralSecurityException