Encryption

Encryption in Linux
# install
yum install cryptsetup -y

# encrypt
cryptsetup luksFormat -c aes-xts-plain64 -s 512 -h sha512 /dev/sdb
cryptsetup luksOpen /dev/sdb sdb
mkfs.ext4 /dev/mapper/sdb
mount -t ext4 /dev/mapper/sdb /mnt/sdb

# insert to fstab
echo "/dev/mapper/data /mnt/sdb none luks" >> /etc/crypttab
Encryption in FreeBSD
# create key
dd if=/dev/random of=/root/da0.key bs=64 count=1

# encrypt
geli init -s 4096 -K /root/da0.key -e AES -l 256 /dev/da0

# attach
geli attach -k /root/da0.key /dev/da0

# mount
mount /dev/da0.eli /mnt/da0