AuthenticatedEncryptionWithAssociatedData

This is a form of symmetric encryption, that assures both confidentiality and authenticity of the data to be encrypted as well as associated data that will not be encrypted.

Offered here are three implementations of (x)ChaCha20-Poly1305 construction:

  • ChaCha20Poly1305 - uses 64bit nonce, safe to encrypt

  • ChaCha20Poly1305-IETF - uses 96bit nonce (standardised by RFC8439

  • XChaCha20Poly1305 - uses 192bit nonce - recommended choice

The only difference is the size of the nonce, and how is the nonce used.

(x)ChaCha20 is a streaming cipher develop by Daniel J. Bernstein. He is also the author of Poly1305 a fast Message Authentication Code system

Libsodium offers two additional variants for each of the aforementioned variants:

  • Combined

  • Detached

Combined mode returns encrypted data and tag as one UByteArray, while detached mode returns them as separate UByteArrays. To be kotlin idiomatic we are returning detached tag and encrypted data inside a wrapper data class AeadEncryptedDataAndTag

Also provided are key generation convenience functions for each variant. (Which is in practice the same, since the keys same length for each variant)

Functions

Link copied to clipboard
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using ChaChaPoly1305 (64 bit nonce)

actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Decrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using xChaChaPoly1305 (64 bit nonce)

actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305DecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Encrypt the message and return encrypted data and tag using ChaChaPoly1305 (64 bit nonce)

actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305Encrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard

Encrypt the message and return encrypted data and tag using ChaChaPoly1305 (64 bit nonce) as separate arrays (but wrapped inside AeadEncryptedDataAndTag)

Link copied to clipboard
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using ChaChaPoly1305-IETF (96 bit nonce)

actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using xChaChaPoly1305 (96 bit nonce)

actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Encrypt the message and return encrypted data and tag using ChaChaPoly1305-IETF (96 bit nonce)

actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun chaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard

Encrypt the message and return encrypted data and tag using ChaChaPoly1305-IETF (96 bit nonce) as separate arrays (but wrapped inside AeadEncryptedDataAndTag)

Link copied to clipboard

Generate a random 32 byte key for use with ChaCha20Poly1305-IETF

Link copied to clipboard

Generate a random 32 byte key for use with ChaCha20Poly1305

Link copied to clipboard
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using xChaChaPoly1305 (192 bit nonce)

actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecrypt(ciphertextAndTag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Check if authentication data (tag) is correct, then decrypt the message and return decrypted data. Using xChaChaPoly1305 (192 bit nonce)

actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfDecryptDetached(ciphertext: UByteArray, tag: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
expect fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray

Encrypt the message and return encrypted data and tag using xChaChaPoly1305 (192 bit nonce)

actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
actual fun xChaCha20Poly1305IetfEncrypt(message: UByteArray, associatedData: UByteArray, nonce: UByteArray, key: UByteArray): UByteArray
Link copied to clipboard

Encrypt the message and return encrypted data and tag using xChaChaPoly1305 (192 bit nonce) as separate arrays (but wrapped inside AeadEncryptedDataAndTag)

Link copied to clipboard

Generate a random 32byte key for use with xChaCha20Poly1305