open

abstract fun open(box: ByteArray, nonce: ByteArray): ByteArray?

Authenticates and decrypts the given secret box using the key and the nonce.

Return

The decrypted message, or null if there was an error

Parameters

box

: The encrypted message

nonce

: The nonce used for encryption