Cảm ơn rất nhiều vì đã đọc.
Tôi đã làm rất nhiều nghiên cứu về chủ đề này nhưng không nhận được thêm nữa.
Tôi phải giải mã dữ liệu trong PHP. Đây là đặc điểm kỹ thuật của mã hóa [và không có thêm thông số kỹ thuật nào để nhận từ người mã hóa]:
Keyrength = 256 Thuật toán = AES/CBC/PKCS5PADDing KeySpec = PBKDF2WithHMACSHA1 iterations = 5000
algorithm = AES/CBC/PKCS5Padding
keyspec = PBKDF2withHmacSHA1
iterations = 5000
Những gì tôi cũng có, là một chìa khóa, dài 49 ký tự để giải mã.
Mỗi thông báo được mã hóa được cung cấp trong một mảng và nó được mã hóa base64
Dữ liệu ví dụ:
$data = [
"iv" => "DoJQNS0WZRtWB...",
"salt" => "zkcHInm4ewweKG81...",
"encrypted_data" => "30MTuQEW4sVc3...",
];
Tôi đã thử điều này:
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
Những gì tôi nhận được ở đây là
bool[false]
string[94] "error:0606508A:digital envelope routines:EVP_DecryptFinal_ex:data not multiple of block length"
Tôi không chắc đây có phải là cách tiếp cận chính xác không. Tôi cũng đã thử giải mã trực tiếp mà không cần sử dụng hàm Hash_pbkdf2 nhưng tất cả những gì tôi nhận được sau đó là rác.
Vì vậy, nếu tôi chỉ sử dụng cái này
$key = "supersecretkey";
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING| OPENSSL_RAW_DATA, $iv];
Sau đó, tôi chỉ nhận được dữ liệu rác như
*+�l��_�y9�{[kNF7��gص��[Se!Y
Tôi sẽ đánh giá cao bất kỳ sự giúp đỡ nào về chủ đề này vì tôi đã dành rất nhiều giờ và đọc hàng tấn tài liệu.
Thật không may, tôi không nhận được bất kỳ hỗ trợ nào từ thực thể gửi dữ liệu được mã hóa.
Cảm ơn trước!
[Php 5> = 5.3.0, Php 7, Php 8] OpenSSL_encrypt - Mã hóa dữ liệu — Encrypts data — Encrypts data openSSL_encrypt [& nbsp; & nbsp; & nbsp; & nbsp; chuỗi ________ 0, & nbsp; & nbsp; & nbsp; & nbsp; chuỗi ________ 1, & nbsp; & nbsp; & nbsp; & nbsp; chuỗi Dữ liệu thông báo rõ ràng sẽ được mã hóa. Phương pháp mật mã. Để biết danh sách các phương thức mật mã có sẵn, hãy sử dụng openSSL_GET_CIPHER_METHODS [].openssl_get_cipher_methods[]. openssl_get_cipher_methods[]. Cụm mật khẩu. Nếu cụm mật khẩu ngắn hơn dự kiến, nó sẽ được đệm âm thầm với các ký tự Một vectơ khởi tạo không null. Thẻ xác thực được truyền qua tham chiếu khi sử dụng chế độ mật mã AEAD [GCM hoặc CCM]. Dữ liệu được xác thực bổ sung. Độ dài của xác thực Trả về chuỗi được mã hóa thành công hoặc Phát ra lỗi cấp Phát ra lỗi cấp Dữ liệu thông báo rõ ràng sẽ được mã hóa. Phương pháp mật mã. Để biết danh sách các phương thức mật mã có sẵn, hãy sử dụng openSSL_GET_CIPHER_METHODS [].openssl_get_cipher_methods[]. Cụm mật khẩu. Nếu cụm mật khẩu ngắn hơn dự kiến, nó sẽ được đệm âm thầm với các ký tự Sự mô tả
$iv
= "", & nbsp; & nbsp; 16]: Chuỗi | Sai[ string $data
, string $cipher_algo
, string $passphrase
, int $options
= 0, string $iv
= "", string
1 = $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
2, string $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
3 = "", int $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
4 = 16]: string|false[$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
string
$data
,
string $cipher_algo
,
string $passphrase
,
int $options
= 0,
string $iv
= "",
string
1 = $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
2,$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
string
3 = "",$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
int
4 = 16$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
]: string|falseThông số
5$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
$cipher_algo
0$cipher_algo
1$cipher_algo
2; Nếu cụm mật khẩu dài hơn dự kiến, nó bị cắt ngắn.$cipher_algo
3$cipher_algo
3 là một sự khác biệt của các cờ $cipher_algo
5 và $cipher_algo
6.$cipher_algo
5 and $cipher_algo
6. $cipher_algo
5 and $cipher_algo
6. $cipher_algo
7$cipher_algo
8$cipher_algo
9$passphrase
0$cipher_algo
8. Giá trị của nó có thể nằm trong khoảng từ 4 đến 16 cho chế độ GCM.Trả về giá trị
$passphrase
2 khi thất bại.$passphrase
2 on failure. $passphrase
2 on failure. Errors/Exceptions
$passphrase
3 nếu một thuật toán mật mã không xác định được truyền qua thông số $cipher_algo
0.$passphrase
3 level error if an unknown cipher algorithm is passed in via the $cipher_algo
0 parameter. $passphrase
3 level error if an unknown cipher algorithm is passed in via the $cipher_algo
0
parameter. $passphrase
3 nếu giá trị trống được truyền qua thông qua tham số $cipher_algo
7.$passphrase
3 level error if an empty value is passed in via the $cipher_algo
7 parameter. $passphrase
3 level error if an empty value is passed in via the $cipher_algo
7 parameter. Thay đổi
Phiên bảnSự mô tả 7.1.0 openSSL_encrypt [& nbsp; & nbsp; & nbsp; & nbsp; chuỗi ________ 0, & nbsp; & nbsp; & nbsp; & nbsp; chuỗi ________ 1, & nbsp; & nbsp; & nbsp; & nbsp; chuỗi $iv
= "", & nbsp; & nbsp; 16]: Chuỗi | Sai[ string $data
, string $cipher_algo
, string $passphrase
, int $options
= 0, string $iv
= "", string
1 = $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
2, string $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
3 = "", int $password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
4 = 16]: string|false$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
Thông số
5$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
$options
0$options
1$cipher_algo
0 ¶$options
2$options
3$options
4$options
5$options
6$options
7$options
8$options
9$iv
0$iv
1$cipher_algo
1 ¶$cipher_algo
2; Nếu cụm mật khẩu dài hơn dự kiến, nó bị cắt ngắn.
$iv
2
$iv
3
$iv
4
$iv
5
$iv
6
$iv
7
$iv
8
$iv
9
$iv
1 $cipher_algo
3 ¶
$cipher_algo
3 là một sự khác biệt của các cờ $cipher_algo
5 và $cipher_algo
6.$cipher_algo
5 and $cipher_algo
6.
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
11$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
12$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
13$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
14$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
15 $cipher_algo
7 ¶
Một vectơ khởi tạo không null.
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
16$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
17 $cipher_algo
8Thẻ xác thực được truyền qua tham chiếu khi sử dụng chế độ mật mã AEAD [GCM hoặc CCM]. ¶
$cipher_algo
9
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
19$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
20$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
21$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
22$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
23$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
24Dữ liệu được xác thực bổ sung. ¶
$passphrase
0
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
25$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
26$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
17$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
28 Độ dài của xác thực $cipher_algo
8. Giá trị của nó có thể nằm trong khoảng từ 4 đến 16 cho chế độ GCM. ¶
$passphrase
0
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
29$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
30$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
31$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
32$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
33$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
34$iv
1
Độ dài của xác thực $cipher_algo
8. Giá trị của nó có thể nằm trong khoảng từ 4 đến 16 cho chế độ GCM. ¶
Cụm mật khẩu. Nếu cụm mật khẩu ngắn hơn dự kiến, nó sẽ được đệm âm thầm với các ký tự $cipher_algo
2; Nếu cụm mật khẩu dài hơn dự kiến, nó bị cắt ngắn.
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
36$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
37$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
38$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
39 $cipher_algo
3 ¶
Một vectơ khởi tạo không null.
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
40Thẻ xác thực được truyền qua tham chiếu khi sử dụng chế độ mật mã AEAD [GCM hoặc CCM]. ¶
Cụm mật khẩu. Nếu cụm mật khẩu ngắn hơn dự kiến, nó sẽ được đệm âm thầm với các ký tự $cipher_algo
2; Nếu cụm mật khẩu dài hơn dự kiến, nó bị cắt ngắn.
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
41$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
42$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
43$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
44$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
45$iv
1 $cipher_algo
3 ¶
$cipher_algo
9
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
47$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
48$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
49$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
50$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
51$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
52$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
53$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
54Dữ liệu được xác thực bổ sung. ¶
$passphrase
0
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
55$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
56$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
57$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
58 Độ dài của xác thực $cipher_algo
8. Giá trị của nó có thể nằm trong khoảng từ 4 đến 16 cho chế độ GCM. ¶
Trả về giá trị
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
59$cipher_algo
00
$cipher_algo
01
$cipher_algo
02
$cipher_algo
03
$cipher_algo
04
$cipher_algo
05
$cipher_algo
06
$cipher_algo
07
$passphrase
2 khi thất bại.$passphrase
2 on failure. Phát ra lỗi cấp $passphrase
3 nếu một thuật toán mật mã không xác định được truyền qua thông số $cipher_algo
0.$passphrase
3 level error if an unknown cipher algorithm is passed in via the $cipher_algo
0 parameter. ¶
Phát ra lỗi cấp $passphrase
3 nếu giá trị trống được truyền qua thông qua tham số $cipher_algo
7.$passphrase
3 level error if an empty value is passed in via the $cipher_algo
7 parameter.
$cipher_algo
09
$cipher_algo
10
$cipher_algo
11
$cipher_algo
12
$iv
1Thay đổi ¶
Phiên bản
$cipher_algo
14
$cipher_algo
15
$cipher_algo
16
$iv
1 Các tham số $cipher_algo
8, $cipher_algo
9 và $passphrase
0 đã được thêm vào. ¶
$cipher_algo
9
$cipher_algo
18
Dữ liệu được xác thực bổ sung. ¶
Phương pháp mật mã. Để biết danh sách các phương thức mật mã có sẵn, hãy sử dụng openSSL_GET_CIPHER_METHODS [].openssl_get_cipher_methods[].
$cipher_algo
19
$cipher_algo
20
$cipher_algo
21
$cipher_algo
22
$iv
1openSSL tại mailismagic dot com ¶ ¶
7 năm trước
$cipher_algo
24
Biohazard Dot Ge tại Gmail Dot Com ¶ ¶ ¶
Ẩn danh ¶
$cipher_algo
25
$cipher_algo
26
$cipher_algo
27
$cipher_algo
28
$cipher_algo
29
$cipher_algo
30
$cipher_algo
31
$cipher_algo
32Denis tại bitrix dot ru ¶ ¶ ¶
6 năm trước
$cipher_algo
33
openSSL tại mailismagic dot com ¶ ¶
7 năm trước
$cipher_algo
34
$cipher_algo
35
$iv
1Biohazard Dot Ge tại Gmail Dot Com ¶ ¶ ¶
Ẩn danh ¶
$cipher_algo
37
$cipher_algo
38
$cipher_algo
39
$password = "supersecretkey";
$salt = base64_decode[$data['salt']];
$iterations = 5000;
$key_length = 32;
$is_raw_output = true;
$key = hash_pbkdf2["sha1", $password, $salt, $iterations, $key_length, true];
$iv = base64_decode[$data['iv']];
$encstr = base64_decode[$data['encrypted_data']];
$output = openssl_decrypt[$encstr, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv];
var_dump[$output];
var_dump[openssl_error_string[]];
57$cipher_algo
41Denis tại bitrix dot ru ¶ ¶ ¶
6 năm trước
$cipher_algo
42
Raphael ¶ ¶
6 năm trước
$cipher_algo
43
Raphael ¶
$iv
1Jean-Luc ¶ ¶
4 năm trướcthe process of concealing plaintext data using the AES algorithm and an AES key length of 256 bits. In addition, 256 bits is the largest AES key length size, as well as its most mathematically complex. It is also the most difficult to crack.
naitsirch tại e dot mail dot de ¶ ¶
$cipher_algo
44 used to encrypt the
data. Syntax: string openssl_encrypt[ string $data, string $method, string $key, $options = 0, string $iv, string $tag= NULL, string $aad, int $tag_length = 16 ] Parameters: $data: It holds the string or data which need to be encrypted.
AES CBC 256 là gì?
Mã hóa AES 256 bit là gì? Mã hóa AES 256-bit đề cập đến quá trình che giấu dữ liệu rõ ràng bằng thuật toán AES và độ dài khóa AES là 256 bit. Ngoài ra, 256 bit là kích thước chiều dài khóa AES lớn nhất, cũng như phức tạp nhất về mặt toán học. Nó cũng là khó nhất để bẻ khóa.the process of concealing plaintext data using the AES algorithm and an AES key length of 256 bits. In addition, 256 bits is the largest AES key length size, as well as its most mathematically complex. It is also the most difficult to crack..
OpenSSL_encrypt là gì?
hàm openSSL_encrypt []: hàm openSSL_encrypt [] được sử dụng để mã hóa dữ liệu.Cú pháp: Chuỗi openSSL_encrypt [chuỗi $ data, chuỗi $ phương thức, chuỗi $ key, $ tùy chọn = 0, chuỗi $ iv, chuỗi $ tag = null, chuỗi $ aad, int $ tag_length = 16] tham số: $ data: nó giữchuỗi hoặc dữ liệu cần được mã hóa.used to encrypt the data. Syntax: string openssl_encrypt[ string $data, string $method, string $key, $options = 0, string $iv, string $tag= NULL, string $aad, int $tag_length = 16 ] Parameters: $data: It holds the string or data which need to be encrypted.
Làm cách nào để mã hóa một tệp PHP?
Mã hóa các khối nhỏ hơn của một tệp lớn..
Tạo một vectơ khởi tạo ngẫu nhiên [iv] ....
Lưu trữ IV này ở đầu tệp được mã hóa.....
Lấy một đoạn đầu tiên, mã hóa nó với IV và lưu trữ nó.....Advanced Encryption Standard. AES encryption has three block ciphers which are AES-128 [128 bit], AES-192 [192 bit], AES-256 [256 bit]. These block ciphers are named due to the key used for the encryption and decryption process.