crypto_box

The crypto_box() function encrypts and authenticates a message 'msg' using the sender's secret key 'sk', the receiver's public key 'pk', and a nonce 'nonce'. The crypto_box() function returns the resulting ciphertext 'c'.

bool
crypto_box
()
(
ubyte[] c
,
const(ubyte)[] msg
,
const(ubyte)[] nonce
,
const(ubyte)[] pk
,
const(ubyte)[] sk
)

Parameters

c ubyte[]

resulting cyphertext

msg const(ubyte)[]

message

nonce const(ubyte)[]

nonce

pk const(ubyte)[]

receiver's public key

sk const(ubyte)[]

sender's secret key

Return Value

Type: bool

success flag and cyphertext in 'c'

Meta