Skip to content

Instantly share code, notes, and snippets.

@stephen-hill
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephen-hill/6d14e0b4e90c0f9b2435 to your computer and use it in GitHub Desktop.
Save stephen-hill/6d14e0b4e90c0f9b2435 to your computer and use it in GitHub Desktop.
LUKS USB

Install disk encryption support and write random data to your device.

sudo apt-get install cryptsetup
sudo time dd if=/dev/urandom of=/dev/sdX bs=1M

Made sure the dm-crypt kernal module is installed.

sudo modprobe dm_crypt

Now format your device with FAT32 using GParted

Encrypt your dive.

sudo cryptsetup -c aes -s 256 luksFormat /dev/sdb1

Open the container.

sudo cryptsetup luksOpen /dev/sdb1 stephen-usb

Format the container.

sudo mkfs.vfat /dev/mapper/stephen-usb -n “stephen-usb″

Close the container.

sudo cryptsetup luksClose norrs-usb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment