diff --git a/bash/rescue-hetzner.sh b/bash/rescue-hetzner.sh index 9637910..81930b4 100644 --- a/bash/rescue-hetzner.sh +++ b/bash/rescue-hetzner.sh @@ -105,19 +105,7 @@ rescue_wipe_0_init_hetzner_8_8() { --uuid "00000000:00000000:00000000:00000001" \ "${members[@]}" # encrypt - echo "${passphrase}" | - cryptsetup \ - --verbose \ - --batch-mode \ - --type "luks2" \ - --pbkdf "argon2id" \ - --cipher "aes-xts-plain64" \ - --iter-time 8192 \ - --key-size 512 \ - --hash "sha512" \ - --use-random \ - luksFormat \ - "/dev/md/crypt" + luks_format "${passphrase}" "/dev/md/crypt" # open echo "${passphrase}" | cryptsetup luksOpen "/dev/md/crypt" "crypt" @@ -132,19 +120,7 @@ rescue_wipe_2_make_hetzner_8_8() { # read passphrase passphrase="$(read_passphrase)" # encrypt - echo "${passphrase}" | - cryptsetup \ - --verbose \ - --batch-mode \ - --type "luks2" \ - --pbkdf "argon2id" \ - --cipher "aes-xts-plain64" \ - --iter-time 8192 \ - --key-size 512 \ - --hash "sha512" \ - --use-random \ - luksFormat \ - "/dev/md/crypt" + luks_format "${passphrase}" "/dev/md/crypt" # open echo "${passphrase}" | cryptsetup luksOpen "/dev/md/crypt" "crypt" diff --git a/bash/rescue-ovh.sh b/bash/rescue-ovh.sh index e15c9d9..ed225d1 100644 --- a/bash/rescue-ovh.sh +++ b/bash/rescue-ovh.sh @@ -38,19 +38,7 @@ rescue_wipe_0_init_ovh_vle2() { # crypt / wipe fs_wipe "${device}1" "1G" 1 # crypt / encrypt - echo "${passphrase}" | - cryptsetup \ - --verbose \ - --batch-mode \ - --type "luks2" \ - --pbkdf "argon2id" \ - --cipher "aes-xts-plain64" \ - --iter-time 4096 \ - --key-size 512 \ - --hash "sha512" \ - --use-random \ - luksFormat \ - "${device}1" + luks_format "${passphrase}" "${device}1" # crypt / open echo "${passphrase}" | cryptsetup luksOpen "${device}1" "crypt" @@ -66,19 +54,7 @@ rescue_wipe_2_make_ovh_vle2() { # read passphrase passphrase="$(read_passphrase)" # crypt / encrypt - echo "${passphrase}" | - cryptsetup \ - --verbose \ - --batch-mode \ - --type "luks2" \ - --pbkdf "argon2id" \ - --cipher "aes-xts-plain64" \ - --iter-time 4096 \ - --key-size 512 \ - --hash "sha512" \ - --use-random \ - luksFormat \ - "${device}1" + luks_format "${passphrase}" "${device}1" # crypt / open echo "${passphrase}" | cryptsetup luksOpen "${device}1" "crypt"