Skip to main content

Enkrypted Chat — Technical Specification

Work in progress — not audited

This specification is an initial draft by Positive Intentions. Enkrypted Chat is experimental software: it has not been independently audited or professionally reviewed. Do not rely on it for sensitive communications or production use. Features described here may be partial, unstable, or change without notice.

Document status: Initial draft (informal v0.1)
Product: Enkrypted Chat
Organization: Positive Intentions

Abstract

Enkrypted Chat is a browser-based, peer-to-peer messaging application. Users connect directly over WebRTC; a lightweight signaling broker (PeerJS-compatible, self-hostable) helps establish connections but does not carry message plaintext. Above the transport layer, the product applies a cascading application cipher—combining MLS, the Signal Protocol (X3DH + Double Ratchet via Rust/WASM), ML-KEM (post-quantum layer), and AES-GCM—so that compromise of one layer does not automatically expose content.

The system is built as federated microfrontends (Webpack Module Federation): shared UI, P2P, and cryptography modules load at runtime into the main chat shell. Static assets are served from commodity hosting (e.g. AWS S3/CDN); users may self-host bundles to reduce supply-chain risk.

This document is a hybrid specification: a readable overview for decision-makers, plus normative technical sections (RFC 2119 keywords where stated) for security researchers and engineers.

Executive summary

Centralized messengers route traffic and metadata through operator-controlled servers. Enkrypted Chat targets a different tradeoff: direct browser-to-browser delivery for message payloads, with encryption applied in layers from application code down to WebRTC’s DTLS/SCTP protections.

PropertyEnkrypted Chat approach
Message pathP2P over WebRTC data channels (when connected)
Application E2EECascading cipher: MLS → Signal → ML-KEM → AES (configurable)
Transport E2EEWebRTC (DTLS, SRTP for media)
IdentityClient-generated peer IDs (no account server)
InfrastructureSignaling broker, STUN/TURN, static CDN — semi-trusted, not message stores
Audit statusNo independent audit; in-house analysis and formal verification work in progress

Who should read this

  • Security researchers and cryptographers evaluating design and limitations
  • CTOs and architects comparing P2P vs centralized models
  • Policy and investor audiences needing an accurate (non-marketing) system description

Prerequisites for deep chapters

If you are new to Diffie–Hellman, X3DH, or the Double Ratchet, start with:

Document map

ChapterTopic
Full protocol spec (print / PDF)All normative protocol chapters on one page for PDF export
Full whitepaper (print / PDF)All product chapters (1–12) on one page for PDF export
Protocol spec gap analysisComparison to Noise / WireGuard; auditor checklist
CHANGELOG-SPECSpecification revision history
Protocol (normative)
P0. Design rationalesWhy JSON, cascade order, scope
P1. Protocol overview and profileEnkryptedChat-Profile-v0
P2. SignalingBroker / WSS
P3. Session establishmentHandshake order
P4. PDU catalogJSON type schemas
P5. Cascade wire encodingcascadedPayload
P6. Processing rulesEncrypt / decrypt MUSTs
P7. State machinesConnection + crypto FSM
P8. Limits and errorsSizes, failures
Appendix A. Test vectorsConformance references
Appendix B. P2P Signal deltasNormative vs standard Signal
Appendix C. GlossaryTerms
Appendix D. SFrame (WIP)Informative media encryption
Product specification
1. Goals and terminologyScope, definitions, non-goals
2. Architecture and trustComponents, trust boundaries, module federation
3. Transport (WebRTC)PeerJS, ICE, STUN/TURN, broker-only connection
4. Application encryptionCascade order, layers, properties table
5. Session and identityPeer IDs, P2P Signal handshake
6. Messages and attachmentsWire format, files, fast transfer
7. Metadata and privacyWhat leaks, privacy-by-design
8. Deployment and supply chainHosting, CSP, self-host
9. Threat modelAdversaries, mitigations
10. Implementation mapRepositories and modules
11. Limitations and roadmapHonest gaps, future work
12. ReferencesRFCs, blogs, related docs

This specification does not replace existing technical pages. Use them for implementation depth:

Security disclosure

Report vulnerabilities via GitHub Security Advisories on the positive-intentions/chat repository. There is no formal bug bounty at this time.

PDF / print version

The specification is split across multiple pages in the sidebar. To save a single PDF for each part:

Protocol spec

  1. Open Full protocol spec (print / PDF) — gap analysis, P0–P8, and appendices on one page.
  2. Click Print / Save as PDF (or use the browser menu: File → Print).
  3. Choose Save as PDF as the destination.
  4. Enable Background graphics so Mermaid diagrams print correctly.

Whitepaper

  1. Open Full whitepaper (print / PDF) — chapters 1–12 on one page.
  2. Follow the same print steps as above.

Locally: run npm run start in the website repository, then open
http://localhost:3000/docs/technical/whitepaper/complete-protocol-spec or
http://localhost:3000/docs/technical/whitepaper/complete-whitepaper.

Printing individual chapter pages will produce separate documents; use the complete pages for a single file per section.