Class AesSiv

    • Constructor Detail

      • AesSiv

        public AesSiv​(byte[] key)
               throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
    • Method Detail

      • create

        public static DeterministicAeads create​(AesSivKey key)
                                         throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • encryptDeterministicallyWithAssociatedDatas

        public byte[] encryptDeterministicallyWithAssociatedDatas​(byte[] plaintext,
                                                                  byte[]... associatedDatas)
                                                           throws java.security.GeneralSecurityException
        Description copied from interface: DeterministicAeads
        Deterministically encrypts plaintext with a list of associated authenticated data.
        Specified by:
        encryptDeterministicallyWithAssociatedDatas in interface DeterministicAeads
        Throws:
        java.security.GeneralSecurityException
      • encryptDeterministically

        public byte[] encryptDeterministically​(byte[] plaintext,
                                               byte[] associatedData)
                                        throws java.security.GeneralSecurityException
        Description copied from interface: DeterministicAead
        Deterministically encrypts plaintext with associatedData as associated authenticated data.

        Warning

        Encrypting the same plaintext multiple times protects the integrity of that plaintext, but confidentiality is compromised to the extent that an attacker can determine that the same plaintext was encrypted.

        The resulting ciphertext allows for checking authenticity and integrity of associated data (associatedData), but does not guarantee its secrecy.

        Specified by:
        encryptDeterministically in interface DeterministicAead
        Returns:
        resulting ciphertext
        Throws:
        java.security.GeneralSecurityException
      • decryptDeterministicallyWithAssociatedDatas

        public byte[] decryptDeterministicallyWithAssociatedDatas​(byte[] ciphertext,
                                                                  byte[]... associatedDatas)
                                                           throws java.security.GeneralSecurityException
        Description copied from interface: DeterministicAeads
        Deterministically decrypts ciphertext with a list of associated authenticated data.
        Specified by:
        decryptDeterministicallyWithAssociatedDatas in interface DeterministicAeads
        Throws:
        java.security.GeneralSecurityException
      • decryptDeterministically

        public byte[] decryptDeterministically​(byte[] ciphertext,
                                               byte[] associatedData)
                                        throws java.security.GeneralSecurityException
        Description copied from interface: DeterministicAead
        Deterministically decrypts ciphertext 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.

        Specified by:
        decryptDeterministically in interface DeterministicAead
        Returns:
        resulting plaintext
        Throws:
        java.security.GeneralSecurityException