Block encryption

Various Linux Stuff
Post Reply
thockman
Site Admin
Posts: 104
Joined: Thu Dec 15, 2005 5:51 pm
Location: Kansas City
Contact:

Block encryption

Post by thockman » Tue Apr 26, 2011 1:46 pm

Testing encryption:

Start with block device. I will be using /dev/sdc
create partition however needed.

Use dd to fill with random data.
Higher randomization but slower.

Code: Select all

dd if=/dev/urandom of=/dev/sdc1
Good randomization and faster.

Code: Select all

badblocks -c 10240 -s -w -t random -v /dev/sdc1
Format device

Code: Select all

cryptsetup luksFormat /dev/sdc1 
Verify and Summary if wanted.

Code: Select all

cryptsetup isLuks /dev/sdb1 && echo Success

Code: Select all

cryptsetup luksDump /dev/sdb1
Create map for decrypted data
Use below to get and use UUID so if name changes no worries

Code: Select all

cryptsetup luksUUID /dev/sdb1
Create map

Code: Select all

cryptsetup luksOpen  /dev/sdb1 luks-uuid 
Create FS

Code: Select all

mkfs.ext3 /dev/mapper/luks-uuid
Mount

Code: Select all

mount /dev/mapper/luks-uuid /mntpoint
Add the mapping information to /etc/crypttab

Code: Select all

luks-uuid uuid
Add to fstab

Code: Select all

/dev/mapper/luks-uuid /mntpoint ext3 defaults 0 0

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests