(PHP 8 >= 8.1.0)
sodium_crypto_stream_xchacha20_xor — 使用 nonce 和密鑰加密訊息(無驗證)
$message, 字串 $nonce, #[\SensitiveParameter] 字串 $key): 字串使用 nonce 和密鑰加密訊息(無驗證)。
此加密方法未經身份驗證,且無法防止選擇密文攻擊。請務必將密文與訊息鑑別碼 (MAC) 結合使用,例如使用 sodium_crypto_aead_xchacha20poly1305_ietf_encrypt() 函式,或 sodium_crypto_auth() 函式。
message要加密的訊息。
nonce24 位元組的 nonce。
key密鑰,可能由 sodium_crypto_stream_xchacha20_keygen() 產生。
已加密的訊息。