Skip to content

crypto.secretbox

Secretbox provides high-level authenticated encryption using the xsalsa20-poly1305 construction.

Summary

Methods

MethodSignatureDescription
keyGen() -> stringGenerates a random 32-byte secret key.
seal(message: string, key: string, nonce: string?) -> stringEncrypts and authenticates a message.
open(box: string, key: string, nonce: string?) -> string?Decrypts and verifies an authenticated message.