The pieces / weirdnet-keys

weirdnet-keys

256-bit keys, BIP39 words, Shamir shards, KDFs, sealing, X25519 and an envelope keyring.

GitHub crates.io docs.rs weirdnet-keys = "0.1"

What it is

Key material and key policy, built only on vetted RustCrypto, dalek, BIP39, vsss-rs and age crates. Nothing here invents a cipher, a KDF or a format of its own.

Every label (HKDF info, associated data, shard prefix, claim salt) comes from a Profile; envelopes record their format, so a file written under one profile is refused under another.

What is in it

  • Key32: a 256-bit key, wiped on drop, never printed.
  • words: the 24 BIP39 words for a key. shards: Shamir k-of-n split and combine with a checksummed text form.
  • kdf: HKDF-SHA256 and Argon2id. aead: XChaCha20-Poly1305 Sealed. password: Argon2id password sealing and claim tags. mac: HMAC-SHA256. exchange: X25519 agreement with a contributory check.
  • keyring: envelope encryption for a database key, wrapped by a versioned service key and by a key derived from the master key: init, unlock, rotate, rekey with undo, recover, verify, export.
  • dark: shards sealed with a shard password for custodians. age: password age files for exports.

Where it fits

  • Used by weirdnet-net, Morph.
  • Extracted from Muninn.
  • License: BSD-3-Clause.
Not audited. The shard checksum catches typos, not forgery: a forged share combines into a wrong key, which verification then rejects.