Claude 24f816b6a3
Consolidate 22 sibling repos into layered organism structure
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):

- brain/        LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
                dispatch, A51 channels, and the OSINT cluster
- knowledge/    LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
                MITRE ATT&CK data
- reference/    defensive threat-reference (C3, shhbruh doc) + AdaYaml parser

License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.

Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.

https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
2026-06-10 06:53:01 +00:00

42 lines
1.4 KiB
Markdown

# E2E Encryption for Messaging Template
## Protocol Summary
| Phase | Algorithm | Purpose |
|-------|-----------|---------|
| Key Exchange | X3DH (X25519) | Initial shared secret |
| Key Ratchet | Double Ratchet | Per-message key derivation |
| Encryption | AES-256-GCM | Message confidentiality + integrity |
| Key Derivation | HKDF-SHA256 | Derive keys from DH outputs |
| Chain KDF | HMAC-SHA256 | Advance symmetric ratchet |
## Security Properties Checklist
- [ ] Forward secrecy: Past messages safe if current keys compromised
- [ ] Post-compromise security: Recovery after temporary key compromise
- [ ] Deniability: No cryptographic proof of message authorship
- [ ] Authenticated encryption: Tampered messages detected and rejected
- [ ] Replay protection: Message counters prevent replay attacks
- [ ] Out-of-order delivery: Skipped keys stored for late messages
## Message Format
```
[Header (40 bytes)]
- DH Public Key: 32 bytes
- Previous Chain Length: 4 bytes (big-endian)
- Message Number: 4 bytes (big-endian)
[Encrypted Payload]
- Nonce: 12 bytes
- Ciphertext + Tag: variable
```
## Integration Notes
- Identity keys should be stored in secure device storage (Keychain, TEE)
- Implement safety number verification for identity key comparison
- Handle device changes by re-running X3DH with new identity keys
- Store skipped message keys with a maximum limit (e.g., 1000)
- Delete message keys immediately after successful decryption