Initial commit

This commit is contained in:
Sebastian Hugentobler 2018-07-19 12:30:54 +02:00
commit 61dec59f3e
5 changed files with 56 additions and 0 deletions

23
bin/create_codes Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
KEY=$1
OUTPUT=${2:-qr.private.pdf}
SINGLE_SIZE=${3:-1024}
gpg2 --export-secret-key "$KEY" | paperkey --output-type raw | base64 | split -b "$SINGLE_SIZE"
index=1
for i in x*; do
qrencode --8bit --level=M -o "qr.$index.png" < "$i"
let index=index+1
done
montage -title "private key for $KEY" -label "%t" -mode concatenate $(find . -name "qr.*.png" | sort -V) "$OUTPUT"
function finish {
rm -f x*
rm -f qr.*.png
}
trap finish EXIT

7
bin/restore_key Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
set -e
PUB_KEY=$1
INPUT_DIR=${2:-.}
cat "$INPUT_DIR"/*.txt | base64 -D | paperkey --pubring "$PUB_KEY" --input-type raw --output private.key