I have a string encrypted in AES 128 + Zero Padding + IV and CBC mode.
- About zero padding, if the length is not 128bit, the encryption will fill the remaining part 0x00 and reach 128 bit.
- An IV value can be specified successfully only if both IV value and IV value confirm are set to the same value
- The default value is all 0x00
- So The Password exampl= ** bit + ** zeros
I've tried too many things to decrypt this, like
function decrypt($data, $key)
{
$encryption_key = base64_decode($key);
list($encrypted_data, $iv) = array_pad(explode('::', base64_decode($data), 2), 2, null);
return openssl_decrypt($encrypted_data, 'aes-128-cbc', $encryption_key, 0, $iv);
}
I tried too many other things, nothing works, what am I doing wrong? I am using "exampl", as the key.