(PHP 8 >= 8.1.0)
sodium_crypto_stream_xchacha20 — 將金鑰和 nonce 擴展為偽隨機位元組的密鑰流
$length
, string $nonce
, #[\SensitiveParameter] string $key
): string將 key
和 nonce
擴展為偽隨機位元組的密鑰流。
length
所需的位元組數。
nonce
24 位元組的 nonce。
key
金鑰,可能從 sodium_crypto_stream_xchacha20_keygen() 產生。
傳回一個可與 sodium_crypto_stream_xchacha20_xor() 一起使用的偽隨機流。