Slashdot Mirror


Passwords Can Sit on Hard Disks for Years

CygnusXII writes ""As people spend more time on the web and hackers become more sophisticated, the dangers of storing personal information on computers are growing by the day, security experts say. There are some obvious safeguards, such as never allowing your computer to store your passwords. But even that is no guarantee of security." "

32 of 449 comments (clear)

  1. Zero the data by Lord+Grey · · Score: 5, Informative
    One way to achieve this is for all data in RAM to be automatically turned into a string of zeros once it is finished with - something he [Tal Garfinkel] says could be done with just a few extra lines of code in application programs.
    My company worked on a project a few years ago that required this very thing. It wasn't just passwords, though: The customer demanded that all data passing through the applications be wiped as soon as possible.

    The project was written in C++. We started out using a custom string class that performed its own memory management (with zeroing the buffer on deallocation), but then promptly ran into problems with the STL. We wound up writing a memory allocator that also cleans up after itself. Those two solutions took care of the vast majority of the data leakage "problem" -- the only thing left was reinitializing stack variables within functions.

    Perhaps the ultimate solution would be to encrypt data as it is entered, before it is saved into RAM, and arrange for programs that use it to decrypt it first.
    The same customer actually requested this first. The problems associated with it were were terrible, especially in a multithreaded application. Plus, performance basically sucked. Wiping the data afterwards seemed to have the same end result, the performance was still good, and the customer was happy.

    BTW, the memory allocator and string class both made their way into the company's downloadable core library (MIT license).

    --
    // Beyond Here Lie Dragons
    1. Re:Zero the data by Lord+Grey · · Score: 5, Informative
      Can you really be sure that the data is wiped? What if the memory is swapped to a page file or swap partition, later swapped back into memory and then you only erase what's in the RAM?

      You can either lock the RAM page so it doesn't swap, or force the page to write back out to swap after zeroing. The former is far easier (unless you want to do a lot of painful coding) and, if I remember correctly, was what was done with the project I talked about. I don't think the page locking/unlocking made it into the downloadable library, though.

      --
      // Beyond Here Lie Dragons
  2. Mac OS X and Pastor by andy55 · · Score: 4, Informative

    Ah, funny this story was posted--I just had to address this issue the other day. I run Mac OS X and I happened to be doing a fresh install, moving all my data over from an old HD. Before this, I had always stored my slew of account info in a text file in an obscure and unlabeled file (I know, I know--very careless of me--that's way I was ready to change my ways!).

    Mac OS X's built-in "Keychain" services/util isn't streamlined for repeated user use, not to mention it doesn't have several auxiliary/free-form fields (that are also fully encrypted with the password field). After some research and trying a few of the freeware and shareware apps out there, I came across Pastor, a freeware, super-lightweight and user-friendly app that basically lets you maintain a catalog of username, pass, and about 6 auxiliary fields, stored in an encrypted file (when you go to open a file, it prompts you for the password and decodes it on the fly). If for some reason you don't dig this particular app, there's a couple others like it as well with increasingly levels of features (I happen to prefer lightweight).

    So I went w/ this model and it's had great payoffs--when I need a particular login, I click on an alias to my main password (Pastor) file, enter the file's password to decrypt it, look for what I need (it alphabetizes), and I'm all set--meanwhile, there's absolutely no risk of security--I love it.

    1. Re:Mac OS X and Pastor by davesag · · Score: 2, Informative
      I use the keychain and keychain access software daily and it's fine. Not fantastic granted - but fine. I have a keychain in my Documents folder on my iDisk called 'personal' and my keychain access knows to lookup keys from that chain. so home and work common passwords etc can all stay there.

      i have a mail certificate (free from thawte - neat) and have installed gpg so have a number of high grade gpg keys which i use to correspond with my ol' dad back home about bank statements etc.

      you say that the keychain gets in the way, but the fact that is is fully integrated into so many handy apps like sshAgent or MacSFTP or BBEdit, as well as the obvious ones like safari for web passwords etc. if you look in the keychain access program you'll see you can add secure notes, secure comments to passwords and all manner of options. you can open up the system keychains too and see the x509 certs you have collected.

      you could also create an encrypted user whose user space is fully encrypted.

      i have never seen the need for much more

      --
      I used to have a better sig than this, but I got tired of it
  3. Repairs by pubjames · · Score: 5, Informative


    One thing that worries me is sending machines away to get repaired.

    I have a Sony Vaio laptop which I had to send to be repaired. I phoned the support number to tell them I was going to take the hard disc out before sending it. They said that if I did I would be charged for a new hard disc (at a hugely inflated price) and they wouldn't repair it without one.

    I once sent a PC for repair and the teenage dork who repaired it actually said I had some great games on my machine and that he had played them. In another case in the UK, some padeophile was caught (was it Garry Glitter?) when he sent his PC in for repair. Now, I'm all for catching kiddie fiddlers, but that is not the way to do it.

    I don't want the repair staff looking through the stuff on my hard disc. There should be a standard industry guarantee that this won't happen, or a privacy law about it or something.

    1. Re:Repairs by Anonymous Coward · · Score: 1, Informative

      It's offtopic, so I'll post anon, but yes, it was Garry Glitter.

  4. Encrypt your disk by PSUspud · · Score: 5, Informative

    When I read the headline, I was alarmed. But
    then I read the article, and all my worries went away.
    I encrypt my swap partition, and that fixes the problem.

    It's not hard, and since it's swap (i.e., data
    you don't need for very long), you don't even need
    to remember a password (your computer uses a random
    one every time is sets up the swap). Really, it's
    pretty easy -- see the HOWTO at http://www.tldp.org/HOWTO/Disk-Encryption-HOWTO/
    and keep your goatsex links and pictures confidential.

    --
    ----- Why sig when you can sign? PGP key id 7675D05E
  5. Re:Just plain wrong by flipdaddy · · Score: 2, Informative

    Yep. From MSDN: "The VirtualLock function enables a process to lock one or more pages of committed memory into physical memory (RAM), preventing the system from swapping the pages out to the paging file"

  6. Cleaning hard disks of passwords etc by Zog+The+Undeniable · · Score: 2, Informative
    1) Set the pagefile to be automatically wiped on shutdown. Windows will do this for you.

    2) To delete things properly, turn off paging and disk caching, reboot, then run something like Mutilate to fill all the unused disk space with rubbish. Remember to turn paging and caching back on afterwards or performance will be slooooow.

    3) If you're disposing of a PC and you want to sell it with the HDD, it's usually easiest to reformat the HDD in another PC (as a slave) then run a file wiper as above.

    4) Running a good file wiper once is perfectly adequate. Physical data recovery techniques using misaligned drive heads to pick up "ghost" images may or may not exist (hence the occasional recommendation to wipe 9 times) but the cost of doing so is so high that it would have to be a matter of national security. Commercial data recovery/forensic services do NOT use physical recovery techniques, they just go for deleted files and slack space.

    --
    When I am king, you will be first against the wall.
    1. Re:Cleaning hard disks of passwords etc by jim_deane · · Score: 2, Informative

      When I had a disc that was failing under warranty, I used a bootable hard disk wiping utility as the final step before sending the drive back.

      Autoclave is the one I used. It is quite nice, fits on a bootable floppy. I felt better sending my drive in for warranty replacement after using this program.

      Also see:
      UBCSwipe
      Darik's Boot and Nuke

      Jim

    2. Re:Cleaning hard disks of passwords etc by evilviper · · Score: 3, Informative
      2) To delete things properly, turn off paging and disk caching, reboot,

      And unless you have massive ammounts of RAM, your system will refuse to do anything...

      I turned off the swaping on a Windows 2000 system that had 256MB of RAM, and rebooted, only to find that I couldn't do anything at all. The system started-up, but no programs could be opened. I could even get to the command-prompt, or the control panel to turn the page-file back on. Result, one completely destroyed and unsavable Windows system.

      Don't recomend doing things that you've never done yourself and/or don't know enough of the details about how it works...
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  7. Re:Hehe by Jokkey · · Score: 5, Informative

    The article does go into a bit more detail than that... They use a program called TaintBochs (probably hacked from the open source emulater Bochs) to track sensitive data and find out where exactly it goes and how long it's there. This sounds to me like a nifty hack, and they're actually doing research to come up with quantitative results on how long data sticks around, instead of just saying, "Um, yeah, stuff gets swapped out."

  8. Rubbish! by arvindn · · Score: 4, Informative
    Article says:

    Operating systems such as Windows and Linux have no facility for stopping data being written to the hard drive.

    That's a flat out lie.

    $ man mlock

    MLOCK(2) Linux Programmer's Manual MLOCK(2)

    NAME

    mlock - disable paging for some parts of memory

    SYNOPSIS

    #include

    int mlock(const void *addr, size_t len);

    DESCRIPTION

    mlock disables paging for the memory in the range starting at addr with length len bytes.

    OpenSSH uses paging protection. It also zeroes out the password in memory. Immediately upon hashing it. I've seen the code.

    Authors are at Stanford? Paper at USENIX? Can't believe this shit.

    1. Re:Rubbish! by evilviper · · Score: 4, Informative
      Operating systems such as Windows and Linux have no facility for stopping data being written to the hard drive.

      That's a flat out lie.

      $ man mlock

      And if I remember correctly, you need root access to use mlock(). Now then, how do you feel about running Mozilla/Firefox as root? Mozilla and any other applications you might possibly type a password into... GPG has the same issue: http://www.gnupg.org/documentation/faqs.html#q6.1



      Meanwhile, for quite some time, OpenBSD has had the "swapencrypt" sysctl option, which causes everything swapped to disk to be encrypted with a random key that is stored only temporarily in RAM, never on disk... thereby taking away any possibility of getting usable data out of the swap partition.

      For more info: click here.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  9. OpenBSD encrypted swap by nsayer · · Score: 2, Informative

    The problem of swap containing sensitive data from running programs was addressed some time ago by OpenBSD. They generate a random key at boot time and use it to encrypt reads and writes to swap. By definition, you are not interested in the contents of swap the next time you boot up, so you can start with a brand new key. Not only is swap space secure against fishing expeditions like in TFA, but it's also secure against someone getting read privileges on the raw disk (unless they also get permissions on kernel memory and can go look up the key).

    Too bad more systems don't embrace the idea.

  10. Re:OpenBSD by Big+Jason · · Score: 3, Informative

    Umm, no.

    vm.swapencrypt.enable is set to 0 (zero) by default, take a look at your /etc/sysctl.conf

  11. Re:KeePass for Windows by cuzality · · Score: 2, Informative

    Funny... gator...

    Here's another excellent password utility, from Bruce Schneier called Password Safe, which stores the passwords in a file and uses Blowfish to encrypt it. Very lightweight (requires only the executable -- no installation) but has the features everybody needs.

  12. Re:Hehe by operagost · · Score: 5, Informative
    Too bad he didn't discover the setting in Windows XP that clears the pagefile on shutdown. Instead, he plays programmer and suggests that only a few measly lines of code will fix the problem; and no one will mind the huge performance hit because computers are so fast already.

    Even if you aren't running Windows, other OSes like OS/2 will recreate a fresh pagefile on every boot.

    --

    Gamingmuseum.com: Give your 3D accelerator a rest.
  13. Encrypted Swap by Anonymous Coward · · Score: 1, Informative

    The problem of password retention on swap partitions has been known for years. OpenBSD, for example, automatically encrypts the swap partition with rotating keys so that information becomes automatically when it gets stale, i.e. even before reboot. There is a paper on this called Encrypting Virtual Memory. Makes for an interesting read.

  14. I might add a few more by Anonymous Coward · · Score: 1, Informative

    for windows users, specifically:

    1) Install Mozilla and use that as your default browser. IE is a huge security hole, and should only be used for windows update.

    2) Don't download those free screensavers, or other neat little toys, that you find all over the web. You really don't need them, and most of them come with adware, spyware, or worse. If you must download free stuff, take extra steps to learn what they come with, such as reading the EULA and user feedback. If you have no means of finding this out, then just say "no."

    3) Don't install browser toolbars. Install as few browser plugins as possible, and try to keep them to the list of generally trusted plugins (shock, flash, quicktime, java).

    4) Don't click on banner ads, pop up ads, or anything that says you have won something or can get something for free.

    5) Delete spam and do not respond to it (don't bother to unsubscribe). :)

  15. mlock by 42forty-two42 · · Score: 2, Informative
    Operating systems such as Windows and Linux have no facility for stopping data being written to the hard drive. So Garfinkel reckons the best strategy is to ensure that data is kept on RAM for the shortest possible time.
    NAME
    mlock - disable paging for some parts of memory

    SYNOPSIS
    #include <sys/mman.h>

    int mlock(const void *addr, size_t len);

    DESCRIPTION
    mlock disables paging for the memory in the range starting at addr with
    length len bytes. All pages which contain a part of the specified mem-
    ory range are guaranteed be resident in RAM when the mlock system call
    returns successfully and they are guaranteed to stay in RAM until the
    pages are unlocked by munlock or munlockall[...]
    Sheesh, whatever happened to checking one's facts?
  16. Re:No Guarantee of Security?!?! by Lehk228 · · Score: 4, Informative

    Knoppix doesn't touch the hard drive at all, that is the whole point of a live CD, so no it doesn't use any swap

    --
    Snowden and Manning are heroes.
  17. Re:No Guarantee of Security?!?! by harrkev · · Score: 4, Informative

    Actually, you only need to overwrite once to make it invisible to the computer over the IDE cable.

    There ARE methods to get data off of a hard drive platter that has been overwritten only once, but this requires the hard drive to be removed from the computer and physicly disassembled, and is quite expensive.

    --
    "-1 Troll" is the apparently the same as "-1 I disagree with you."
  18. you want somebodies password? by Anonymous Coward · · Score: 1, Informative

    look in their bash (or tcsh or whatever their fav flavor is) history.

    Seriously. Have you ever accidentally typed your password instead of your username? Grep your history for your password and see what you find.

  19. Microsoft Engineer? RTFM by jwgoerlich · · Score: 2, Informative

    "Operating systems such as Windows and Linux have no facility for stopping data being written to the hard drive."

    Incorrect. Set the page file to 0 and watch Win2000/03 run dog slow. Or, configure Win2000/03 to erase its page file when the computer shuts down.

    http://msdn.microsoft.com/library/default.asp?url= /library/en-us/gp/567.asp

    Is this new news? Maybe to some. However, the problem with many of these new Microsoft engineers is that they do not read the manual or pay attention during the MCSE courses.

    My two cents (and yes, I am an MCSE).

  20. Secure Programming by solodex2151 · · Score: 2, Informative

    Whenever I am programming an encryption program or something that needs to be secure, I use a bit eraser algorithm that is modeled after one presented in th book "Secure Programming in C and C++" (very good book btw. Very Practical) I am surprised no one has written open source for a cron job that does the same thing.

  21. Re:Protective measures by evilviper · · Score: 4, Informative
    4. Only use credit cards that keep you free of liability for any fraud.

    Despite the FUD TV ads the credit-card companies want you to believe, THERE ARE NO OTHER KINDS OF CREDIT CARDS IN THE USA. It is federal law that you cannot be held liable for unauthorized charges on your credit card. Actually, I believe you may be required to pay up to $50, but that is really a trivial ammount.

    So, don't believe the hype.
    --
    Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  22. libsd might help you (secure delete for ALL apps) by flok · · Score: 2, Informative

    Altough this might sound like an ad (it is not - it is not commercial) one might take a look at 'libsd': libsd makes ALL applications on your system do a secure delete without changing a single line of code.
    It does this by intercepting calls like 'unlink' (delete files) and 'truncate': before deleting or truncating a file, the previous contents is first overwritten with garbage which is forced to disk.
    So if you use this library and you delete a file with a password in it, that password should not be recoverable (altough it might still reside in your swappartition...).

    --

    www.vanheusden.com - home of Multitail, HTTPing, CoffeeSaint, EntropyBroker, rsstail, bsod, listener, nagcon, nagi
  23. Re:No Guarantee of Security?!?! by fubar1971 · · Score: 2, Informative

    ....so no it doesn't use any swap

    It does if you don't have the minimum memory requirements.

    From the knoppix website

    "20 MB of RAM for text mode, at least 96 MB for graphics mode with KDE (at least 128 MB of RAM is recommended to use the various office products),_"

    Not to mention, you can still mount your local drive and store data on it.

    hmm seems like a whole lot of touching going on....

  24. Re:No Guarantee of Security?!?! by Cyberop5 · · Score: 2, Informative

    Knoppix will use linux swap space if there is any on the hard drive. You'd use the noswap tag when booting for forensics or more paranoid computing.

    --
    Urgo: "I want to live. I want to experience the universe and I want to eat pie!"
    Jack: "Who doesn't??"
  25. Encrypt the swap by mi · · Score: 2, Informative
    OpenBSD can encrypt the swap. FreeBSD, -- in even more generic way -- can encrypt any partition -- including, what you'll then use for swap.

    For everything else, there is KWallet.

    --
    In Soviet Washington the swamp drains you.
  26. Re:Hehe by lone_marauder · · Score: 3, Informative

    IOW, tho the security issue exists, it's not exactly something to lose sleep over -- because if someone wants to compromise your security, why not get current data right from today's data input, instead of possibly-obsolete data of unknown relevance!

    Because that Asian rape spam that popped up into your preview pane 2 years ago may not be a daily occurence. The FBI loves pulling up ancient JPG fragments from swap in their ongoing efforts to protect children.

    Despite what you may have heard, the legality of pornography is of no relevance to prosecutors and judges; the first time the question of age comes up with regard to the subject of any particular photograph is when the jury is looking at poster size blowups of whatever they scraped off your hard drive.

    To prevent fascism (or at least thwart it), do the following. Set the not-commonly-known "clear swapfile at shutdown" windows registry key:
    HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown to 1
    Wipe your empty space and slack space regularly with something like eraser. (Interestingly, I don't know of a way to accomplish these things when using Linux as a desktop OS. If anyone knows of a way to clear the swap partition on shutdown or to clear not only free space on the hard drive, but also cluster tips (file slack), please let me know.) When finished using a hard drive, or any time you have cause to format it, boot up to rescue mode from any Linux distro's boot CD and dd if=/dev/zero of=/dev/hda (or whatever device your hard drive happens to be).

    I have had access to the tools the bad guys (FBI, et. al.) use to extract evidence from your hard drive, and have seen that these procedures work brilliantly. Of course, I've also seen prosecutors derive character witness testimony from the very fact of using a program like eraser (only bad guys know this much about how to hide computer evidence!), so YMMV.

    If you don't happen to live in the United States, treasure your freedom and fight to protect it.

    --
    who are those slashdot people? they swept over like Mongol-Tartars.