Skip to content

UsmanovMahmudkhan/Crypta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

550 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Crypta

Crypta is a zero-trust, end-to-end encrypted communication platform scaffold designed for high-risk corporate, executive, and security-sensitive environments. It is an alpha-stage, security-focused scaffold, not production-ready secure messaging software and not independently audited.

The backend is intended to ingest, route, and persist ciphertext envelopes, public key material, policy records, encrypted attachment metadata, and audit events while keeping plaintext and private keys on client devices. Some code and package names still use Sovereign Comm.

Preview

iPhone app preview Samsung app preview

Encrypted message animation preview

Local Backend Run

Copy .env.example to .env, set non-default secret values, then start the backend, database, and Go security verifier with:

docker compose up --build

For a direct Maven run against the Compose database, export DATABASE_URL, DATABASE_USERNAME, DATABASE_PASSWORD, BOOTSTRAP_TOKEN, TOKEN_PEPPER, WEBAUTHN_RP_ID, WEBAUTHN_RP_NAME, WEBAUTHN_ALLOWED_ORIGINS, and optionally SECURITY_VERIFIER_BASE_URL before running:

mvn spring-boot:run

Provision organizations, users, and devices with X-Bootstrap-Token, then exchange a bootstrapped userId and deviceId at POST /api/v1/bootstrap/sessions for a bearer token. The bootstrap token is an onboarding credential only; admin, governance, key, room, message, attachment, and device-revocation paths require bearer sessions. WebAuthn/passkey registration and login use persisted Yubico ceremony options and verified credentials, while external WebAuthn review and production attestation policy remain production-readiness items.

Backend tests can be run with:

mvn test

The full BackendFlowIntegrationTest uses Testcontainers and runs when Docker is available; without Docker it is skipped by design while unit and service-level hardening tests still run.

Documentation

Verified reference anchors checked on 2026-05-24:


Structure Map

flowchart TD
    User([User]) --> UI["UI Layer (main.dart)"]
    
    subgraph ClientApp ["Mobile Client (Flutter)"]
        UI --> AppOrch["Application Orchestrator"]
        AppOrch --> CryptoBridge["Crypto Bridge (DirectCryptoProvider, GroupCryptoProvider)"]
        AppOrch --> LocalDB["Local Encrypted Database (SQLCipher/Drift)"]
        CryptoBridge --> SecureStorage["Secure Storage Interface (SecureStorageProvider)"]
    end

    subgraph NativeOS ["Native OS Security Modules"]
        iOSSecureEnclave["iOS Secure Enclave / Keychain"]
        AndroidKeystore["Android KeyStore / StrongBox"]
        BiometricUnlock["Biometric Authentication APIs"]
    end

    SecureStorage --> iOSSecureEnclave
    SecureStorage --> AndroidKeystore
    AppOrch --> BiometricUnlock

    AppOrch -- "TLS 1.3 / HTTPS" --> BackendGateway["Backend Web Gateway (SecurityConfig, RequestIdFilter)"]

    subgraph Backend ["Spring Boot Monolith"]
        BackendGateway --> AuthFilter["ApiAuthenticationFilter (Bearer token validation)"]
        AuthFilter --> PlaintextGuard["PlaintextGuard (Validates metadata structure)"]
        PlaintextGuard --> Controllers["Controllers (WebAuthn, Key, Message, Attachment, Room, Admin)"]
        Controllers --> Services["Services (JdbcSovereignCommServices implementation)"]
    end

    subgraph Infrastructure ["Infrastructure Services"]
        Services --> DB[("Database (PostgreSQL 16)")]
        Services --> SIEM["SIEM Export Sink Records (connector TODO)"]
        Services --> MDM["MDM Provider Boundary (connector TODO)"]
    end
Loading

What Is Implemented

User Authentication & Sessions

The project includes bootstrap onboarding, Yubico-backed WebAuthn/passkey ceremony verification, persisted WebAuthn request options, verified credential storage, and random bearer tokens stored as hashes. Legacy demo credentials are marked separately and excluded from login. Bootstrap is limited to onboarding; normal administration and application use require bearer sessions.

Implemented with:

Zero-Trust Message Ingestion

The project implements API endpoints that ingest and store only encrypted ciphertext envelopes, verifying metadata constraints without exposing message payloads.

Implemented with:

Plaintext Prevention Guard

The project uses strict validation logic to reject JSON metadata payloads containing any keys matching patterns for plaintext, body content, or decrypted parameters, including forbidden keys nested inside maps, lists, and arrays.

Implemented with:

Cryptographic Key Management

The project provides prekey and identity key storage endpoints supporting Signal-style cryptographic handshake setups.

Implemented with:

Merkle Log Key Transparency

The project logs key history events in an append-only transparency log to verify public key integrity.

Implemented with:

Tamper-Evident Auditing

The project implements audit events hash-chained per organization to verify log integrity and order.

Implemented with:

Secure File Attachments

The project handles upload and download paths for client-side encrypted attachments.

Implemented with:

Emergency Lockdown Control

The project supports organizational and room-level emergency lockdowns that instantly suspend activity.

Implemented with:

Device Trust & Attestation

The project tracks hardware-backed device attestation status, compliance state, and revocation actions.

Implemented with:

Mobile Presentation & Contracts

The mobile module defines abstract cryptographic interfaces and visual presentation mockups for secure conversations.

Implemented with:

Containerized Deployment

The project contains local Docker Compose support and Kubernetes base manifests for deployment experimentation. These files require environment-specific hardening before production use.

Implemented with:

Compliance Query Language (CQL) & Smalltalk Rules Engine

The platform integrates a dynamic governance plane for real-time compliance auditing and rule-based policy enforcement:

  • Compliance Query Language (CQL): An ANTLR4-parsed, SQL-inspired language designed specifically for bearer-admin querying of AUDIT_EVENTS, DEVICES, and ROOMS. Execution is organization-scoped, table/column allowlisted, parameterized, length-limited, and result-capped.
    • Grammar: CQL.g4
    • Compiler / Service: CqlPolicyService
    • Example Query: SELECT id, event_type FROM AUDIT_EVENTS WHERE event_type = 'AUDIT_EXPORT_REQUESTED'
  • Smalltalk Policy Engine: A highly flexible, lightweight Smalltalk message-passing engine embedded within the Java policy layer to evaluate compliance rules with block evaluations ([ :param | ... ]). It is disabled by default and scans input and returned structures for plaintext-shaped metadata.
  • Governance REST Endpoints:
    • POST /api/v1/governance/cql/parse - Parse CQL query string to abstract AST representation.
    • POST /api/v1/governance/cql/execute - Execute an organization-scoped CQL query against approved governance tables.
    • POST /api/v1/governance/smalltalk/evaluate - Evaluate Smalltalk block against target object contexts dynamically.

About

Zero-trust, end-to-end encrypted communication platform for secure executive, corporate, and high-risk messaging.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors