简介
利用二维码作为光学信道,在联网与离线设备间双向传输凭证,全程不触网,30秒自动清除。
原始描述
Transfer credentials securely between networked and air-gapped devices using QR codes without exposing passwords or storing data persistently.
中文使用说明 来自收录源
核心用法
QR Password 是一种基于二维码光学信道的凭证跨设备传输方案,专为“气隙隔离”(air-gapped)场景设计,实现双向数据流转:
- Vault → QR(出站):将 JSON 格式的凭证(用户名、密码、域名)编码为二维码图像,通过画布展示给离线设备扫描;展示后 30 秒自动隐藏并删除图像文件。
- Camera → Credential(入站):调用摄像头捕获或接收用户上传的二维码图像,解码后提取凭证信息,随即删除原始图像。
- 离线生成器:提供独立 HTML 文件(
assets/qr-generator.html),支持完全离线的浏览器端二维码生成,无需网络连接。
显著优点
- 物理隔离安全:凭证仅通过光学信道传输,不经过任何网络协议栈,阻断远程窃取路径。
- 零持久化设计:强制要求不记录到聊天历史、不写入记忆文件、30 秒自动清除画布、用后即删文件,最大限度降低残留风险。
- 双向灵活:既可将密码从联网设备“投影”到离线设备,也可将离线设备生成的凭证读回系统。
- 离线可用:HTML 离线生成器确保极端隔离环境仍能独立运作。
潜在缺点与局限性
- 物理暴露风险:二维码在展示期间可被旁侧摄像头或肉眼捕捉,传输过程缺乏加密(依赖光学信道本身的短时效)。
- 容量限制:二维码数据密度有限,过长密码或复杂 JSON 可能导致图像尺寸过大、扫描困难。
- 依赖外部摄像头:入站模式需可靠的光学输入设备,环境光线、摄像头分辨率影响成功率。
- 无双向认证:方案本身不验证扫码设备的身份,需配合物理环境控制。
适合人群
- 需要向离线设备(如硬件钱包、专用工作站)安全转移凭证的安全从业者。
- 高安全等级场景下的运维人员,如密钥 ceremony、离线签名机配置。
- 对网络传输持零信任态度的隐私敏感用户。
常规风险
- ** shoulder-surfing**:展示二维码时遭旁观者偷窥或偷拍。
- 恶意二维码:入站时若未验证来源,可能扫描到钓鱼凭证或 payload。
- 临时文件残留:若脚本异常中断,
rm未执行可能导致图像残留于/tmp。 - 解码日志泄露:
read-qr.py输出若被重定向,可能意外记录凭证。
技能正文
name: qr-password description: Air-gapped credential bridge using QR codes. Use when transferring credentials between networked and air-gapped devices via QR codes. Triggers on: generating QR from credentials, reading QR codes containing credentials, air-gapped password transfer, credential QR codes, vault-to-QR, camera-to-credential.
QR Password — Air-Gapped Credential Bridge
Bidirectional credential transfer using QR codes as an optical channel. No secret touches a network.
Security Rules (MANDATORY)
- Never log credentials to chat history or memory files
- Redact passwords from all conversation output — show
****instead - Auto-clear canvas display after 30 seconds using timed canvas hide
- QR images are ephemeral — delete after use with
rm - Never store decoded credentials in any file
Mode A: Vault → QR (Outbound)
Generate a QR code from a credential for an air-gapped device to scan.
echo '{"username":"USER","password":"PASS","domain":"DOMAIN"}' | \
python3 skills/qr-password/scripts/generate-qr.py /tmp/qr-out.png
Then display via canvas and auto-clear:
canvas present /tmp/qr-out.png
# Wait 30s
canvas hide
rm /tmp/qr-out.png
When reporting to user, say "QR displayed" — never echo the password.
Mode B: Camera → Credential (Inbound)
Read a QR code from a camera image to extract credentials.
- Capture image:
nodes camera_snap(or accept user-provided image) - Decode:
python3 skills/qr-password/scripts/read-qr.py /path/to/image.png
- Output is JSON:
{"username":"...","password":"...","domain":"..."} - Use the credential (fill, copy, deliver) — never echo password to chat
- Delete the image:
rm /path/to/image.png
Offline QR Generator
For air-gapped devices, provide assets/qr-generator.html — a standalone offline HTML page that generates QR codes locally in-browser. No network required.
Dependencies
Python 3 with: qrcode, Pillow, opencv-python-headless
Install: python3 -m pip install --user qrcode Pillow opencv-python-headless
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。