Coldkey – Post-quantum age key generation and paper backup tool
Summary
Coldkey is a command-line tool that generates post-quantum age encryption keys and creates printable HTML backups with QR codes for secure offline storage.
View Cached Full Text
Cached at: 05/15/26, 06:29 AM
pike00/coldkey
Source: https://github.com/pike00/coldkey
coldkey
Your age encryption keys are one disk failure away from total loss. If you use age or sops to encrypt secrets, losing your private key means losing access to everything it protects – forever.
coldkey generates post-quantum (ML-KEM-768 + X25519) age keys and produces single-page printable HTML backups with QR codes. Print it, laminate it, store it in a fireproof safe. Your secrets survive even if every digital copy is gone.

Install
# Homebrew (macOS/Linux)
brew install --cask pike00/tap/coldkey
# Or with Go
go install github.com/pike00/coldkey/cmd/coldkey@latest
Quick start
Docker (recommended)
# Pull the image
docker pull ghcr.io/pike00/coldkey:latest
# Interactive — generate a key and paper backup
just docker-run
# Backup an existing key
just docker-backup ~/.config/sops/age/keys.txt
All just docker-* commands include security hardening flags (network isolation, read-only filesystem, dropped capabilities). Output is written to ./output/.
From source
go install github.com/pike00/coldkey/cmd/coldkey@latest
coldkey generate -o ~/.config/sops/age/keys.txt
Commands
coldkey (no args) — Interactive mode
Presents a menu to generate a new key or create a backup from an existing one. Prompts for file paths and confirms before overwriting.
coldkey generate
Generate a new post-quantum age key pair.
coldkey generate [flags]
-o PATH Key file output path (default: stdout)
-f Overwrite existing file
--no-backup Skip HTML backup generation
coldkey backup
Create a printable HTML paper backup from an existing key file.
coldkey backup [flags] KEYFILE
-o PATH HTML output path (default: KEYFILE-backup.html)
coldkey version
Print the version string.
Security model
| Layer | Measure |
|---|---|
| Memory | mlockall(MCL_CURRENT|MCL_FUTURE) prevents key material from being swapped to disk |
| Files | Written with mode 0600, fsynced; temporaries shredded (3-pass overwrite) |
| Process | Secrets passed via stdin/files only, never in process arguments |
| Container | --network none --read-only --cap-drop ALL --security-opt no-new-privileges:true |
| Image | distroless/static:nonroot — no shell, non-root UID 65534 |
| Memory zeroing | Best-effort secure.Zero() on key buffers before GC (see Limitations) |
Docker flags explained
The just docker-run and just docker-backup commands apply these flags automatically:
| Flag | Purpose |
|---|---|
--network none | No network access — key generation is purely local |
--read-only | Immutable root filesystem |
--cap-drop ALL | Drop all Linux capabilities |
--security-opt no-new-privileges:true | Prevent privilege escalation |
--tmpfs /tmp:rw,noexec,nosuid,size=10m | RAM-backed temp directory |
--cap-add IPC_LOCK | (Optional) Enable mlockall for swap protection |
QR code encoding
PQ age stores only the 32-byte seed (not the expanded ML-KEM-768 private key), so the full keys.txt is typically ~2,089 bytes — fitting in a single QR code (version 40, EC-L supports 2,953 bytes).
If a key file exceeds single-QR capacity, coldkey automatically splits it across multiple QR codes using a simple framing protocol:
COLDKEY:<part>/<total>:<data>
Recovery: scan all QR codes in order, strip the COLDKEY:N/M: prefix from each, concatenate, and verify the SHA-256 checksum.
Paper backup contents
The generated HTML document contains:
- Title and metadata (date, hostname, user, source path)
- Raw key text in monospace (for manual transcription)
- QR code(s) with capacity annotation
- SHA-256 checksum for verification
- Step-by-step recovery instructions
- Print button (hidden in print media)
Recovery procedure
- Scan the QR code (or type the raw key text)
- Save to
~/.config/sops/age/keys.txt - Verify:
sha256sum keys.txtmatches the printed checksum - Test:
sops -d <any .sops file>
Building
just build # Local binary
just docker # Docker image (ghcr.io/pike00/coldkey)
just test # Run tests
just ci # Full CI: vet → test → build → docker
Limitations
- Go GC and secure memory: Go’s garbage collector may copy objects in memory, and Go strings are immutable, meaning key material held as a
string(e.g. fromidentity.String()) cannot be reliably overwritten.secure.Zero()uses Go’s built-inclear()to erase[]bytebuffers, but earlier string copies may persist in the heap until garbage collected.mlockallprevents any of this from being swapped to disk; together these provide defense-in-depth, not a cryptographic guarantee that key material is erased from RAM immediately. mlockallrequiresCAP_IPC_LOCK: Add--cap-add IPC_LOCKto Docker run for full swap protection. Without it, coldkey prints a warning to stderr and continues.- QR scanning: Very dense QR codes (version 40) may be hard to scan from paper. The raw key text is always included as a manual fallback.
License
MIT
Similar Articles
Revisiting PQ WireGuard
This article presents a cryptographic research paper revisiting Post-Quantum WireGuard, exploring methods to secure the WireGuard VPN protocol against future quantum computing threats.
QR code generator
A QR code generator tool with customizable styling options, built with Claude's help. Supports URLs, text, and WiFi network codes.
Unlocking Encrypted ZFS Volumes with a Passkey
The article introduces Revaulter v2, a tool that enables unlocking encrypted ZFS volumes at boot using passkeys (WebAuthn), allowing remote approval via a mobile web interface without storing keys in plaintext.
Cosmic Rays Are Quantum Computers' Kryptonite—Software might just solve the problem
A new study reveals a software strategy to reduce cosmic ray-induced errors in superconducting quantum computers by nearly a half-million-fold, bringing failure rates from every 10 seconds down to less than once per month.
Microsoft BitLocker – YellowKey zero-day exploit
A security researcher released a zero-day exploit called YellowKey that bypasses Microsoft BitLocker encryption on Windows 11 and Windows Server 2022/2025, allowing full access to locked drives using a USB stick; the exploit appears to operate as a backdoor, with files disappearing after use.