LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Countermeasures for cold boot attacks on encryption keys? (https://www.linuxquestions.org/questions/linux-security-4/countermeasures-for-cold-boot-attacks-on-encryption-keys-656910/)

win32sux 07-19-2008 08:54 PM

Countermeasures for cold boot attacks on encryption keys?
 
I noticed today that those guys that published the report on cold boot attacks on encryption keys back in Februrary have now released source code which illustrates the techniques they use. So I was just wondering if, during these months since the report first surfaced, anyone has heard about any new GNU/Linux software which helps at least mitigate this vulnerability. Or is the consensus still that there is no way to address this problem using software?

pinniped 07-19-2008 10:34 PM

Well, first of all you need physical access to the machine and it must be booted.

The mentioned use of Treacherous Computing (storing an encryption key) is pretty stupid - hell, why not just store the key in ROM? The reason of course is that without significant specialized hardware, it will take forever and a day if you relied on the Treacherous Computing chip to decrypt the filesystem, so currently existing chips in consumer devices just aren't up to the task. So how do you 'fix' that? Well, you can store everything in memory encrypted and decrypt on the way to the CPU (treacherous computing built into the CPU). Using the right algorithms, this can absolutely defeat the technique used by those Princeton guys. One possible way around that protection scheme would be to make an image of the memory, then tear out the decryption device and trick it into decoding that memory - if you have zero bitrot then your attack succeeds, but if a single bit in the block goes bad, you get nothing but garbage out anyway.

Another hardware scheme to foil such a plan is to put in circuitry, possibly within the RAM chips themselves, which scramble the memory contents when power is removed. The trick here is that there still needs to be enough power available to the chips to do their job, but a 'power failure' circuit somewhere needs to send a signal to indicate that power loss is imminent - screw up the memory.

Now lets pretend we have an encoder/decoder implemented in an extremely fast FPGA running at the same clock rate as the CPU, or even slightly higher. Now every time data is transferred from the RAM to the cache (or the other way) it must be encrypted/decrypted, which adds time to the data transfer and essentially slows things down - possibly even 'starving' the CPU. Most people wouldn't approve of that, but I bet if you build a computer like that you'll have government departments lining up to buy them; after all, most modern CPUs are overkill for the processing required and a sacrifice in speed for secrecy is an easy trade.

Even a Treacherous Computing device is not a good place to store cryptographic data anyway. Combining the Princeton folks' "put the RAM into cold storage to prevent bitrot" with other silicon forensic techniques which the semiconductor industry has been using as diagnostic techniques for over 30 years, the keys in the Treacherous Computing device can be recovered within a few hours - you just need a lab with the right equipment.

pinniped 07-19-2008 10:45 PM

Some simple precautions to take on existing machines to foil such an attack would include:

1. Set your BIOS to boot only from HD, and activate your BIOS password. This will force someone to have a HD handy to swap with yours.
2. If you use treacherous computing anyway, and you have a BIOS that makes good use of it (maybe only hypothetical at this point in time), the machine can be forced to boot from an encrypted bootloader. If you didn't encrypt the bootloader correctly, you're just not going to boot from that mass storage device (with the exception of CDs). Another option is to set to boot from that HD only; you'll have great fun when you need to replace the HD. :)

OlRoy 07-20-2008 06:32 AM

Is it true that you not only have to have your computer powered on, but your data has to be currently decrypted, or not properly unmounted when an adversary gets physical access to your computer?

beadyallen 07-20-2008 08:07 AM

Quote:

Is it true that you not only have to have your computer powered on, but your data has to be currently decrypted
No, you need to have entered the password, which is stored in memory for subsequent decryptions.

How about just having the key overwritten when the computer switches off, goes to sleep or whatever. I believe that PGP does this already. Any hibernation, sleep etc causes the encrypted filesystem to be unmounted, and the keys shredded. It shouldn't be too hard to implement for other systems (if it's not already). And of course, don't leave your PC on in a vulnerable place. I'm sure that a determined attacker on a high profile target would be able to get the keys, but it's probably easier for them to kidnap and torture you to give up the keys.

win32sux 07-20-2008 05:17 PM

Quote:

Originally Posted by beadyallen (Post 3220591)
How about just having the key overwritten when the computer switches off, goes to sleep or whatever.

I think that would work just fine if it wasn't for the fact that the bad guy could just pull the power cord.

OlRoy 07-20-2008 05:28 PM

Quote:

Originally Posted by beadyallen (Post 3220591)
No, you need to have entered the password, which is stored in memory for subsequent decryptions.


OK, not that this is practical (security rarely is though) but if you rarely use the encrypted data, could you shutdown the computer sometime soon after you were done with it to clear the password from memory? Then would you be safe as long as you haven't decrypted the data again without having shutdown afterwards?

win32sux 07-20-2008 05:31 PM

Quote:

Originally Posted by OlRoy (Post 3220947)
OK, not that this is practical (security rarely is though) but if you rarely use the encrypted data, could you shutdown the computer sometime soon after you were done with it to clear the password from memory? Then would you be safe as long as you haven't decrypted the data again without having shutdown afterwards?

