TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Are passwords stored in memory safe?

129 pointsby amalantony06over 11 years ago

10 comments

billyhoffmanover 11 years ago
The raw memory itself isn&#x27;t safe either.<p>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&#x27;t DRAM lose it&#x27;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.<p>Pretty crazy stuff: <a href="https://citp.princeton.edu/research/memory/" rel="nofollow">https:&#x2F;&#x2F;citp.princeton.edu&#x2F;research&#x2F;memory&#x2F;</a><p>update: link to images&#x2F;videos: <a href="https://citp.princeton.edu/research/memory/media/" rel="nofollow">https:&#x2F;&#x2F;citp.princeton.edu&#x2F;research&#x2F;memory&#x2F;media&#x2F;</a>
评论 #7064538 未加载
评论 #7067967 未加载
评论 #7064926 未加载
andyjohnson0over 11 years ago
Windows has a CryptProtectMemory() function [1] that can be used to encrypt in-memory secrets using an OS-allocated session key. As far as I know the key is stored in non-paged memory in kernel memory space.<p>On Linux, libgcrypt can do encrypted malloc, which might also help.<p>[1] <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa380262(v=vs.85).aspx" rel="nofollow">http:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;aa38...</a>
评论 #7067671 未加载
consultutahover 11 years ago
Are passwords stored in ____________ safe? No. Next question. ;)<p>Are they &quot;safe enough&quot;? Maybe, it depends entirely on your use case.
评论 #7063766 未加载
评论 #7068156 未加载
coldcodeover 11 years ago
So given the stories about the Target hack, which mentions &quot;memory scrapers&quot;, how can this be done on an entire network of (Windows in this case, no idea what version) systems? I assume you would have to have discovered an escalation attack that gave you sufficient privileges to read another processes&#x27; memory. But even given that, how do you find what bytes are useful to scrape?
评论 #7064806 未加载
评论 #7064291 未加载
pixelcloudover 11 years ago
I would say no.<p><a href="http://en.wikipedia.org/wiki/DMA_attack" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;DMA_attack</a>
评论 #7064210 未加载
评论 #7064214 未加载
stygiansonicover 11 years ago
Would something like TRESOR[1] along with RAM encryption help? Or would this just move the attack target to the CPU itself? (Certainly this would be harder to attack than sticks of DRAM, like was demonstrated by a group a few years ago)<p>I guess the number one thing is to prevent physical access, and failing that, make an attack that targets RAM take longer.<p>1. <a href="http://en.wikipedia.org/wiki/TRESOR" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;TRESOR</a>
zvrbaover 11 years ago
No, and neither are cryptographic keys derived from passwords, and neither are cipher tables derived from cryptographic keys.<p>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.)
ricardobeatover 11 years ago
&gt; virtual machines and cloud computing cannot be ultimately safe<p>Can somebody with more expertise comment on this? I was under the impression that virtualization software (Xen etc) was deemed safe?
评论 #7066891 未加载
评论 #7067428 未加载
zobzuover 11 years ago
don&#x27;t forget mlock().
评论 #7065240 未加载
treenycover 11 years ago
Another recommendation that I learned from an old boss is the following.<p>1. Store password in a function and return the password. 2. Whenever the password is needed call the function.<p>Example in JS.<p>function getPassword(){ return &#x27;I am a password&#x27;; }<p>if(req.data.password == getPassword()){ passwordIsCorrect(); }else{ passwordIsNotCorrect(); }<p>This is not for sure. Core dump and debug dump usually dumps variables, but not the source code of program.
评论 #7065043 未加载
评论 #7064859 未加载
评论 #7111496 未加载