PHP8 sodium_crypto_aead_aes256gcm_decrypt

2024-03-15 09:15 更新

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_aead_aes256gcm_decrypt — 验证然后使用AES-256-GCM解密消息

说明

sodium_crypto_aead_aes256gcm_decrypt(
    string $ciphertext,
    string $additional_data,
    string $nonce,
    string $key
): string|false

验证然后使用 AES-256-GCM 解密。 仅当 sodium_crypto_aead_aes256gcm_is_available() 返回 true 时才可用。

参数 

ciphertext

必须采用 sodium_crypto_aead_aes256gcm_encrypt() 提供的格式(密文和标记,串联)。

additional_data

其他经过身份验证的数据。这用于验证身份验证标记 附加到密文中,但未加密或存储在密文中。

nonce

每封邮件只能使用一次的号码。长度为 12 个字节。

key

加密密钥(256 位)。

返回值 

Returns the plaintext on success, 或者在失败时返回 false.


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号