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 時才可用。

參數(shù) 

ciphertext

必須采用 sodium_crypto_aead_aes256gcm_encrypt() 提供的格式(密文和標記,串聯(lián))。

additional_data

其他經(jīng)過身份驗證的數(shù)據(jù)。這用于驗證身份驗證標記 附加到密文中,但未加密或存儲在密文中。

nonce

每封郵件只能使用一次的號碼。長度為 12 個字節(jié)。

key

加密密鑰(256 位)。

返回值 

Returns the plaintext on success, 或者在失敗時返回 false.


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號