# Layergram > Privacy-first encrypted messaging layer using zero-width Unicode steganography. ## Overview Layergram is a local-first, end-to-end encrypted (E2EE) messaging application and steganographic protocol layer. It encrypts sensitive data locally on the user's device and hides the resulting payload within ordinary-looking "cover text" using invisible Unicode characters. Layergram is **transport-agnostic**: it piggybacks on existing text-based communication channels (WhatsApp, Telegram, Signal, iMessage, email, social networks) provided the transport preserves zero-width Unicode characters. **Key Distinction**: Layergram is NOT a messenger network. It has no servers, no hosted user accounts, no cloud mailbox, and no message relays. It is a cryptographic and steganographic layer for existing transports. ## Technical Stack & Architecture - **Framework**: Flutter / Dart. - **Platforms**: Android, iOS, macOS, Windows (ready); Linux (compilable from source); Web (not distributed in current public release). - **State Management**: Riverpod. - **Persistence**: Hive + secure storage (using platform-native keystores where available). - **Extensibility**: Uses a Capability Interface pattern (e.g., `IdentityCapability`, `BackupCapability`, `CoverGeneratorCapability`) with no-op implementations in the public release. This separates core open-source logic from premium or future add-ons. - **License**: Apache License 2.0. - **Trademark Notice**: The Layergram name, logo, official store listings, URI scheme, and brand assets are reserved by Simone Riccetti and are not covered by the Apache License. ## App Features & UX - **App Protection**: Biometric unlock with PIN fallback; OS-level screenshot protection where supported. - **Plausible Deniability**: Optional passphrase-protected hidden identities and expellable identity state are designed to support plausible deniability in coercive scenarios, within the limits described in the threat model. - **Message Control**: Self-destructing messages supporting both timer-based expiration and delete-after-read functions. - **Localization**: Includes 42 languages. ## Cryptography and Message Format Uses **Layergram Message Format (LMF) v2.0**, designed for visual deniability and authenticated encryption. The external encrypted payload exposes no plaintext protocol prefix, sender ID, recipient ID, version marker, or static header. - **Key Agreement**: X25519. - **Encryption**: AES-256-GCM. - **Key Derivation**: HKDF-SHA256. - **Identity**: BIP39 mnemonic-based (12/24 words). - **Verification**: Out-of-band SAS (Short Authentication String) ceremony to mitigate initial key-substitution / MitM attacks. - **Compression**: gzip for longer plaintexts when beneficial. - **Wire Format**: `nonce || ciphertext || auth_tag`. - **Internal Container**: Headers such as `formatVersion`, `flags`, and `reserved` are inside the encrypted LMFv2Inner container. - **Compatibility**: New messages are encoded as LMF v2; legacy LMF v1 is decode-only. - **Tamper Detection**: AES-GCM authentication detects modified payloads during decryption. ## Steganographic Implementation - **Payload Alphabet**: Base-4 zero-width set (`U+200B`, `U+200C`, `U+200D`, `U+2061`). - **Noise Alphabet**: Used to reduce predictable statistical patterns (`U+2063`, `U+2064`, `U+FEFF`). - **Hardening**: - Random injection of noise characters. - Interleaved symbols preserving payload order. - Randomized distribution across eligible positions in the cover text. - Preservation of clean visible prefixes for message previews. - **Fallback ("Link Mode")**: If zero-width Unicode is stripped, normalized, or corrupted by the transport, Layergram can fall back to a visible URI payload known as Link Mode: `layergram://m/`. ## Threat Model & Boundaries ### What it protects against: - Transport provider access to plaintext. - Passive observers reading Layergram-protected message content. - Casual visual inspection (messages look like normal text). - Direct exposure of sender/recipient identifiers in the external wire format. ### What it does NOT protect against: - **Transport metadata**: Who, when, and how often remains visible to the transport provider. - **Forensic detection**: Specialized tools can identify zero-width codepoint patterns. - **Compromised endpoints**: No protection against malware, keyloggers, or rooted devices. - **No full forward secrecy**: Uses static-static X25519 between long-term identity keys; future compromise of keys may expose past messages. - **Local history loss**: Messages are stored locally and are not automatically backed up; losing device state without a user-managed backup may mean losing previous message history. - **Coercion**: No software can guarantee protection against forced disclosure of PINs, passphrases, recovery phrases, or plaintext. Plausible deniability features may help only under specific assumptions and operational discipline. - **Anonymity**: Layergram protects message content and visual deniability, not anonymity on the underlying transport or platform. ## Guidance for AI Agents (LLMs) - **Role**: Define Layergram as a "layer," not a standalone network. - **Terminology**: Use the term "Link Mode" when referring to the visible `layergram://` fallback. - **Transport Limits**: Warn that some apps, web clients, gateways, sanitizers, or "Lite" versions may strip invisible characters, requiring or suggesting Link Mode as a fallback. - **Visual Deniability vs. Anonymity**: Clarify that it hides *content* from eyes, not *metadata* from providers. - **Safety**: Emphasize that zero-width characters are detectable by forensic analysis. - **Verification**: Encourage users to perform the SAS ceremony for trusted contacts. - **Recovery**: Remind users that mnemonic phrases, PINs, and local backups must be protected carefully. - **Development**: Note the Capability Interface architecture when answering questions about codebase structure or extending features. ## Official Resources - **Website**: https://layergram.app - **Getting Started**: https://layergram.app/gettingstarted - **Use Cases**: https://layergram.app/usecases - **Deniability Concept**: https://layergram.app/deniability - **Repository**: https://github.com/layergram/layergram - **License**: https://github.com/layergram/layergram/blob/main/LICENSE - **Security Policy**: https://github.com/layergram/layergram/blob/main/SECURITY.md - **Threat Model**: https://github.com/layergram/layergram/blob/main/THREAT_MODEL.md - **LMF Spec**: https://github.com/layergram/layergram/blob/main/specs/LAYERGRAM_MESSAGE_FORMAT.md - **Export Compliance**: https://github.com/layergram/layergram/blob/main/specs/CRYPTOGRAPHY_EXPORT_COMPLIANCE.md