PHP.nl

sodium_crypto_stream_xchacha20_xor

sodium_crypto_stream_xchacha20_xor

Encrypts a message using a nonce and a secret key (no authentication)

string **sodium_crypto_stream_xchacha20_xor** string $message string $nonce string $key

Encrypts a using a and a secret (no authentication). message``nonce``key

Let op: > This encryption is unauthenticated, and does not prevent chosen-ciphertext attacks. Make sure to combine the ciphertext with a Message Authentication Code, for example with function, or . sodium_crypto_aead_xchacha20poly1305_ietf_encrypt``sodium_crypto_auth

messageThe message to encrypt.

nonce24-byte nonce.

key Key, possibly generated from . sodium_crypto_stream_xchacha20_keygen

Encrypted message.

sodium_crypto_stream_xchacha20_xor_ic