#!/usr/bin/env sh CIPHER="aes-xts-plain64" KEYSIZ='512' HSHTYP='sha512' ITTIME='5000' USERAN='random' DEVICE="${1}" # WE NEED ROOT PRIVILEGES if [ $EUID -ne 0 ]; then echo "This script must be run as root." exit 1 fi # CONFIRM THE DEVICE echo "You are about to format the following device with LUKS:" echo "" \lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,LABEL,UUID "${DEVICE}" echo "" echo -n "Are you sure [y/N]? " read CONFRM echo "" if [ "${CONFRM,,}" = "y" ]; then echo -n "Fill ${DEVICE} with random data [Y/n]? " read DEVFIL echo "" if [ "${DEVFIL,,}" = "n" ]; then echo "Not filling ${DEVICE} with random data." else echo "Filling ${DEVICE} with random data..." echo "" openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt