You are not logged in.

#1 2009-02-25 17:04:43

T0MAS
Member
Registered: 2007-02-22
Posts: 12

Did I set my enryption right?

Hi,
I'm trying to setup encryption on one of my partitions. Here's what I did.

modprobe dm-crypt
modprobe aes-i586
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda4
cryptsetup luksOpen /dev/sda4 private
mkfs.ext4 /dev/mapper/private
mount -t ext4 /dev/mapper/private /home/archie/private

Then to mount after restart I do:

cryptsetup luksOpen /dev/sda4 private
mount -t ext4 /dev/mapper/private /home/archie/private

Is my /dev/sda4 safe?

Cheers,
Tomas

Offline

#2 2009-02-25 19:03:51

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Did I set my enryption right?

Yes that's safe (as long as you don't give your passphrase away)

Note that you don't need to manually mount/umount every time. put it in fstab and put the encrypt hook in mkinitcpio.conf (it handles the cryptsetup luksOpen part)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#3 2009-02-25 22:22:41

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Did I set my enryption right?

Sure, if you encrypted your /var/tmp, /tmp, and swap (in order of least to most important) too smile Otherwise, the second your key or some files from the encrypted part that you read in are either swapped out or placed in a temp directory, *boom* they've been written unencrypted and can be recovered by a dedicated individual. If you're willing to go through the trouble of encrypting a partition, it's IMO mandatory to do those other parts too.

Remember, /var/tmp needs to be persistent (it's used for temp files that can't be deleted after a shutdown), but /tmp doesn't (an idea is to mount it as a tmpfs, basically a ramdisk that can use RAM or swap, that'd be secure as long as swap is encrypted), so another idea is to encrypt both /tmp and swap with random keys on every boot (I think the Wiki says how to do this) - that's even more secure.

For an example on how easy it would be to get something written to a temp directory, say you make an ISO from files on the encrypted partition. AFAIK every big ISO-maker stores the temporary files in /tmp (I'm pretty sure the standard CLI tool does at least).

Offline

#4 2009-02-26 09:21:29

T0MAS
Member
Registered: 2007-02-22
Posts: 12

Re: Did I set my enryption right?

Thanks for your responses, I'll look into encrypting swap and tmp

Regards,
Tomas

Offline

#5 2009-02-26 09:33:58

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Did I set my enryption right?

Dieter@be wrote:

Yes that's safe (as long as you don't give your passphrase away)

Note that you don't need to manually mount/umount every time. put it in fstab and put the encrypt hook in mkinitcpio.conf (it handles the cryptsetup luksOpen part)

I thought that encrypt hook in mkinitcpio is when you have encrypted root (/), since that needs to be decrypted before mounting root (/). For the other encrypted partitions, you could/should? use /etc/crypttab (utilized by initscripts).

Offline

#6 2009-02-26 10:36:06

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: Did I set my enryption right?

Dieter@be wrote:

Note that you don't need to manually mount/umount every time. put it in fstab and put the encrypt hook in mkinitcpio.conf (it handles the cryptsetup luksOpen part)

false
mkinitcpio.conf is for initrd only so only if you have / encrypted
for /etc/fstab mouting is responsible /etc/rc.sysinit
for /etc/crypttab as well


Zygfryd Homonto

Offline

#7 2009-02-26 12:20:17

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Did I set my enryption right?

bender02 wrote:
Dieter@be wrote:

Yes that's safe (as long as you don't give your passphrase away)

Note that you don't need to manually mount/umount every time. put it in fstab and put the encrypt hook in mkinitcpio.conf (it handles the cryptsetup luksOpen part)

I thought that encrypt hook in mkinitcpio is when you have encrypted root (/), since that needs to be decrypted before mounting root (/). For the other encrypted partitions, you could/should? use /etc/crypttab (utilized by initscripts).

Right.
My mistake.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

Board footer

Powered by FluxBB