Encrypt your /home this Christmas: part one - background

8 December 2007

Laptops can get lost and stolen. Besides the inconvenience and cost of replacing it, there is the potential for your personal data to end up in the hands of an identity thief.

I have not finished everything I need to do so I am taking my new laptop with me over the Christmas holidays. This reminded me that it was about time that I encrypted my /home directory. In this article I will explain how I did it. It took a little trial and error, but the good news it that now I have figured out the theory, the process is surprisingly easy.

Are you using encryption on your laptop? If not, then like me, it is about time you did!

The Plan

  • Firstly, in ths post I will explain the theoretical issues, i.e. the benefits and shortcomings of my approach to encryption.
  • Secondly, we will setup the encrypted partition at a dummy mount point and check that it works.
  • Thirdly, we will copy our files to the encrypted partition, set the encrypted partition to be mounted as /home and then shred the old unencrypted copies of our files.

Remember that improvements will be heartily accepted. In other words, despite the fact that it is the weekend so I haven't shaved today, it will take me quite a while to get the complete Bruce Schneier beard.

Don't rely on Security through Obscurity

Even before encryption, there was a certain amount of pseudo-security in my previously unencrypted setup. If you turn the laptop on, it boots Linux and then asks for a password.

So the thief has to really care enough about my data to get it. Firstly, all the data is stored on a native Linux filesystem that Windows-based cracking tools are unlikely to support. So they have to go and get a Linux-live CD. My subnotebook does not have legacy optical devices so they need an external CD drive too. Lastly, they need enough Linux knowledge to know how to mount my partitions and know the layout of the Linux filesystem, e.g. how to find the Mozilla password file or whatever.

A few years ago, this would have been such an unlikely scenario that one could have argued that it does not warrant any further security. And still today, in all likelihood a thief would just sell it on a soon as possible, statistically, these kind of petty thieves are often trying to feed a drug habit. However, they may sell the laptop on to criminal gangs who launder laptops by installing unauthorised copies of Windows and then selling them on ebay or wherever, these criminals would have no qualms about profiting from your private data.

Add in the fact that over the last year or two, Linux has become the second- most used Desktop operating system, with at least 2-3 Linux users for every Mac user, so it is good to start thinking about locking down our data as familiarity with Linux is becoming exponentially more commonplace.

No place like /home

There are various ways to go. Firstly, there is whole disk encryption. Do the whole lot. At the other end of the scale is making just a filestore for sensitive documents, and manually move documents into there that you want to be secured.

My priority is to protect myself from potential identity theft in the event of having another laptop stolen. So as my first step forward, I have decided to go for an encrypted /home partition. This will help protect my passwords, email and files with little or no discernible effect on performance.

Caveats to this approach

There are a few theoretical shortcomings with this approach. This only works if the thief steals the laptop while turned off. If the laptop is stolen while turned on, then the partition will be mounted, and the encryption itself can be compromised by reading RAM or swap. Even worse, if the swap is not cleared on shutdown, some data may be left there. However, the downside of encrypted swap is that it might break hibernation.

The second shortcoming is that the encryption keys are stored on the same computer as the encrypted data. One way around this would be to put the keys on a USB stick and not have them on the machine itself.

The problem with having the keys on the machine is that (in theory) the thief could take an image of your hard-disk, upload it to a supercomputer and then perform a dictionary based attack, eventually the supercomputer would guess the right password. It is perhaps unlikely that the thief has access to a supercomputer and the required cryptographic skills to pull this off. However, even if he has, then it still may take several weeks or more to break a strong password, by which time I could have changed all my passwords.

Thirdly, encryption is not a magic bullet, for example, this approach does nothing against attack from the network while your computer is on.

In summary, it won't stop the US National Security Agency, but it should foil an identity thief if my laptop is lost or stolen. So even after these caveats, my simple approach is still far superior to doing nothing.

Continue at part two - creating an encrypted partition.

1 yoblin says...

linux is the second most-used operating system? I really don't think so:

http://itmanagement.earthweb.com/article.php/3704431

Posted at 5:48 p.m. on December 10, 2007


2 Zeth says...

Thinking doesn't matter, web hits on a selection of English corporate sites don't matter. A defensible methodology is what matters.

I have posted before about this and will post again so don't want to go through it here. Apple claims to have 22 million users, Linux has ~30-40 million in the English speaking world and Europe (many of which dual boot), plus an unknown number in the developing world (perhaps the same again).

