(PHP 8 >= 8.1.0)
sodium_crypto_stream_xchacha20 — 将密钥和nonce扩展为伪随机字节的密钥流
$length, string $nonce, #[\SensitiveParameter] string $key): string将key和nonce扩展为伪随机字节的密钥流。
length所需的字节数。
nonce24字节的nonce。
key返回一个伪随机流,可与sodium_crypto_stream_xchacha20_xor()一起使用。