Module: crypto/eax

This module implements AES-EAX en/decryption on top of native AES-CTR using either the WebCrypto API or Node.js' crypto API.

Source:

Requires

Methods

(inner) decrypt(ciphertext, nonce, adata) → {Promise.<Uint8Array>}

Decrypt ciphertext input.

Parameters:
Name Type Description
ciphertext Uint8Array

The ciphertext input to be decrypted

nonce Uint8Array

The nonce (16 bytes)

adata Uint8Array

Associated data to verify

Source:
Returns:

The plaintext output

Type
Promise.<Uint8Array>

(async, inner) EAX(cipher, key)

Class to en/decrypt using EAX mode.

Parameters:
Name Type Description
cipher String

The symmetric cipher algorithm to use e.g. 'aes128'

key Uint8Array

The encryption key

Source:

(inner) encrypt(plaintext, nonce, adata) → {Promise.<Uint8Array>}

Encrypt plaintext input.

Parameters:
Name Type Description
plaintext Uint8Array

The cleartext input to be encrypted

nonce Uint8Array

The nonce (16 bytes)

adata Uint8Array

Associated data to sign

Source:
Returns:

The ciphertext output

Type
Promise.<Uint8Array>