array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.sodium-crypto-stream.php', 1 => 'sodium_crypto_stream', ), 'up' => array ( 0 => 'ref.sodium.php', 1 => 'Sodium Funktionen', ), 'prev' => array ( 0 => 'function.sodium-crypto-stream-xor.php', 1 => 'sodium_crypto_stream_xor', ), 'next' => array ( 0 => 'function.sodium-hex2bin.php', 1 => 'sodium_hex2bin', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sodium/functions/sodium-crypto-stream.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_stream — Generate a deterministic sequence of bytes from a seed
Generate a deterministic sequence of bytes from a seed, using the XSalsa20 stream cipher.
length
The number of bytes to return.
nonce
A number that must be only used once, per message. 24 bytes long. This is a large enough bound to generate randomly (i.e. random_bytes()).
key
Encryption key (256-bit).
String of pseudorandom bytes.