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

decryptDetached

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

Decrypt a message using a detached message authentication code.

Parameters

cipherText - The cipher text to decrypt.

mac - The message authentication code.

nonce - The nonce that was used for encryption.

Return
The decrypted data, or null if verification failed.

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

Decrypt a message using a given key and a detached message authentication code.

Parameters

cipherText - The cipher text to decrypt.

mac - The message authentication code.

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.