$ apt-get install cryptmount cryptsetup
Insert the usb drive and check with lsblk
the device path, here I assume that is /dev/sdd
.
$ cryptsetup luksFormat /dev/sdd1
WARNING!
========
This will overwrite data on /dev/sdd1 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
$ cryptsetup luksOpen /dev/sdd1 crypt
Enter passphrase for /dev/sdd1:
$ mkfs -t ext2 /dev/mapper/crypt
$ cryptsetup luksClose crypt
$ cryptsetup luksOpen /dev/sdd1 crypt
Enter passphrase for /dev/sdd1:
$ mkdir USB
$ mount -t auto /dev/mapper/crypt USB
$ umount USB
$ cryptsetup luksClose crypt