PHP Conference Japan 2024

sodium_crypto_stream_xchacha20

(PHP 8 >= 8.1.0)

sodium_crypto_stream_xchacha20將金鑰和 nonce 擴展為偽隨機位元組的密鑰流

說明

sodium_crypto_stream_xchacha20(int $length, string $nonce, #[\SensitiveParameter] string $key): string

keynonce 擴展為偽隨機位元組的密鑰流。

參數

length

所需的位元組數。

nonce

24 位元組的 nonce。

key

金鑰,可能從 sodium_crypto_stream_xchacha20_keygen() 產生。

回傳值

傳回一個可與 sodium_crypto_stream_xchacha20_xor() 一起使用的偽隨機流。

新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top