i'm working on an application using the library through php.
from what i found on the php site i understand that in case of mcrypt 3des the only key accepted is 192 bit. which gets chopped into 3 64 bit ones to perform each step of the 3des encryption/decryption.
mcrypt's 3DES only accepts 192 bit keys, but Microsoft's .NET and many other tools accept both 128 and 192 bit keys.
If your key is too short, mcrypt will 'helpfully' pad null characters onto the end, but .NET refuses to use a key where the last third is all null (this is a Bad Key). This prevents you from emulating mcrypt's "short key" behaviour in .NET.
How to reconcile this? A little DES theory is in order
3DES runs the DES algorithm three times, using each third of your 192 bit key as the 64 bit DES key
hi all..
i just need to verify something....
i'm working on an application using the library through php.
from what i found on the php site i understand that in case of mcrypt 3des the only key accepted is 192 bit. which gets chopped into 3 64 bit ones to perform each step of the 3des encryption/decryption.
quote from http://www.php.cn/php/function.mcrypt-encrypt.html: "
mcrypt's 3DES only accepts 192 bit keys, but Microsoft's .NET and many other tools accept both 128 and 192 bit keys.
If your key is too short, mcrypt will 'helpfully' pad null characters onto the end, but .NET refuses to use a key where the last third is all null (this is a Bad Key). This prevents you from emulating mcrypt's "short key" behaviour in .NET.
How to reconcile this? A little DES theory is in order
3DES runs the DES algorithm three times, using each third of your 192 bit key as the 64 bit DES key
Encrypt Key1 -> Decrypt Key2 -> Encrypt Key3
" // end quote.
is this correct?
thank you.