I am trying to add encryption functionality to a PHP script, modeled on an existing C# application.
The C# app uses the Rijndael algorithm with default constructor. From this I am able to determine that it has a key size of 256 and a block size of 128.
I am unsure about selecting the appropriate cipher for php's mcrypt function. The list of ciphers show:
MCRYPT_RIJNDAEL_128
MCRYPT_RIJNDAEL_192
MCRYPT_RIJNDAEL_256
But I am not sure if the trailing number is referring to key length, the number of bits used in the encryption or if those are one in the same.
What cipher should I use to match the existing functionality? When I try 256 I get the error "The IV parameter must be as long as the blocksize"
. If I try 128, the resulting keys don't match (though I suspect this is still an error with something other than cipher selection.)
Sorry for the basic nature of the question, it would help to have some layman explanation.