Sekuvo
日本語

封筒 → QR

このページは、すでに暗号化されたSekuvoの封筒を、端末でスキャンできるQRフレームに変換します。暗号化は一切行わず、秘密情報を求めることもありません:封筒は自分のマシンで作成し、ここには暗号文だけを貼り付けます。

最も慎重な方法は、今でもダウンロードしたaktar.htmlを自分のディスクから開くことです。このページは、自分のターミナルで暗号化を済ませ、QR表示だけが必要な場合のためにあります。

1 · 封筒を自分のマシンで作成する

下のスクリプトは、アプリが開く封筒とまったく同じもの(PBKDF2-HMAC-SHA256 · 310,000回 + AES-256-GCM)を作成します。zarf-uret.pyという名前で保存し、実行前に読んでください — 約30行です。パスワードは自分で考えず生成してください;最初のコマンドがそれを行います。

# macOS / Linux
# generate a password (letters+digits, ~119 bits):
python3 -c "import secrets,string; print(''.join(secrets.choice(string.ascii_letters+string.digits) for _ in range(20)))"

pip3 install cryptography
python3 zarf-uret.py "Server SSH" > zarf.json   # paste the secret, then Ctrl-D
pbcopy < zarf.json                              # macOS; Linux: xclip -sel clip < zarf.json
# Windows (PowerShell)
# generate a password (letters+digits, ~119 bits):
python -c "import secrets,string; print(''.join(secrets.choice(string.ascii_letters+string.digits) for _ in range(20)))"

pip install cryptography
python zarf-uret.py "Server SSH" > zarf.json    # paste the secret, then Ctrl-Z + Enter
Get-Content zarf.json | Set-Clipboard
#!/usr/bin/env python3
# zarf-uret.py - reads the secret from stdin, writes a Sekuvo envelope to stdout.
# Usage: python3 zarf-uret.py "Title" > zarf.json   (paste the secret, then Ctrl-D)
# Requires: pip install cryptography
import sys, os, json, time, base64, hashlib, getpass
from cryptography.hazmat.primitives.ciphers.aead import AESGCM

title = sys.argv[1] if len(sys.argv) > 1 else "Transfer"
secret = sys.stdin.read()
# The app refuses entries above 256 KB; say so here instead of after the scan.
assert len(secret.encode()) <= 256 * 1024, "secret is over 256 KB, the app will not import it"
password = getpass.getpass("Envelope password (ASCII, generated): ")
assert password.isascii() and len(password) >= 8, "ASCII and at least 8 characters"

now = int(time.time() * 1000)
payload = json.dumps({"entries": [{
    "type": "NOTE", "title": title,
    "createdAt": now, "updatedAt": now, "quick": False,
    "data": {"notes": secret},
}]}, ensure_ascii=False)

salt = os.urandom(16)
key = hashlib.pbkdf2_hmac("sha256", password.encode(), salt, 310_000, 32)
iv = os.urandom(12)
blob = iv + AESGCM(key).encrypt(iv, payload.encode(), None)
print(json.dumps({
    "app": "vault", "version": 1,
    "kdf": {"algo": "PBKDF2WithHmacSHA256", "iterations": 310_000,
            "salt": base64.b64encode(salt).decode()},
    "cipher": "AES-256-GCM",
    "data": base64.b64encode(blob).decode(),
}))

秘密情報はコマンドラインに打ち込まず、スクリプトの入力に貼り付けてください — そうすればシェル履歴に残ることはありません。

2 · 封筒を貼り付ける

3 · 端末で

Sekuvo → + → QRでインポート → フレームをスキャン → 同じパスワードを入力 → 既存のものに追加。

← sekuvo.comに戻る