From f2dccd3001e9c433e468b0ae6da1d0c312383169 Mon Sep 17 00:00:00 2001 From: mikail Date: Sun, 11 Jan 2026 19:36:28 +0100 Subject: [PATCH 1/2] Add scripts to generate txt and html templates --- templates/passphrase.html | 417 ++++------------------------------- templates/passphrase.html.sh | 164 ++++++++++++++ templates/passphrase.txt | 20 +- templates/passphrase.txt.sh | 55 +++++ 4 files changed, 275 insertions(+), 381 deletions(-) create mode 100755 templates/passphrase.html.sh create mode 100755 templates/passphrase.txt.sh diff --git a/templates/passphrase.html b/templates/passphrase.html index 2721110..0ee46f5 100644 --- a/templates/passphrase.html +++ b/templates/passphrase.html @@ -1,14 +1,14 @@ + - - + credentials - + - + @@ -45,316 +47,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -393,8 +97,7 @@ - - + @@ -433,8 +136,7 @@ - - + @@ -473,8 +175,7 @@ - - + @@ -513,8 +214,7 @@ - - + @@ -553,8 +253,7 @@ - - + @@ -593,8 +292,7 @@ - - + @@ -633,8 +331,7 @@ - - + @@ -673,8 +370,7 @@ - - + @@ -713,8 +409,7 @@ - - + @@ -753,8 +448,7 @@ - - + @@ -793,8 +487,7 @@ - - + @@ -833,8 +526,7 @@ - - + @@ -873,8 +565,7 @@ - - + @@ -913,8 +604,7 @@ - - + @@ -953,8 +643,7 @@ - - + @@ -993,8 +682,7 @@ - - + @@ -1033,8 +721,7 @@ - - + @@ -1073,8 +760,7 @@ - - + @@ -1113,8 +799,7 @@ - - + @@ -1153,8 +838,7 @@ - - + @@ -1193,8 +877,7 @@ - - + @@ -1233,8 +916,7 @@ - - + @@ -1273,8 +955,7 @@ - - + @@ -1313,8 +994,7 @@ - - + @@ -1353,8 +1033,7 @@ - - + @@ -1393,8 +1072,7 @@ - - + @@ -1433,8 +1111,7 @@ - - + @@ -1473,8 +1150,7 @@ - - + @@ -1513,8 +1189,7 @@ - - + diff --git a/templates/passphrase.html.sh b/templates/passphrase.html.sh new file mode 100755 index 0000000..45c57ad --- /dev/null +++ b/templates/passphrase.html.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +# USAGE: passphrase.html.sh [ PIN_LENGTH [ PASSPHRASE_LENGTH ]] +# PIN_LENGTH and PASSPHRASE_LENGTH can be omitted. A HTML file will be written to stdout + +set -e +set -u +set -o pipefail + + +# Script arguments, or use defaults +PIN_LENGTH="${1:-8}" +PASSPHRASE_LENGTH="${2:-30}" + +cat < + + + + + + + credentials + + + + +
date (yyyy-mm-dd)user pin
2025-__-__01234567890123456789
2025-__-__ 1234567891012345678910
1234567891012345678910
key id 1234567891012345678910
0x ________ 1234567891012345678910
________ 1234567891012345678910
1234567891012345678910
serial number 1234567891012345678910
__________ 1234567891012345678910
for each char in passphrase, mark corresponding column on sequential row, then fold inward and tamper seal
01234567890123456789
key id01234567890123456789
0x________01234567890123456789
________01234567890123456789
01234567890123456789
serial number01234567890123456789
__________01234567890123456789
for each char in passphrase, mark corresponding column on sequential row, then fold inward and tamper seal
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C9
-
- A B C
+ + + + + + + + + + + + + + +EOF + +DATE_HEADER=$(cat < +$(for((i=0;i<14;i++)); do printf ""; done) + + $(for((i=0;i<8;i++)); do printf ""; done) +$(for((i=0;i<8;i++)); do printf ""; done) +$(for((i=0;i<14;i++)); do printf ""; done) + +$(for((i=0;i<10;i++)); do printf ""; done) +EOF +) + +KEYS=$(cat <$j"; + done && + printf "" + for j in {1..10}; do + printf ""; + done && + printf "\n" +done) +EOF +) + +#Make KEYS have as many lines as DATE_HEADER, and vice versa. Needed to close/open html tags properly +# Note that the row is simply closed without filling it up... +KEYS="$KEYS $(for ((i=PIN_LENGTH; i<8; i++)); do printf '\n' && for _ in {0..23}; do printf ''; done && printf ''; done)" +DATE_HEADER="$DATE_HEADER $(for ((i=8; i' && for _ in {0..13}; do printf ''; done ; done)" + +paste -d " " <(echo "$DATE_HEADER") <(echo "$KEYS") + +cat < + + +EOF + +for ((i=1; i<=PASSPHRASE_LENGTH; i++)); do + +if [ $((i%2)) -eq 0 ]; then + printf ''; +else + printf ''; +fi + +cat <- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF +done + +cat < + + +EOF + + + diff --git a/templates/passphrase.txt b/templates/passphrase.txt index 9df9a7d..16ad745 100644 --- a/templates/passphrase.txt +++ b/templates/passphrase.txt @@ -1,15 +1,15 @@ # https://github.com/drduh/YubiKey-Guide/blob/master/templates/passphrase.txt - DATE (YYYY-MM-DD) ADMIN PIN USER PIN - - 2025-__-__ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - KEY ID 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - 0x________________ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - SERIAL NUMBER 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - ________ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + DATE (YYYY-MM-DD) ADMIN PIN USER PIN + + 2025-__-__ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + KEY ID 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + 0x________________ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + SERIAL NUMBER 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + ________ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 FOR EACH CHAR IN PASSPHRASE, MARK CORRESPONDING COLUMN ON SEQUENTIAL ROW, diff --git a/templates/passphrase.txt.sh b/templates/passphrase.txt.sh new file mode 100755 index 0000000..94883fc --- /dev/null +++ b/templates/passphrase.txt.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# USAGE: passphrase.txt.sh [ PIN_LENGTH [ PASSPHRASE_LENGTH ]] +# PIN_LENGTH and PASSPHRASE_LENGTH can be omitted. A txt file will be written to stdout + +set -e +set -u +set -o pipefail + +# Script arguments, or use defaults +PIN_LENGTH="${1:-8}" +PASSPHRASE_LENGTH="${2:-30}" + +DATE_HEADER=$(cat < Date: Sun, 11 Jan 2026 19:51:17 +0100 Subject: [PATCH 2/2] Fix year in template --- templates/passphrase.html | 2 +- templates/passphrase.html.sh | 2 +- templates/passphrase.txt | 2 +- templates/passphrase.txt.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/passphrase.html b/templates/passphrase.html index 0ee46f5..7dd137c 100644 --- a/templates/passphrase.html +++ b/templates/passphrase.html @@ -47,7 +47,7 @@ - + diff --git a/templates/passphrase.html.sh b/templates/passphrase.html.sh index 45c57ad..59f3ba4 100755 --- a/templates/passphrase.html.sh +++ b/templates/passphrase.html.sh @@ -65,7 +65,7 @@ cat < +$(for((i=0;i<14;i++)); do printf ""; done) $(for((i=0;i<8;i++)); do printf ""; done) diff --git a/templates/passphrase.txt b/templates/passphrase.txt index 16ad745..6b4523e 100644 --- a/templates/passphrase.txt +++ b/templates/passphrase.txt @@ -2,7 +2,7 @@ DATE (YYYY-MM-DD) ADMIN PIN USER PIN - 2025-__-__ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + 202_-__-__ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 KEY ID 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0x________________ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 diff --git a/templates/passphrase.txt.sh b/templates/passphrase.txt.sh index 94883fc..1645527 100755 --- a/templates/passphrase.txt.sh +++ b/templates/passphrase.txt.sh @@ -14,7 +14,7 @@ PASSPHRASE_LENGTH="${2:-30}" DATE_HEADER=$(cat <
date (yyyy-mm-dd)admin pinuser pin
2025-__-__
key id
0x_
_
serial number
_$j
for each char in passphrase, mark corresponding column on sequential row, then fold inward and tamper seal
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
user pin
2025-__-__ 1234567891012345678910
202_-__-__ 1234567891012345678910
1234567891012345678910
key id 1234567891012345678910
0x ________ 1234567891012345678910
2025-__-__
202_-__-__
key id
0x_