Class ChaCha20


  • public final class ChaCha20
    extends Object
    ChaCha20, wrapper around Noise ChaChaCore. RFC 7539
    Since:
    0.9.39
    • Method Detail

      • encrypt

        public static void encrypt​(byte[] key,
                                   byte[] iv,
                                   byte[] plaintext,
                                   int plaintextOffset,
                                   byte[] ciphertext,
                                   int ciphertextOffset,
                                   int length)
        Encrypt from plaintext to ciphertext
        Parameters:
        key - first 32 bytes used as the key
        iv - first 12 bytes used as the iv
      • decrypt

        public static void decrypt​(byte[] key,
                                   byte[] iv,
                                   byte[] ciphertext,
                                   int ciphertextOffset,
                                   byte[] plaintext,
                                   int plaintextOffset,
                                   int length)
        Encrypt from ciphertext to plaintext
        Parameters:
        key - first 32 bytes used as the key
        iv - first 12 bytes used as the iv