Skip to main content

Module qr

Module qr 

Source
Expand description

QR code generation for recovery secrets.

Generates high-entropy recovery secrets and encodes them as QR codes for out-of-band archive unlock. The recovery secret provides an alternative to password-based decryption using HKDF-SHA256 (fast for high-entropy inputs).

§Output Files (private/)

private/
├── recovery-secret.txt   # Human-readable secret with instructions
├── qr-code.png           # QR code image for mobile scanning
└── qr-code.svg           # Vector QR code for print

§Security

  • Recovery secret is 256-bit (32 bytes) for maximum security
  • Encoded as URL-safe base64 without padding
  • Creates a recovery key slot using HKDF-SHA256
  • NEVER deploy private/ directory with public site

Structs§

QrGenerator
QR code generator (legacy struct interface for backward compatibility)
RecoveryArtifacts
Generated recovery artifacts ready for writing to disk.
RecoverySecret
Recovery secret for archive unlock.

Functions§

generate_qr_png
Generate a QR code as PNG bytes.
generate_qr_svg
Generate a QR code as SVG string.