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 using Truecrypt and I have multiple volumes on multiple computers. Keeping each of the 20+ character passwords straight is getting complicated, so I want to use keyfiles. Since the password is being combined with 1024 bytes from the keyfile, does it matter if my password is "dog"? Does a keyfile (say, a compressed file with lots of crazy characters) with a short password have the same brute force protection as a complex 20+ character password? I'm assuming no one has access to my keyfiles.

share|improve this question
The OP is asking...can I still decrypt the volume if the keyfile is accidentally deleted... I know the password...but keyfile is no more –  user24418 Apr 7 '13 at 10:23

4 Answers 4

There are at least the following problems with TrueCrypt keyfile implementations: Keyfile parsing ignores data beyond first 1MB. In three-factor authentication (something you have{keyfile}, something you know{password} and somethign you are {biometrics}), when being less or more connected to the internet, you might want to be able to detect file traffic of your files from your most acessed directory, i.e. the one with keyfiles.Llarge files cannot be stored hidden in a bootsector using Evil Maid style attack etc, therefore you want them to be large. Veracrypt and Truecrypt both have this problem.

Second problem is that the algorithm uses CRC32 instead of SHA256 or better, therefore appending CRC32 value at the end of most of your files (active preempive attack on keyfiles), BEFORE you use them as a 'new fresh keyfile', might nullify the keyfile output, rendering you vulnerable when you switch unknowingly to a new keyfile thinking it will add something fresh to teh password. Keepass, Diskcryptor do not have this problem.

Third problem is that keyfile processing is not stating wiht password or salt, therefore if you by accident use short password and the same keyfile TWICE, from the attackers standpoint, he would never need to recalculate the keyfile again over entire file, but rather stay with the same known CRC32 spread over 64bytes of pattern unique to a given file. In other words, in order to get all possible keyfile contributions to password from your filesystem you need 64 bytes of data per each file, and that you can do silently with backdoored online antivirus! This problem is shared by veracrypt, discryptor and keepass and probably all known encryption software. teh proper implementation would ba HASH(HASH(HASH(HASH(salt) ^ HASH(password)) ^ keyfile[block_0]), keyfile[block_1], ...), a nested set of calls starting with salt and password so if either one changes, and even with broken RNG at least password could change, you should recalculate entire routine along a keyfile. Only then keyfile method would be worth considering, because the attacker must have entire, potentially heavy file in order to make its brute force attack. What is important to udnerstand that short keyfiles of minimal lenght (64 bytes) are both easily detectable, potentially exposing RNG weaknesses in lower bits, and their entropy is not comparable with a typical file whose entropy is very low per kilobyte. This is another reason you want >1MB-sized files, besides that they are moire difficult to steal or transport clandestinely via internet.

All said, it is very good to use keyfile also as it doesnt gives a password entirely for free if you have been attacked by a keylogger.


tl;dr - use a strong password, and complement this with keyfiles if possible.

In terms of cryptography, it is computationally infeasible break into your TrueCrypt volume without having both the password and the keyfiles. Fundamentally, the decryption key is an xor combination of the hash of the password and the hash of the keyfiles. However, this does not mean that you get the same practical security from both types of key material.

TrueCrypt's keyfiles are part of a two-factor authentication scheme. The password is something you know, the keyfiles are something you have. In most cases, something you know is much stronger than something you have - people can steal your belongings, but it's much more difficult to steal your knowledge. A combination of the two allows for strong security.

As such, relying only on keyfiles for security is probably a bad idea. You're limited to security-through-obscurity techniques, where you try to hide the keyfiles. If you store them on your hard disk, forensic analysis of your disk will usually be able to locate your keyfiles. If you store them on a USB stick or flash card, a thorough search of your house / person will probably result in an attacker finding them.

Using a weak password on your main volume, then encrypting your keyfiles with a strong password is pointless - at that point you should just use a strong password on the main volume, and leave the keyfiles unencrypted.

share|improve this answer

If you think the keyfiles are secure, then no password is needed, if you can not have the risk of the keyfiles leaking, then you need to password protect them with a strong password. No password or a weak password is practically the same.

You can store your keyfiles within another truecrypt volume with a strong password, this way you only need to remember one password and your keyfiles are secure.

share|improve this answer
I disagree with the last part. If you're storing the keyfiles in another TrueCrypt volume, it's relatively easy to write forensics heuristics to detect high-entropy files without known headers (e.g. RAR / JPEG) to find the other volume. Then it's just a case of cracking the weak password. –  Polynomial Aug 11 '12 at 19:55
I disagree, you would still be able to find encrypted volumes with forensic tools and would still know something is interesting in there since it's an encrypted password protected volume. So you'll end up bruteforcing it anyway. If you would use a weak password and saying it becomes harder to find, then you are dealing with security through obscurity. –  Lucas Kauffman Aug 12 '12 at 7:51
I'm confused. You seem to have said you disagree with me, then made the same point I did. What? –  Polynomial Aug 12 '12 at 8:37
@Polynomial Your first comment doesn't make sense to me. Lucas suggested keeping the keyfiles in a volume with a strong password, so what weak password would there be to crack? The attacker could only find the keyfile by reading the volume with the strong password. –  Gilles Aug 12 '12 at 18:34
@Gilles Then why not use a strong password on the volume and store the keyfiles on a USB stick, unencrypted? The whole point of TC's keyfiles is to provide two-factor authentication. –  Polynomial Aug 12 '12 at 22:43

If no-one has access to your keyfiles, then no-one is getting access to your data.

Passwords are used here as an extra layer of "what if the key is leaked" protection. If the keyfile is absolutely secure (speaking theoretically here!) then so is the data.

I have a number of volumes secured purely by keyfiles, with no password at all, where the chance of the key leaking is minimal. Note that this may or may not be a reasonable assumption, depending exactly on your situation - I use it for encrypting my backups (each machine has an independent key, stored on the machine, which it uses to mount a TC volume before backing up to it - which needs to be done without manual intervention, which precludes a password).

share|improve this answer

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.