@enc-protocol/plugin-identity-aead
v0.9.0
Published
IdentityAeadCryptoFn: spec-compliant single-owner deterministic confidentiality for Personal-enclave private content. content_key = HKDF-SHA256(identity_priv, salt=∅, 'enc-personal-private:'||enclave_id, 32) + XChaCha20-Poly1305 (24-byte nonce), sourced f
Readme
@enc-protocol/plugin-identity-aead
The spec-compliant identity-aead implementation (IdentityAeadCryptoFn), per
spec/app/plugins/identity-aead.md — single-owner
deterministic confidentiality for Personal-enclave private content (owner-only documents).
The content key is a deterministic HKDF of the owner's identity_priv keyed by the enclave
id, so any device with identity_priv re-derives the same key. No ECDH, no ratchet, no
rotation — the simplest of the four encryption plugins.
Source = codegen
Generated from the Lean spec (Enc.DSL.Modules.IdentityAead →
@enc-protocol/core/identity-aead.js), composing only the verified core — HKDF-SHA256
deriveKey (IKM = identity_priv, empty salt) + XChaCha20-Poly1305 (24-byte nonce).
Zero hand-rolled @noble.
| Spec | Value |
|---|---|
| KDF | HKDF-SHA256, salt = ∅, L = 32, IKM = identity_priv |
| Domain sep | enc-personal-private: ‖ lowercase_hex(enclave_id) |
| AEAD | XChaCha20-Poly1305, 24-byte nonce |
import { identityAeadEncrypt, identityAeadDecrypt } from '@enc-protocol/plugin-identity-aead'
const env = identityAeadEncrypt(identityPriv, enclaveIdHex, 'owner-only doc') // { ciphertext, nonce }
const text = identityAeadDecrypt(identityPriv, enclaveIdHex, env)test/identity-aead.test.mjs runs the spec's §9 KAT vectors (deterministic key derivation +
round-trip + cross-enclave isolation) and the §7 rejection rules.
