secretbox_open

High-level symmetric authenticated decryption.

@safe
ubyte[]
secretbox_open
(
in ubyte[] boxed
,
in ubyte[] nonce
,
in ubyte[] key
)

Parameters

boxed ubyte[]

Ciphertext and authentication tag as created by secretbox().

nonce ubyte[]

24 bytes used once per key.

key ubyte[]

Secret shared key. 32 bytes.

Return Value

Type: ubyte[]

Returns the plaintext if the authentication tag is correct.

Throws

Throws an exception if the authentication tag is invalid.

Meta