Module: crypto/ocb

This module implements AES-OCB en/decryption.

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 (15 bytes)

adata Uint8Array

Associated data to sign

Source:
Returns:

The ciphertext output

Type
Promise.<Uint8Array>

(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 (15 bytes)

adata Uint8Array

Associated data to sign

Source:
Returns:

The ciphertext output

Type
Promise.<Uint8Array>

(async, inner) OCB(cipher, key)

Class to en/decrypt using OCB mode.

Parameters:
Name Type Description
cipher String

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

key Uint8Array

The encryption key

Source: