box_open

Decrypts a packet generated by box().

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

Parameters

box ubyte[]

The received packet.

nonce ubyte[]

A number unique per (secret_key, public_key) pair.

secret_key ubyte[]

Your secret key.

public_key ubyte[]

Senders public key.

Return Value

Type: ubyte[]

Plaintext if authentication tag is valid.

Throws

IllegalCipherTextException if authentication tag is not valid.

Meta