Tag Archives: security

Online security basics: Clicking & downloading

Screenshot of Security Now video episodeNow our child is using computers and the web more and more, I’ve been thinking a lot about protecting children on the internet. There seems to be an endless list of things you should and shouldn’t do but I was struck by some simple advice in the latest Security Now episode (#507) that provides a lot of protection to start you off.

Regarding clicking links in emails, from 1:39:10 in the show Steve Gibson makes the distinction between mails that you’re expecting and mails that you’re not. In other words:

Don’t click links in emails that you weren’t expecting.

For example…

  • Probably safe: You register on a website and then get a confirmation email from them.
  • Probably safe: Your dad is looking to buy a motorbike and sends you a link to one on eBay.
  • Possible evil trap: An email from PayPal asks you to verify your details. To stay safe, you should go to PayPal’s site directly without clicking the email link.

Steve then goes on to mention another security expert, Brian Krebs, with this piece of advice:

Don’t download something you didn’t go looking for.

Super-sensible advice that actually works offline as well, for example in not signing up to financial offers and deals that you weren’t previously considering. Brian also has more basic rules for online safety that I recommend.

So there you go kids, follow these two rules and you’ll save yourself — and your nervous parents — a lot of trouble:

  1. Don’t click links in emails that you weren’t expecting.
  2. Don’t download something you didn’t go looking for.

How to wipe a hard drive with Linux

An opened hard driveI have an old hard drive I want to throw away but I don’t want any remaining photos, financial documents or other personal data getting in the wrong hands. In other words, I want to completely and securely wipe the drive. With Linux there are several options and after a bit of research, here’s what I consider the best way.

Firstly, programs such as fdisk, cfdisk or GParted are not sufficient to fully erase data—they just edit a drive’s partition table. What we want is something more thorough. The standard way to do this is to overwrite data on a drive with randomly-generated data. There are several command-line programs to do this (see below for a comparison) but I’ve chosen shred. Its default is three passes (overwriting all data three times) which I’m comfortable with, but you can specify more if you like, e.g. -p 10 for 10 passes.

WARNING! You don’t need me to tell you that accidentally erasing the wrong data could cause you big problems. Please be careful and check, then double-check each command and especially drive name before pressing Enter.

Step 1.
Plug in the hard drive and find its name (sdb, sdc, etc.). Use

dmesg

and look for something like sdb: sdb1

Step 2.
Unmount each partition of the drive (sdb1, sdb2, etc.), e.g.

sudo umount /dev/sdb1

Step 3.
Type the following command for writing random data to the drive three times (default). DON’T PRESS ENTER.

sudo shred -f -v /dev/[your drive name]

Step 4.
Double-check that the drive you’ve specified is the correct one to wipe. OK, now you can press Enter.

Programs for deleting data

badblocks

Purpose: “Search a device for bad blocks”

sudo badblocks -w -t random -p 1 -s /dev/sdb

Summary: A single (-p 1) overwrite (-w) with random data (-t random), showing progress (-s).
Time for 6GB: 16 mins 20 secs

dd

Purpose: “Convert and copy a file”
Notes: You can’t see your progress or specify multiple passes.
Got stuck with faulty drive.

sudo dd if=/dev/urandom of=/dev/sdb

Summary: A single overwrite with random data.
Time for 6GB: 1 hr 5 mins

shred

Purpose: “Overwrite a file to hide its contents, and optionally delete it”

sudo shred -f -v -n 1 /dev/sdb

Summary: Force (-f) a single (-n 1) overwrite with random data, showing progress (-v).
Time for 6GB: 10 mins 6 secs

wipe

Purpose: “Securely erase files from magnetic media”
Notes: Not in default Ubuntu (sudo apt-get install wipe). After running this, I had a few errors running the other commands on the same drive.

sudo wipe -kD -i -q -Q 1 /dev/sdb

Summary: A single (-q -Q 1) overwrite with random data, showing progress (-i), keeping the device’s inode intact (-kD).
Time for 6GB: 9 mins 37 secs

Further information

Smashing a hard disk with a hammerWiping the drive as explained above is good enough for most purposes but forensic experts have amazing skills and tools at their disposal. It may theoretically still be possible to access some of your deleted data. The most secure way to prevent people accessing any data left on your drive is physically drilling, crushing and breaking up the drive, then disposing of the parts in various locations. And encrypting the drive in the first place with TrueCrypt, for example, is also a good idea.

Related links

How to install Truecrypt on Fedora

I’ve tried on several versions of Fedora but never really been able to install Truecrypt. Either it’s resulted in lots of errors or I’ve given up after getting tired of fruitless searching and reading.

At last I’ve found a guide that’s not too long and works!

It’s written for Truecrypt 6.2 on Fedora 11 but worked perfectly for me with Truecrypt 6.3a on Fedora 12:

penguinenclave.blogspot.com/2009/07/truecrypt-62-install-guide-for-fedora.html

Of course, it would be best if Truecrypt was available in Linux repositories but from what I understand, the way it’s written makes it very difficult for distros to package and maintain. Even so, the greatness of Truecrypt still makes it worth doing yourself.