Reputation: 90
I'm trying to Decrypt a data with a key of AES 256 61 character length. Please refer below code: $key is AES 256 61 character length.
mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $value, MCRYPT_MODE_CBC, str_rand(61));
Error: mcrypt_decrypt(): Size of key is too large for this algorithm
Please advice.
Thanks,
Upvotes: 1
Views: 1776
Reputation:
The error message says it all. AES256 requires a 256-bit (that is, 8 character) key; the key you are passing to it is too large.
Upvotes: 1