Hướng dẫn aes-256-gcm encryption php - php mã hóa aes-256-gcm
Tôi đang làm việc với mật mã trong một dự án và tôi cần một chút trợ giúp về cách làm việc
Sau đó
Trước hết, đoạn mã ví dụ trên có phải là một ví dụ chính xác về cách sử dụng Thứ hai, phương pháp của tôi để tạo Cuối cùng, 1giá trị không bắt buộc phải có 2? Nếu có, thì tại sao nó 3chỉ trả về 4độ dài? Có nên không 5?17 hữu ích 1 bình luận 34k xem chia sẻ 1 bình luận 34k xem chia sẻ (PHP 5 >= 5.3.0, PHP 7, PHP 8) openssl_encrypt — Encrypts data — Encrypts data Descriptionopenssl_encrypt( string Parametersopenssl_encrypt 5The plaintext message data to be encrypted. openssl_encrypt 6The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods(). openssl_get_cipher_methods(). openssl_encrypt 7 The passphrase. If the passphrase is shorter than expected, it is silently padded with openssl_encrypt 9 openssl_decrypt 3A non-NULL Initialization Vector. openssl_decrypt 4The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM). openssl_decrypt 5Additional authenticated data. openssl_decrypt 6 The length of the authentication Return Values Returns the encrypted string on success or Errors/Exceptions Emits an Emits an Changelog
Parameters
The plaintext message data to be encrypted.
The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods().
$key 7 The passphrase. If the passphrase is shorter than expected, it is silently padded with
$iv 2
$key 7 A non-NULL Initialization Vector.
$encryptedData 4 The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).
$key 7 Additional authenticated data.
php openssl_encrypt 5 The length of the authentication
php openssl_encrypt 9Return Values ¶
$key 3
$key 7 A non-NULL Initialization Vector. 00 Additional authenticated data. 01 02 03 04 05 06 07 08
The length of the authentication 09 10 11 12 13 14 15 16 17$key 7Return Values ¶ The length of the authentication 19 20 21 22 23 24$key 7Return Values ¶ Returns the encrypted string on success or 26 27 28 Emits an openssl_decrypt 9 level error if an unknown cipher algorithm is passed in via the openssl_encrypt 6 parameter. Emits an Changelog 30 31 32 33Version ¶ Additional authenticated data. 34 Additional authenticated data. 35 36 37 38$key 7 The length of the authentication 40Return Values ¶ The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM). 41 42 43 44 45 46 47 48 The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods(). 49 The length of the authentication 50 51$key 7Return Values ¶ Returns the encrypted string on success or 53 54 Emits an 32 57 Emits an A non-NULL Initialization Vector. 58 The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods(). 59 60$key 7 |