crypto / org.apache.tuweni.crypto.sodium / Box / decrypt

decrypt

@Nullable fun decrypt(cipherText: Bytes, nonce: Nonce): Bytes? (source)
@Nullable fun decrypt(cipherText: ByteArray, nonce: Nonce): ByteArray? (source)

Decrypt a message using a given key.

Parameters

cipherText - The cipher text to decrypt.

nonce - The nonce that was used for encryption.

Return
The decrypted data, or null if verification failed.

@Nullable static fun decrypt(cipherText: Bytes, sender: PublicKey, receiver: SecretKey, nonce: Nonce): Bytes? (source)
@Nullable static fun decrypt(cipherText: ByteArray, sender: PublicKey, receiver: SecretKey, nonce: Nonce): ByteArray? (source)

Decrypt a message using a given key.

Parameters

cipherText - The cipher text to decrypt.

sender - The public key of the sender.

receiver - The secret key of the receiver.

nonce - The nonce that was used for encryption.

Return
The decrypted data, or null if verification failed.