How shonnay/k3ncrypt works
K3NCRYPT is a privacy-first messaging and calling product: clients hold identity and encryption keys, while the service SDK coordinates encrypted communication and the backend authorizes operations and relays opaque data. The main user path runs from setup and conversation use in the browser through the SDK to backend APIs and relays; attachments, calls, device trust, and private-network authority are additional capabilities. Android mirrors several client responsibilities, though the README identifies the browser as the supported client. Some subsystem links are documented only at a high level, so the graph omits unverified internal wiring.
Main entry points: App.tsx App shell · index.ts HTTP API · AndroidMessagingRepository.kt Android messaging · AndroidIdentityLifecycleRepository.kt Android identity
Components 26
Browser client
- App shell
client/src/App.tsx - Chat interface
client/src/components/ChatContainer/ChatContainer.tsx - Conversation setup
client/src/components/SetupOverlay/SetupOverlay.tsx - Chat state
client/src/context/ChatContext.tsx - Media gateway
client/src/media/HttpAttachmentGateway.ts
Communication SDK
- Conversation crypto
service/src/crypto/modernConversation.ts - Device identity
service/src/devices/lifecycle.ts - Encrypted sync
service/src/sync/runtime.ts - Call services
service/src/calls/service.ts - Attachment workflow
service/src/attachments/service.ts - Private network
service/src/privateNetwork/runtime.ts
Backend services
- HTTP API
backend/api/index.ts - Trust authority
backend/api/deviceTrust.ts - Membership authority
backend/api/networkMembership.ts - Attachment authorization
backend/security/authenticatedAttachmentService.ts - Socket relay
backend/socket.io/listeners.ts
Persistence
- Mongo persistence
backend/db/index.ts - Browser secure storage
service/src/storage/secureVault.ts
Android client
- Android application
android/app/src/main/kotlin/com/k3ncrypt/app/MainActivity.kt - Android messaging
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidMessagingRepository.kt - Android identity
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidIdentityLifecycleRepository.kt - Android calls
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidCallController.kt - Android crypto
android/crypto/src/main/kotlin/com/k3ncrypt/crypto/CryptoPort.kt - Android network
android/network/src/main/kotlin/com/k3ncrypt/network/K3ncryptApi.kt - Android encrypted state
android/storage/src/main/kotlin/com/k3ncrypt/storage/CryptoStateStore.kt
Other components
- User
Connections 35
- User → App shell: uses
README.md - App shell → Chat state: initializes
client/src/App.tsx - App shell → Conversation setup: renders
client/src/App.tsx - App shell → Chat interface: renders
client/src/App.tsx - Chat state → Browser secure storage: opens vault
client/src/context/ChatContext.tsx - Chat state → Conversation crypto: coordinates encryption
- Chat state → Encrypted sync: coordinates sync
- App shell → Media gateway: configures
client/src/App.tsx - Media gateway → Attachment workflow: uses workflow
- App shell → Call services: provides call interface
- Conversation crypto → Device identity: uses device identity
- Device identity → Trust authority: requests trust authority
README.md - Encrypted sync → Socket relay: relays ciphertext
README.md - Call services → Socket relay: relays call signaling
README.md - Attachment workflow → Attachment authorization: requests protected media
README.md - Private network → Membership authority: checks membership
README.md - HTTP API → Trust authority: routes
backend/api/index.ts - HTTP API → Membership authority: routes
backend/api/index.ts - HTTP API → Attachment authorization: routes attachments
backend/api/index.ts - Attachment authorization → Attachment workflow: delegates operations
backend/security/authenticatedAttachmentService.ts - HTTP API → Socket relay: separate relay interface
- HTTP API → Mongo persistence: persists metadata
README.md - Socket relay → Mongo persistence: stores operational state
README.md - User → Android application: uses
README.md - Android application → Android messaging: provides messaging
- Android application → Android identity: manages identity
- Android application → Android calls: controls calls
- Android messaging → Android crypto: encrypts messages
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidMessagingRepository.kt - Android messaging → Android encrypted state: persists state
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidMessagingRepository.kt - Android messaging → Android network: sends relay data
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidMessagingRepository.kt - Android identity → Android crypto: uses crypto
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidIdentityLifecycleRepository.kt - Android identity → Android network: requests lifecycle services
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidIdentityLifecycleRepository.kt - Android identity → Android encrypted state: persists identity
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidIdentityLifecycleRepository.kt - Android calls → Android messaging: sends call signals
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidCallController.kt - Android calls → Android identity: reads identity
android/app/src/main/kotlin/com/k3ncrypt/app/AndroidCallController.kt