codecamp

PHP8 sodium_crypto_stream_xor

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_stream_xor — 在不进行身份验证的情况下加密消息

说明

sodium_crypto_stream_xor(string $message, string $nonce, string $key): string

此函数使用 XSalsa20 加密消息,但不提供任何密文 关于明文的保证。

参数 

message

要加密的消息

nonce

每封邮件只能使用一次的号码。长度为 24 个字节。 这是一个足够大的绑定,可以随机生成(即 random_bytes())。

key

加密密钥(256 位)。

返回值 

加密消息。


PHP8 sodium_crypto_stream_xchacha20
PHP8 sodium_crypto_stream
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定