diff --git a/how-to-create-encrypted-paper-backup/qr-backup.sh b/how-to-create-encrypted-paper-backup/qr-backup.sh index b274202..9d488a4 100755 --- a/how-to-create-encrypted-paper-backup/qr-backup.sh +++ b/how-to-create-encrypted-paper-backup/qr-backup.sh @@ -11,10 +11,15 @@ while [[ $# -gt 0 ]]; do "Usage: qr-backup.sh [options]" \ "" \ "Options:" \ - " --bip39 test secret against BIP39 word list" \ - " -h, --help display help for command" + " --create-seed create random 24-word BIP39 seed phrase" \ + " --bip39 test secret against BIP39 word list" \ + " -h, --help display help for command" exit 0 ;; + --create-seed) + create_seed=true + shift + ;; --bip39) bip39=true shift @@ -65,6 +70,13 @@ if ! mount | grep $usb > /dev/null; then sudo mount $dev $usb -o uid=pi,gid=pi fi +if [ "$create_seed" = true ]; then + printf "%s\n" "Creating random 24-word BIP39 seed phrase…" + secret=$(cat "$basedir/bip39.txt" | shuf --head-count 24 --random-source=/dev/urandom --repeat | tr "\n" " ") + echo $secret + sleep 1 +fi + if [ -z "$secret" ]; then tput sc printf "%s\n" "Type secret and press enter" diff --git a/how-to-create-encrypted-paper-backup/qr-backup.sh.sig b/how-to-create-encrypted-paper-backup/qr-backup.sh.sig index acbaf0f..ffdadad 100644 Binary files a/how-to-create-encrypted-paper-backup/qr-backup.sh.sig and b/how-to-create-encrypted-paper-backup/qr-backup.sh.sig differ