Skip to content

Instantly share code, notes, and snippets.

View elquimista's full-sized avatar
🏠
WFH

elquimista elquimista

🏠
WFH
  • Houston, TX
View GitHub Profile
@elquimista
elquimista / yubikey-reset.sh
Created March 12, 2019 00:44 — forked from pkirkovsky/yubikey-reset.sh
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@elquimista
elquimista / gpg2qrcode.sh
Last active January 17, 2024 16:44 — forked from joostrijneveld/gpg2qrcodes.sh
Produce printable QR codes for persistent, tangible storage of GPG private keys and vice versa.
# Depends on:
# paperkey (jabberwocky.com/software/paperkey/)
# libqrencode (fukuchi.org/works/qrencode/)
# Producing the QR codes:
# Split into 16 codes to ensure the data per image is not too large.
# Or split into 3 codes for smaller keys (e.g., ed25519)
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
if [ "$(uname)" == "Darwin" ]; then
split -n 16 temp IMG