I'm sure one can have something run at shutdown which overwrites the memory where any keys have been stored. But by simply cutting the power, the bad guy prevents this from happening, and the attack can continue as normal. So having a wipe occur at shutdown would only really protect you from a bad guy without access to your power lines, I think. Someone please correct me if my understanding isn't right.

pinniped 07-20-2008 06:02 PM

Just do like in the movies - 'James Bond' - load the machine with explosives, then go to the bar and ask for another martini - shaken, not stirred.

blackhole54 07-21-2008 01:52 AM

Quote:

Originally Posted by win32sux (Post 3220949)
I'm sure one can have something run at shutdown which overwrites the memory where any keys have been stored. But by simply cutting the power, the bad guy prevents this from happening, and the attack can continue as normal. So having a wipe occur at shutdown would only really protect you from a bad guy without access to your power lines, I think. Someone please correct me if my understanding isn't right.

I think you're probably right. The moral is don't leave a computer physically insecure while it is in a vulnerable state.

Now if you're worry is somebody sneaking up behind you and conking you on the head (or something) while you are using the computer maybe you do need James Bond like defenses such as the computer deleting the key if it loses a valid retina scan and blowing up if anybody yanks the power cord. (Heaven help you if you have a power failure! ;) )

Amdx2_x64 08-09-2008 03:36 PM

Cold boot attack
 
Well I wanted to get more involved with c++, but I got a bit side tracked with security related issues. Honestly I find this more fascinating then anything else right now.

Anyways. I stumbled across something that was pretty much new to me. The quote below is from Wikipedia. It would be great to hear others opinions on a Cold Boot Attack. Some of my questions are: It sounds like it can happen, but how likely is it to happen? Has this been a serious problem in the past? How can one protect themselves against this since it is hardware related? How much data can actually be in the memory? Is there a way to purge the RAM before or during shutdown of a PC? Are there any safe guards that can be put into place in case the computer looses power or doesn't shut down normally, etc? I would love to hear any thoughts, opinions and experiences concerning this.

Quote:

In cryptography, a cold boot attack or platform reset attack is a type of side channel attack in which an attacker with physical access to a computer is able to retrieve encryption keys from a running operating system by cold booting the machine.[1] The attack relies on the data remanence property of DRAM[1] and SRAM[2] to retrieve memory contents seconds to minutes after power has been removed.

Description

To execute the attack, power is removed from a running operating system without letting it shut down cleanly; an alternate operating system with a small kernel is then immediately booted off a removable drive, and the contents of pre-boot memory dumped to a file. Offline analysis can then be performed against the file to retrieve the sensitive keys contained in it.

The attack has been demonstrated to be effective against full disk encryption schemes of various vendors and operating systems, even where a Trusted Platform Module (TPM) secure cryptoprocessor is used.[1] This is because the problem is fundamentally a hardware (insecure memory) and not a software issue. While the focus of current research is on disk encryption, any sensitive data held in memory are vulnerable to the attack.[1]

The time window for an attack can be extended to hours by cooling the memory modules. Furthermore, as the bits disappear in memory over time, they can be reconstructed, as they fade away in a predictable manner.[1] In the case of disk encryption applications that can be configured to allow the operating system to boot without a pre-boot PIN being entered or a hardware key being present (e.g. Bitlocker in a configuration that uses a TPM only without a PIN or USB key), the time frame for the attack is not limited at all:[1]
“ Notably, using BitLocker with a Trusted Platform Module (TPM) sometimes makes it less secure, allowing an attacker to gain access to the data even if the machine is stolen while it is completely powered off ”

[edit] Mitigations

One mitigation is not to use sleep mode and to shut down or hibernate a computer instead.[3][4] However a pre-boot PIN or password may also be required to prevent an attacker booting the normal operating system before launching the attack in the scenario where a machine is already turned off.

Another is to use hardware and an operating system that both conform to the "TCG Platform Reset Attack Mitigation Specification",[5] an industry response to this specific attack. The specification forces the BIOS to overwrite memory during POST if the operating system was not shut down cleanly.



http://en.wikipedia.org/wiki/Cold_boot_attack

stress_junkie 08-09-2008 05:21 PM

This is simply one example that illustrates the long standing truism in computer security that if you can get your hands on a computer then you can disable its security. Computer security specialists have long known that physical access to the machine is the front line of security. That is why you often hear people say that the only secure computer is one that is stored in a vault with no connection to the outside of the vault and with the computer's power cord removed.

Computer security is just like home security insofar as you cannot create an unbreakable system. The best that you can hope do is to make your security so difficult to break that most people will give up before they succeed.

Amdx2_x64 08-09-2008 06:20 PM

I am starting to understand that. I love computers but it worries me how much we rely on them and assume that they are safe and nothing or no one can break into them.

I think I will be focusing on this more now and all related topics.

Amdx2_x64 08-09-2008 06:55 PM

I am finding some more information about this. So I wanted to post it here.

http://citp.princeton.edu/memory/

win32sux 08-10-2008 01:52 AM

Amdx2_x64, I've merged your thread into this one, as it's essentially the same question/discussion.


All times are GMT -5. The time now is 09:55 AM.