sodium_crypto_stream_xor

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_stream_xorCifra un mensaje sin autenticación

Descripción

sodium_crypto_stream_xor(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key): string

Esta función cifra un mensaje con XSalsa20, pero no proporciona ninguna garantía sobre el texto cifrado.

Parámetros

message

El mensaje a cifrar.

nonce

Un número que debe ser utilizado una sola vez, por mensaje. 24 bytes de largo. Es un límite suficientemente grande para ser generado aleatoriamente (i.e. random_bytes()).

key

La clave de cifrado (256 bits).

Valores devueltos

El mensaje cifrado.

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top