Anacir182
Anacir182

Reputation: 90

mcrypt_decrypt(): Size of key is too large for

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

Answers (1)

user149341
user149341

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

Related Questions