Posted at 7:38 p.m. on December 10, 2007


What do you have to say?

Show Editing Help

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

http://kratosellas.blogspot.com

September 8, 2010
http://kratosellas.blogspot.com ?????????? ?????????
Bremen Travel Snaps

kristengreen

September 8, 2010
Hello,http://www.jumancuso.info - May i sex dating with you?
OOXML Vote Coverage

play solitaire online

September 8, 2010
Thanks for sharing this link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my post if you do! I would ...
Better Python Console 0.2.5

tixartich

September 7, 2010
http://thesecretstofarmville.com - Farmville Cheats
Burning an iso to CD on Windows

kristengreen

September 7, 2010
Hello,http://www.jumancuso.info - May i sex dating with you?
5 Homebrew Python Games

Johnathon Alston

September 7, 2010
hello great forum lots of helpful people just what i need can anybody tell me how they have built there list for people interested in marketing hopefully this is just ...
OOXML Vote Coverage

thrhtrurth

September 7, 2010
epvmqyauvloxitvmszkrv. http://www.acnetreatment2k.com/ - acne treatment npympx
Introducing Soturi - yet another Django blog application

nexium uk

September 7, 2010
Nexium Latest News: Nexium <a target="_blank" class="ext" href=http://mysoccerspace.ning.com/profiles/blogs/generic-nexium-generic-nexium>cheap generic nexium</a> Nexium <a target="_blank" class="ext" href=http://www.wfmtintroductions.com/profiles/blogs/buy-generic-nexium-buy-generic>buy nexium 40mg</a> Nexium <a target="_blank" class="ext" href=http://www.interdojo.com/profiles/blogs/buy-cheap-nexium-buy-cheap>nexium buy cancun</a> Nexium <a target="_blank" class="ext" href=http://www.translatorsgroup.com/profiles/blogs/nexium-generic-buy-nexium>nexium generic ...
SFTP in Python: Paramiko

payclickk

September 7, 2010
?????? ???????? ????????? ??? ???????????: http://pay-click.ru/?ref=3871 - http://pay-click.ru/?ref=3871
SFTP in Python: Really Simple SSH

Erotikalia

September 6, 2010
Ihr habt eine schoene Webseite hier, und vielciht schaut Ihr euch auchmal meine an, ok Sex im Internet ist nicht jedermans Sache, aber eben meine erste Homepage. Danke und macht ...
Introducing Soturi - yet another Django blog application

SonIntuivetut

September 5, 2010
I enjoyed reading your blog. Keep it that way.
The Pirate Bay Trial Begins

hgfllkj

September 4, 2010
?????????? ???? ?????????? ??? ???????????, ???? ?????????? ?????????, ?????????? ???? ??????????, ???? ???? ?????????, ?e?? ??a??????a ?e? ?e?????a???, ???? ?????????? ??? ???????????, ???? ?????????? ??? ???. ???? 24lux.ru
Include ODF support in the Linux Standard Base?

SemeRuppy

September 3, 2010
JACKELINE HERMINE you go, there's an KAREY
PyCon UK 2008 this September

neffeengard

September 3, 2010
LYN NOVELLA learned how to forgive those people and let it go, SHANON
PyCon UK 2008 this September

Essex Web Design

September 3, 2010
A lot of contract providers give you free internet usage now, but if you have Pay As You Go, then you are going to be paying heavy prices.
Calling time on mobile internet nonsense?

Krasochka

September 2, 2010
Hack again?!
Adding more terminals to your function keys

GenryFlorist

September 2, 2010
<b>Cheap flowers delivery around the world!</b> Celebrate summer with our gorgeous flowers. They?re the perfect gift for any summer occasion. From birthdays to anniversaries, we offer beautiful flowers, lush plants, ...
Burning an iso to CD on Windows

auto-financing.co.cc

September 2, 2010
auto-financing
ReStructuredText tables and doctests

rubaxa

September 1, 2010
FTP = NOT RANDOM software Dominated hands postflop suckout often on all-ins. EX. AK vs. A9 or KQ vs. K6. Both players hit top pair. Bad player goes all in ...
Burning an iso to CD on Windows

empodayaddelm

September 1, 2010
Sorry admin - my post is test
This Week: Heroes and Monsters