[vault] Two factors (format v2), machine store, key pairs and API keys (v0.4.0) #6
Reference in New Issue
Block a user
Delete Branch "feature/two-factors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Core for two-factor vaults, the Claude Code store, and key generators. Version 0.4.0. Docs first:
docs/FACTORS.md,docs/KEYS.md; then tests, then code.What changed
docs/FACTORS.md): a vault opens with any two of its factors, never one: password, device key, TOTP-released share, another device's approval, passkey PRF.F(wrapped by the factor's material in a factor slot).upgrade_to_two_factorsturns a v1 vault into v2 with its password and a second factor; same vault key, same items. A v1 file still reads.key-pair, pluscustos-keys(Ed25519, ECDSA P-256, RSA-3072/4096 as OpenSSH public/private, SPKI and PKCS#8 PEM,SHA256:fingerprint).custos-gen:secret_key(16–128 bytes; hex, base64url, base64) andapi_key(prefix_+ 190 bits of base62 + CRC-32 checksum).CLAUDE.md):ed25519-dalekis allowed as RustCrypto's Ed25519 backend forssh-key.Checked
cargo test --workspace --release: 71 green. New:Debug;ssh-keygen(OpenSSH) reads the generated Ed25519, ECDSA and RSA private keys, derives the same public keys, and prints the same fingerprints.Self-review
Corrupted.custos-wasm; it compiles here, the wasm32 target was not built).