Are passwords stored in memory safe?
security.stackexchange.com
security.stackexchange.com
Ed Felton did some great work (2008) where he physically removed the sticks of DRAM from one computer, stuck them in another, and read their contents. But doesn't DRAM lose it's content without continuous power? Not if you turn a can of compressed air upside down and spray the chips first, cooling them to -50C! He used this to recover encryption keys and defeat whole disk encryption.
Pretty crazy stuff: https://citp.princeton.edu/research/memory/
update: link to images/videos: https://citp.princeton.edu/research/memory/media/
You can do a lot with that space. My company PrivateCore runs an entire Linux/KVM stack within the L3 cache, then fully encrypts main memory. Someone physically acquiring memory would only obtain plaintext.
Note that a software compromise could still read memory. That's one reason why it's necessary to fully attest a system before provisioning it with any keys or passwords.
Here's a CanSecWest talk with more details: http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.p...
Several physical attack vectors can modify the contents of memory, thus compromise the software stack and divulge keys kept in registers or cache.
Our approach at PrivateCore is to fully encrypt main memory with an authenticated cipher mode and keep the software stack pinned in cache. An attacker able to physically modify memory can only conduct a DoS attack by inserting junk data.
But at least on Macs, the attack is somewhat mitigated by the OS shutting off thunderbolt/firewire DMA if the screen is locked.
On Linux, libgcrypt can do encrypted malloc, which might also help.
[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa38...
Are they "safe enough"? Maybe, it depends entirely on your use case.
"UC Berkeley scientists have developed a system to capture visual activity in human brains and reconstruct it as digital video clips..."
http://gizmodo.com/5843117/scientists-reconstruct-video-clip...
https://www.usenix.org/conference/usenixsecurity12/technical...
Second, I am not sure I understand the judge decision. If the man truly forgot it, or lets say the files on USB got corrupted (can happen) and the password he is giving out does not work, then how can you continue to jail him (for that reason)? Is this something specific to UK, or are similar US cases out there?
http://en.wikipedia.org/wiki/Key_disclosure_law#United_Kingd...
I think the law is very vague due to the people writing it now knowing much about it. I imagine they have a use case of this guy and want jail for anything other than seeing some incriminating evidence.
I guess it doesn't help that it turned out he did know the password and it had a load of incriminating stuff on.
I have a hard time understanding why such a skill is so rare. It seems sort of useful.
Note that this doesn't work if the entire memory is encrypted, but I can't imagine how a computer could function with the whole RAM encrypted.
Yes, I realize this would still be susceptible to coercion of the humans involved, and other issues, but it could be a building block of some degree of NSA-proofing.
I'm still not sure how my motherboard detects if my case is open...
Full disk encryption TrueCrypt/BitLocker/FileVault can act as countermeasures[2] and modern versions of OSX don't allow DMA from the login screen anymore.
[1] http://www.breaknenter.org/2012/02/adventures-with-daisy-in-...
[2] http://www.researchgate.net/publication/49277520_Cold_Boot_M...
I guess the number one thing is to prevent physical access, and failing that, make an attack that targets RAM take longer.
A simple defense would be to access all such material through a permutation table. (Which need not be explicitly stored in memory, but could be computed by means of multiplication modulo a prime.)
Can somebody with more expertise comment on this? I was under the impression that virtualization software (Xen etc) was deemed safe?
(all this in context of the statement that "if you are serious about security, use dedicated hardware")
1. Store password in a function and return the password. 2. Whenever the password is needed call the function.
Example in JS.
function getPassword(){ return 'I am a password'; }
if(req.data.password == getPassword()){ passwordIsCorrect(); }else{ passwordIsNotCorrect(); }
This is not for sure. Core dump and debug dump usually dumps variables, but not the source code of program.
In an interpreted language, the interpreter would create some kind of string object containing the contents of the password in memory, and getPassword() would return that object when called.
And even with all that I probably screwed something up, but that advice is still better than storing plain passwords.
Ruby, Python, RingoJS, NodeJS, PHP, etc? Don't think they have fancy function to determine to store the variables in CPU register or encrypted memory?
I got the feeling that all these should have being taken care of on the hardware level, but someone just got too lazy during the design process and forgot to patch up the security flaw.
Kinda like how everyone was still using telnet to get into their *nix servers in the 90's.
The way it generally works is you keep a user's encrypted pass with a unique per-user salt stored on disk (usually in a database of some sort). When you need to authenticate a user, your script will ask the user for their password. Then, you encrypt this input pass with the stored salt. Finally, you compare the encrypted input pass with the original encrypted pass on disk. If they match, you're good. At no point do you store passwords on disk that have not been encrypted (via bcrypt or similar). Depending on the security needed (i.e. your threat model and risk) this can get tricky if things like hibernation or virtual machines are involved.
If you're confused at all about this, I would browse the security forums (http://security.stackexchange.com/) and ask for expert advice.
You shouldn't need to store passwords (or any sensitive info) in memory. In fact, you shouldn't store passwords at all. Normally, you would put the password in memory temporarily (for hashing or something), and then you would securely wipe it when you are done.
Failure to wipe memory (or use it improperly) can have awful consequences. IIRC, that was how the Target hack worked. Basically, the attackers were able to search through memory and dump credentials.
You should use wrappers for trusted/vetted libraries (like Crypto++ or something). I know for a fact that Crypto++ has a concept of "secure buffers", whose contents are securely erased before destruction. All libraries of that sort should wipe any sensitive information from memory (by overwriting it with garbage or zeroes) before freeing it.
That particular library probably does not have wrappers for other languages. However, GnuTLS and OpenSSL probably do.
that more diverse the people are the more perspective we can look at a problem:
collective indulgence >= individual common sense
Thanks HN