halkyon/packages/halkyon_keys/lib/halkyon_keys.dart
Tizian 「ティツィアーン」 b72cea1fe0
feat(base,app,keys): keys of shared spaces, sealed to each member
Step 3 of ADR 0044 (D3, D18, D19). A shared space's data keys are
sealed on a device to each member's public keys; the instance keeps
what devices sealed and never opens it.

- halkyon_keys: the safety code of two accounts' public keys
  (`safetyCode`), 60 digits, the same on both sides.
- halkyon_base: the register hands out accounts' public keys
  (`public-keys-of`, local and remote); the table `shared_space_key`
  and the endpoint `sharedSpaceKeys` (memberKeys, keysNeeded, seal,
  mine). Only the Owner and Editors seal, the first key sealed to a
  member stays, and a member's keys go with their membership. Every
  host's migration creates the table.
- halkyon_app: `ContentCipher` seals a key to another account and
  opens one sealed by another; `SharedKeys` shares a space's key with
  its members, seals keys to newcomers and opens the person's own,
  holding each member to the public keys `KeyPins` pinned on first
  sight (`key_pins.json` in the person's folder), a change refused
  until trusted anew.

Learn takes them into its `Privacy` in step 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-11 11:35:42 +01:00

35 lines
1.4 KiB
Dart

/// An account's keys on the device (ADR 0017): what the password unlocks
/// (Argon2id, split into SRP's x, the key-encryption key and the password's
/// proof key), the account's
/// key pairs and their wrapping, the recovery phrase and its key, data keys
/// sealed to the account, and content sealed and signed in ADR 0002's
/// envelope. libsodium (the `sodium` package, its sumo API for Argon2id)
/// does every primitive; nothing here is ever sent but what is wrapped,
/// sealed or public.
library;
export 'src/account_keys.dart'
show AccountKeys, WrappedAccountKeys, unwrapAccountKeys, wrapAccountKeys;
export 'src/data_keys.dart' show DataKey, openDataKey, sealDataKey;
export 'src/key_refused.dart';
export 'src/password_keys.dart'
show PasswordKdf, PasswordKeys, derivePasswordKeys, newPasswordSalt;
export 'src/password_text.dart'
show
PasswordRefusal,
PasswordRefused,
checkNewPassword,
newPasswordMinLength,
normalizePassword;
export 'src/recovery_phrase.dart'
show
entropyOfRecoveryPhrase,
newRecoveryPhrase,
recoveryEntropyBytes,
recoveryKeyOf,
recoveryPhraseOf,
recoveryProofKeysOf,
recoveryProofPublicKeyOf;
export 'src/row_ids.dart' show keyedRowId;
export 'src/safety_code.dart' show PublicKeys, safetyCode;
export 'src/sealed_content.dart' show SealedContent, openContent, sealContent;