Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I'm trying to a cascading cipher encryption algorithm to encrypt a textfile via mcrypt. I'm essentially trying to emulate the behavior of TrueCrypt, where it can cascade two or three different cipher algorithms when encryption data.

From this website I see that cascading encryption algorithms are a feature of mcrypt.


Three ciphers in a cascade [15, 16] operating in XTS mode (see the section Modes of Operation). Each 128-bit block is first encrypted with Serpent (256-bit key) in XTS mode, then with Twofish (256-bit key) in XTS mode, and finally with AES (256-bit key) in XTS mode. Each of the cascaded ciphers uses its own key. All encryption keys are mutually independent (note that header keys are independent too, even though they are derived from a single password – see the section Header Key Derivation, Salt, and Iteration Count). See above for information on the individual cascaded ciphers.

However, the command line mcrypt provided from the sourceforge page doesn't seem to have a switch for cascading ciphers.

Is this cascading encryption algorithm option only available through the mcrypt library rather than the command line utility? Furthermore, will encrypting the encrypted file with a new cipher (but same password) be cryptographically the same as the cascading ciphers algorithms?

As a side note: the main reason I'm trying to use mcrypt over TrueCrypt is because TrueCrypt has a 64 character limit on the password length. If there is another open source utility without this password length limit, please let me know.

I'm aware that GnuGP doesn't have a 64 character limit, but I'm not sure if it supports cascading cipher algorithms.

share|improve this question
The "mcrypt" page you posted seems highly suspicious. It is a verbatim word-for-word copy of the real TrueCrypt website. The SourceForge page you linked is the correct one for mcrypt. –  Polynomial May 13 '13 at 13:08
Hmm, looking at man mcrypt produces the same info from the sourceforge page, but nothing like the website I found. Perhaps the website is mistaking TrueCrypt for mcrypt. –  Vilhelm Gray May 13 '13 at 13:12
Mimir Software + TrueCrypt = "MCrypt". It's nothing to do with the actual mcrypt. They're probably selling open source software illegally, or have backdoored the hell out of it. –  Polynomial May 13 '13 at 13:16
add comment

1 Answer

up vote 5 down vote accepted

There is one mcrypt which is a command-line utility and library for file encryption; and another mcrypt which is completely unrelated, and appears to be a direct rip-off of TrueCrypt, which is an implementation of an encrypted filesystem (and that rip-off might be illegal and/or malicious as well). GnuPG is an implementation of the OpenPGP standard, which covers symmetric encryption, asymmetric encryption and signatures, initially for use with emails. All these software differ quite a lot in offered functionalities, so comparing them together in abstracto makes little sense. You are encouraged to first define (at least for yourself !) what functionality you are looking for, and then, only then, see what product may provide it.

Nevertheless, we can state some things generically. For instance, cascading encryption algorithms is not a very rational feature. Cascading algorithms has any value only on the off-chance that an as yet undefined attack, which transcends our current knowledge on encryption algorithms, is still somehow thwarted by the cascade. It is speculation over speculation; it is like making bets on whether Pope Francis would play the guitar or the drum kit if he decided to switch careers and become a rock star. On the other hand, the overhead implied by cascading algorithms is very real (encrypting twice, that's twice the CPU cost).

Insisting on cascading is usually the sign of misaligned priorities; it is concentrating on phantasmagoric issues which are highly improbable and cannot be quantified anyway, at the expense of much more mundane and actually more serious issues. The same can be said about most "reasons" for oversized passwords: seriously, if you cannot stuff 80 bits of entropy in a 64-character password, then you are doing something very wrong with password generation; and if these 80 bits of entropy are not enough, then your key derivation function sucks. These are the real issues that must be dealt with.

share|improve this answer
Is this lack of practical use the reason that TrueCrypt appears at a glance to be the only popular solution offering cascading encryption algorithms (i.e. LUKS doesn't offer the option since it doesn't provide much further benefit over costs)? –  Vilhelm Gray May 13 '13 at 17:43
"Lack of practical use" is the polite way of expressing it. Personally, I would have said that cascading algorithms is bloody stupid. I am somewhat disappointed in TrueCrypt for indulging in such voodoo. –  Tom Leek May 13 '13 at 17:47
After thinking about it for a bit, I think you're right -- in fact, cascading ciphers might worsen the encryption by providing new opportunities for attack (e.g meet-in-the-middle attacks, etc). –  Vilhelm Gray May 13 '13 at 17:52
I am still confused though about why a 64 character limit is even enforced. If a user decides to use a passphrase consisting of a permutation of 10 random English words (thus exceeding 64 characters), would it be relatively secure to just hash this string via SHA-512 (thus getting the string within 64 characters) and use that as the passphrase? If so why wouldn't TrueCrypt implement this method, or did they just overlooked this option? –  Vilhelm Gray May 13 '13 at 18:04
From TrueCrypt's Version History document: The maximum volume password length has been decreased from 100 to 64 characters. This was necessary to avoid the following: When a password longer than 64 characters was passed to HMAC-SHA-1, the whole password was first hashed using SHA-1 and the resultant 160-bit value was then used instead of the original password (which complies with HMAC-SHA-1 specification), thus the password length was in fact reduced. –  Vilhelm Gray May 13 '13 at 21:22
show 1 more comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.