How can you override the salt limit with mcrypt 24 characters?

I would like to use salt with more than 24 characters with mcrypt.

mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)); 

However, if I make $ salt more than 24 characters, it gives this warning and uses truncated salt with 24 characters:

Warning: mcrypt_encrypt () [function.mcrypt-encrypt]: the key size is too large for this algorithm

Is there any way around this?

+4
source share
2 answers

24 is the limit of this alorism. Characters over 24 characters are not used. But you can always transform your salt.

http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

+3
source

I personally use MD5 salt and use it, otherwise you would need to choose a different algorithm.

0
source

All Articles