libertaria-stack/core
Markus Maiwald bdfb0b2775
fix(crypto): add AAD to AEAD encryption binding ciphertext to context
Previously encryptPayload() used empty AAD, allowing ciphertext to be
replayed across different contexts. Now includes header fields as AAD:

- ephemeral_pubkey: Binds to sender identity
- timestamp: Replay protection (5 min window)
- service_type: Context binding (WORLD/FEED/MESSAGE/DIRECT)

API changes:
- encryptPayload() now requires service_type parameter
- decryptPayload() now requires expected_service_type parameter
- EncryptedPayload extended with timestamp and service_type fields
- New error types: ServiceTypeMismatch, TimestampTooOld, TimestampInFuture

Security: Ciphertext is now cryptographically bound to sender,
timestamp, and service context. Replay and context confusion attacks
are prevented via AAD verification during decryption.

Fixes P0 security audit issue: Missing AAD in AEAD Encryption
2026-02-09 00:55:34 +01:00
..
l0-transport fix(l0-transport): remove incorrect const qualifier from LWFFrame.deinit() 2026-02-09 00:07:17 +01:00
l1-identity fix(crypto): add AAD to AEAD encryption binding ciphertext to context 2026-02-09 00:55:34 +01:00
l1-membrane refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
l2-federation refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
l2-membrane fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +01:00
l2_session refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
LICENSE refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00