File hashing is used to take a hash of the clear text. In this way, you can
append the hash to the encrypted text. When decrypting, you remove this
hash, decrypt the rest of the file, hash this decrypted file and see if the
two hashes match up. If they don't then an incorrect key was used with the
algorithm (or the data was corrupted somehow).
Hashes are typically used as sanity checks in this way.

-----Original Message-----
From: Jimmy Lantz [mailto:[EMAIL PROTECTED]]
Sent: 22 May 2002 09:31
Subject: RE: [PHP] Mcrypt: Blowfish or Twofish or no fish? part 3

>I believe that twofish has been successfully broken, so use blowfish
>instead. Typically, for encrypting files you will use an algorithm like
>blowfish in cbc mode (as opposed to ebc mode) but I don't know if Mcrypt
>supports this. Also, when creating the hash of the file, it is probably
>to use SHA-1 instead of MD5, as there appears to be some concern with MD5
>over it's compression function.

It helps :)
I have been looking into Blowfish with cbc mode :)
If I use SHA-1 it's still no way to dehash it during decryption of the file,
so I fail to see the use of Hashing in fileencryption.
Could someone enlighten me?
/ Jim

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to