A D Vishnu Prasad

Director of Cloud Engineering @ Team8Solutions, Freelancer

Encryption at REST

Already so many people have written about what/why Encryption at REST. So I am just going to help you to setup Encryption at REST in ubuntu using luksFormat. You can read more about the cryptsetup and LuksFormat here

Step 1: Create crypt volume file format

Assuming the device is /dev/xvdc. Please do not forget the passphrase. You will not be able to recover the data if you forget.

1
2
sudo su
cryptsetup -y -v luksFormat /dev/xvdc

Step 2:

1
cryptsetup luksOpen /dev/xvdc edata-epg

Step 3:

1
cryptsetup -v status edata-epg

Step 4:

1
2
apt-get install pv
pv -tpreb /dev/zero | dd of=/dev/mapper/edata-epg bs=128M

Step 5:

1
2
mkfs.ext4 /dev/mapper/edata-epg
mount /dev/mapper/edata-epg /e_data