I'm using Truecrypt for full-disk encryption of my computer's drives. Is it safe to Sleep or Lock my computer, or would that allow someone to bypass the disk encryption and access the data on the drives as if they weren't encrypted?


3 Answers 3


Full disk encryption, by necessity, needs the key in RAM to encrypt/decrypt data in real time.

So -

  • Firewire has a DMA like mode that basically allows one to scan the entire RAM of the system. Full disk keys may be recovered from a target system's RAM if it's connected via Firewire to a host running the right software and the target system has a Firewire driver that supports this. Your system is vulnerable to this if it is locked. I'm not sure if it's possible to Firewire-read your RAM while it is asleep.

  • If your system is hibernating, all RAM is dumped to a hibernation file before power off. I believe Truecrypt marks pages of its driver somehow to prevent this, but as long as you keep the hibernation file on an encrypted volume you should be safe.

  • DRAM takes a while to decay after power off. Theoretically it's possible for an adversary to remove the RAM from your system,. possibly spray it with canned air to lower the temperature and lengthen the decay rate, and put it in a system or tool that scans the RAM and extracts the keys from there. It also may be possible to power cycle your system, boot off of a live CD, and recover they keys from RAM that way.

If the RAM is powered off and has decayed sufficiently, it's not possible to get keys from it, and your encrypted data is safe in this situation.

Of course the first and third items are tinfoil-hat level stuff, but to prevent against it you should power your system down completely when you are not using it, and run Memtest86+ or your system diagnostics to clear RAM. At least one security-focused Linux distribution does this before power off, I can't think of the name of it.

Full disk encryption does protect you against someone taking the hard drive out of the system and trying to read it in another system while it is asleep if they don't extract keys from RAM directly, which is an advanced operation.


I posted an answer to a similar question here:

While the contents of the disk are encrypted, the operating system is decrypting the content of the disk on the fly in order to access it. The screen lock does little to protect the contents of the disk while the computer is running.

All the screen lock does is prevent someone from running programs / reading your screen while you're away. As long as the computer is running and the encrypted disk mounted, your data is vulnerable. Granted most thieves would just shut the machine off / reboot it once they had it.

However, if you're paranoid about your data, the inconvenience of powering down/powering up every time you walk away for a while is a small price to pay IMHO.

The fact that most current full disk encryption methods use RAM to store the keys makes them only partly secure while the system is running. DMA access via Firewire or PCI bus is a possibility while the system is running and not quite as tinfoil hat as some might suggest. There was a great talk at Defcon 21 regarding the problem and the work being done to try and mitigate it (the slides for the presentation will probably show up on the archives soon, though).


No. as others pointed out, an adversary with physical access to the machine can do almost anything with data in ram.

When you hibernate a computer, it caches active ram out to your hard disk. since the key is in active ram, you are placing your key in a file on your hdd, that effectively never goes away. There are tools designed to break into Truecrypt volumes, which scrape ram for your key, and if your volume is not mounted, it will fall back to checking your hiberfil.sys on windows to see if it was cached to disk during the last hibernation.

FDE is a problem because your key will always be present in ram, and for that same reason, it will always get copied to hiberfill.sys on suspend/hibernate.

see this thread for examples of practical attacks and a fuller explaination: Cracking truecrypt files in minutes? Or just truecrypt harddrives in minutes?

  • FDE is a problem because your key will always be present in ram, and for that same reason, it will always get copied to hiberfill.sys on suspend/hibernate. Okay, but isn't @LawrenceC's point that with FDE hiberfil.sys is on an encrypted drive a valid one? When you start a hibernated computer with TrueCrypt FDE, you need to provide the encryption key. Wouldn't someone have to decrypt the volume in the first place in order to read the keys from hiberfil.sys (in which case the fact that hiberfil.sys contains the keys is academic)?
    – Adi Inbar
    May 29, 2016 at 0:29
  • BTW, I'd like to clarify that this discussion only applies to hibernate, not suspend or sleep. Putting an FDE computer in sleep (Windows) or suspend (Linux) does leave the keys exposed, but that's because it doesn't clear the RAM; nothing is written to hiberfil.sys or the swap space.
    – Adi Inbar
    May 29, 2016 at 0:54
  • Sleep and Hibernate are different. Sleeping or locking the computer leaves the system booted, so the keys are still in ram and accessible to any evil maid: attack schneier.com/blog/archives/2009/10/evil_maid_attac.html May 31, 2016 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .