After reading an article from a forensics software company. I'm worried about attacks that may be able to recovery the OTFE(on-the-fly encryption) key of VeraCrypt from RAM.

Thereat model:

  • On Windows, a signed spyware running elevated is able to access RAM or page file.
  • It tries to locate the OTFE key during or after a VeraCrypt volume is mounted.


  • Is there anyway to prevent the key from being accessed while it's in RAM ?
  • Does the key remain in RAM after the volume is dismounted ?

Thanks in advance.

2 Answers 2

  1. Maybe. The latest VeraCrypt version includes RAM encryption. It's not bulletproof, but it's at least way better than not having the RAM encrypted. Source

  2. No. If the computer is turned off or the colume is dismounted correctly, the key should be cleared from RAM. It's a sudden power-off you should worry about. Or an attacker grabbing your computer while it's still powered on.


You didn't think your threat model through. If spyware is elevated enough to read arbitrary kernel memory, then it can just steal your personal data directly, since it's decrypted already if the key is in RAM, without needing to bother stealing the key or even doing anything differently than if you weren't using encryption. You should instead worry about how to make sure spyware doesn't end up running in an elevated context.

  • If spyware managed to run on your computer, you have many other problems than that IMHO. Also you can re-encrypt your partition (preferably using a clean computer).
    – U. Windl
    Commented Jun 30, 2023 at 9:36

You must log in to answer this question.

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