0

openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended

terry created at6 years ago view count: 5988

openssl_encrypt($data, 'aes128', '123456', OPENSSL_RAW_DATA);

[ErrorException]
openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially
insecure and not recommended

report
回复
0

iv 相当于加盐,为了增加破解难度。对于每份数据而言password是一样的,iv每份数据都不会不一样。

$iv = random_bytes(16);
$data = openssl_encrypt($data, 'aes128', '123456', OPENSSL_RAW_DATA, $iv);
6 years ago 回复

相关搜索关键词