Better Luks Crypto Handling

This commit is contained in:
seiichiro 2021-09-17 16:51:57 +02:00
parent 74980b0504
commit 14726a05a4

View file

@ -126,9 +126,12 @@ fi
sleep 2
if [ $encryption -eq 1 ]; then
echo "Creating Encrypted Root Partition"
cryptsetup luksFormat --type luks1 --cipher aes-xts-plain64 --hash sha512 --key-size 512 "${part_root}"
cryptsetup open "${part_root}" "cryptroot"
cho "Creating Encrypted Root Partition"
read -s -r -p "Please Enter the Encryption Passhprase: " lukspw
read -s -r -p "Please Verify the Encryption Passhprase: " lukspw2
[ "$lukspw" != "$lukspw2" ] && echo "Passphrases don't match!" && exit 1
echo -n "$lukspw" | cryptsetup luksFormat --type luks1 --cipher aes-xts-plain64 --hash sha512 --key-size 512 "${part_root}" -
echo -n "$lukspw" | cryptsetup open --key-file - "${part_root}" "cryptroot"
root_dev="/dev/mapper/cryptroot"
else
root_dev="${part_root}"
@ -229,3 +232,5 @@ arch-chroot /mnt /bin/passwd
echo "Enabling Service"
systemctl enable sshd grub-btrfs.path --root /mnt
echo -e "\n\nInstallation finished, you may further customize it in /mnt or reboot now"