Announcements

Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.
Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.

So you may have noticed the forum software has upgraded !!!
A few things that have changed.
We no longer have community blogs (was never really used)
We no longer have a portal page.
We can discuss this, and decide whether it is needed (It costs money)
See this thread: Here

Linux Disk encryption in 2 easy steps

Recommended Posts

I have written a mini how-to about disk encryption, it's not meant to be in-depth or comprehensive but rather short and to the point, to allow anyone with a minimum of Linux devices knowledge to create encrypted memory sticks, USB disks, or partitions in minutes.

Share on other sites

I use cryptsetup and have my whole hard disk encrypted. About a month or two ago, I then encrypted my USB sticks too and it's really nice because when you plug them in, the system then asks you for the password to gain access. Of course, if you're in X and udev is working, etc. If you're in a console then you'll have to do it manually.

From what I remember, the default encryption is AES so I know when I did it, I didn't specify any additional parameters like the howto, and the end result was the same - same encryption level as this howto.

One other thing, you can add multiple passwords to the USB stick, so that other users can use them if you share them at work - and they can even be used in Windows if you have the relevant app to use it. Another good idea about the password thing is that you can leave an admin password, so that if someone left your company, you'd still have access to the data on the stick/machine if they didn't give you their password.

Share this post

Link to post

Share on other sites

Maybe it would benefit from a mention of the package name on Mandriva for the cryptsetup tool - granted it's pretty obvious and also called "cryptsetup" but it may not be installed on all machines?

I thought about that, but I intentionally wrote it generic for any Linux distro, not specific for Mandriva, that's why I didn't include any reference to packages.

Also as it requires some knowledge of Linux /dev/sdX (or /dev/hdX) device naming, (it assumes the reader is able to figure out what device name is assigned to the device to be encrypted), I assumed that anyone being able to do that, would also know how to install the "cryptsetup" command on their distro of choice, if necessary.

Also s/exsisting/existing/ :)

Fixed, cheers!

Share this post

Link to post

Share on other sites

I then encrypted my USB sticks too and it's really nice because when you plug them in, the system then asks you for the password to gain access. Of course, if you're in X and udev is working, etc. If you're in a console then you'll have to do it manually.

From what I remember, the default encryption is AES so I know when I did it, I didn't specify any additional parameters like the howto, and the end result was the same - same encryption level as this howto.

Interesting, I assume that's on your Ubuntu install? Can you maybe figure out what packages are involved in the prompting of the password under X, as I wonder if that is maybe available in Mandriva too by installing the right packages.

I decided for Twofish instead of AES because Twofish is slightly faster according to all benchmarks I found (and it's a completely free algorithm, unencumbered by patents, while still being at least as good as AES).

BTW, better make sure that your GUI tool uses 'essiv' by default, as without ESSIV your system will be vulnerable to very serious watermark and known plaintext attacks according to: http://www.shimari.com/dm-crypt-on-raid/ (it's mentioned on other sites, too).

One other thing, you can add multiple passwords to the USB stick, so that other users can use them if you share them at work - and they can even be used in Windows if you have the relevant app to use it. Another good idea about the password thing is that you can leave an admin password, so that if someone left your company, you'd still have access to the data on the stick/machine if they didn't give you their password.

Yeah, I know the multiple passwords is a feature of LUKS/dm-crypt, for which "cryptsetup" can act as a front-end.

I assume you refer to this, when you say it can be used in Windws, too:

Share this post

Link to post

Share on other sites

It would be great if Mandriva could integrate this into the 'MCC/Local disks/Manage disk partitions' tool, but until then, the CLI is the only way to do this that I'm aware of.

Actually I found that the 'MCC/Local disks/Manage disk partitions' tool does have an encryption option if you enable the "Toggle expert mode", but at least on my 2008.1 install it uses the older depreciated losetup/cryptoloop method, not the dm-crypt method as described in my how-to.

Also I found out in the meantime that there are really two methods of doing encryption with dm-crypt.

The one I described in my mini how-to which allows only one key, but uses the key directly to encrypt the partition and the LUKS method which creates a header at the beginning of the partition to be encrypted with the key and the encrytion method info in there.

The LUKS method allows multiple keys and easier usage as you don't have to remember the encryption method used (as all that info is stored in the header), the big drawback of the LUKS method is that if the header of the encrypted parttion gets corrupted for some reason you loose the whole content of the encrypted partition while with the plain cryptsetup method described in my mini how-to you only loose the bits of data that got corrupted or damaged.

I might still also write another how-to for the LUKS/dm-crypt method as it has it's uses too.