Blockchain Commons Crypto TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Function aeadChaCha20Poly1305Decrypt

    • Decrypt data using ChaCha20-Poly1305 AEAD cipher.

      Parameters

      • ciphertext: Uint8Array

        The encrypted data

      • key: Uint8Array

        32-byte encryption key (must match key used for encryption)

      • nonce: Uint8Array

        12-byte nonce (must match nonce used for encryption)

      • authTag: Uint8Array

        16-byte authentication tag from encryption

      Returns Uint8Array

      Decrypted plaintext

      If key/nonce/authTag sizes are invalid

      If authentication fails (tampered data or wrong key/nonce)