box_open

Decrypts a packet generated by box().

ubyte[]
box_open
@safe
(
in ubyte[] box
,
in ubyte[] nonce
,
in ubyte[] secret_key
,
in ubyte[] public_key
)

Parameters

box
Type: ubyte[]

The received packet.

nonce
Type: ubyte[]

A number unique per (secret_key, public_key) pair.

secret_key
Type: ubyte[]

Your secret key.

public_key
Type: ubyte[]

Senders public key.

Return Value

Type: ubyte[]

Plaintext if authentication tag is valid.

Throws

IllegalCipherTextException if authentication tag is not valid.

Meta