Frage

I'm going to use Blowfish cipher for my project in PHP (mcrypt_blowfish). But I have a question regarding the used of mcrypt_blowfish, how long is the deafult key size that was used by this mode of encryption in PHP?? Some other cipher that was support by libmcrypt had a declared key size, like :

 MCRYPT_RIJNDAEL_128 --> 128 bit key

 MCRYPT_RIJNDAEL_192 --> 192 bit key

 MCRYPT_RC6_128 --> 128 bit key

 MCRYPT_RC6_192 --> 192 bit key

But how long is the deafult key size for mcrypt_blowfish?? Thx before...

War es hilfreich?

Lösung

It seems to use a variable key size (it seems there isn't a "default" size) :

http://en.wikipedia.org/wiki/Blowfish_(cipher)

"Blowfish has a 64-bit block size and a variable key length from 32 bits up to 448 bits"

Here is an example using a 448 bits key : http://www.php.net/manual/en/function.mcrypt-encrypt.php#96635

Looking on other sites, MCRYPT_BLOWFISH_128, MCRYPT_BLOWFISH_192, MCRYPT_BLOWFISH_256 and MCRYPT_BLOWFISH_448 should work too (didn't try ^^)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top