Skip to content
This repository was archived by the owner on Aug 9, 2026. It is now read-only.
This repository was archived by the owner on Aug 9, 2026. It is now read-only.

implement Double Ratchet / Ephemeral DH for Perfect Forward Secrecy (PFS) in private chats #8

Description

@itsVentie

Description

Currently, Liora uses a static X25519 shared secret derived directly from long-term Ed25519 identity seeds. To ensure Perfect Forward Secrecy (PFS), we need to implement a key-ratcheting mechanism so that the compromise of long-term keys does not expose past session histories.

Todo

  • Implement an ephemeral X25519 Diffie-Hellman handshake executed at the start of every new chat session.
  • Create a KDF (Key Derivation Function) chain using HKDF-SHA256 to update symmetric AES-GCM keys on every sent/received message (Message Ratchet).
  • Add tracking for out-of-order messages to store skipped keys in the local SQLite vault securely (with an explicit retention/expiration policy).
  • Update the message processing layer in backend/crypto/ to reject payloads encrypted with stale keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions