Let’s Encrypt a USB stick with LUKS!

Encryption is often perceived as being much harder implement than it is. A quick example to prove my point with a USB stick in a linux box.

I insert my USB stick and look at mount -l or cat the etc/mtab file and we see that it is /dev/sda (for this example)

# create a LUKS-formatted password on the USB stick

[you@yourlinuxbox -]# umount /dev/sda

[you@yourlinuxbox -]# cryptsetup --verbose --verify-passphrase luksformat /dev/sda

#answer passphrase questions

[you@yourlinuxbox -]# cryptsetup luksOpen /dev/sda usb # create a new crypt device file

[you@yourlinuxbox -]# mkfs -t ext4 /dev/mapper/usb #create file system (notice mapper)

That’s it! When you put the usb stick in – it will prompt for passphrase!  O

This entry was posted in Cyber Security, Linux Security. Bookmark the permalink.