Hi,
Is there a way to set the keysize for blowfish encryption? I'm using mcrypt 2.4, and when encrypting with another keysize then 56, I get:
Warning: key size incorrect; supplied length: 55, needed: 56 in /tmp/phptemp on line 8
Blowfish allows other keysizes, but how do I specify it?
Code is ($key is 55 chars long):
$key = "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn";
$value = "secret";
$td = mcrypt_module_open (MCRYPT_BLOWFISH, "", MCRYPT_MODE_CFB, "");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
mcrypt_generic_init ($td, $key, $iv);
$encrypted_data = mcrypt_generic ($td, $value);
mcrypt_generic_end ($td);
echo $encrypted_data;