Skip to content
C

cryptika

Burn the keys, not the UX

Created on 11th March 2026

•

C

cryptika

Burn the keys, not the UX

The problem cryptika solves

The Problem Cryptika Solves
Every mainstream messenger -WhatsApp, Telegram, Signal - asks you to hand over a phone number, an email, or some permanent identity before you can say a single word. That metadata alone is enough to build a social graph, trace connections, and surveil users — even if the message content is encrypted. The server always knows who is talking to whom, when, and how often.

Cryptika solves this by treating identity as disposable and communication as ephemeral:

No accounts, no passwords, no phone numbers. You pick a temporary secret name, connect with someone, and the name is replaced by a short UUID. There's nothing permanent to subpoena or leak.
Ephemeral 30-minute sessions. After a contact request is accepted, the session self-destructs — all messages, crypto keys, and contact records are wiped. Not "deleted" — the ratchet keys are zeroized in memory and the per-message Keystore entries are destroyed.
The server is a blind relay. It routes opaque binary blobs between identity hashes. It never sees plaintext, never stores messages, and after credential burning, can't even re-authenticate the JWT that was used.
Screen-off = full wipe. If the device screen locks, every session is destroyed, purge signals are sent to all peers, auth tokens are cleared, and the app restarts at the entry screen. A stolen locked phone yields nothing.
Peer-aware logout. When one user disconnects, the other user's messages are purged too — not just locally, but cryptographically. Neither side retains anything.
In short: Cryptika is built for conversations that should leave no trace — on the device, on the server, or in between.

Challenges We Ran Into

  1. Passwordless auth that still works with a password-expecting server. The original design had full username/password registration and login. Stripping that down to "just enter a name" meant the client still had to satisfy the server's API contract. We solved this by deriving a deterministic password from the Ed25519 identity key (SHA-256(publicKey) → Base64), making the password invisible to the user while keeping the server happy. The client tries to register first and silently falls back to login if the name is taken.

  2. Coordinating the DH handshake over an unreliable relay. Both peers send an X25519 offer simultaneously over WebSocket, but there's no guarantee of ordering. A late-joining peer might miss the initial offer entirely. We had to implement offer echoing — when a peer receives the other's offer, it re-sends its own stored offer so both sides can derive the same session key. Getting this idempotent (ignoring duplicate handshakes once a MessageProcessor exists) without race conditions across coroutines required careful @Volatile state management in BackgroundConnectionManager.

  3. Forward secrecy with a single hash ratchet. A proper Double Ratchet (Signal protocol) wasn't feasible in the time frame, so we used a simpler SHA-256 hash ratchet where K_n = SHA-256(K_{n-1}). This gives forward secrecy (compromising K_n doesn't reveal K_{n-1}) but not post-compromise security. The bigger challenge was handling out-of-order messages — relay packets don't arrive in order. We implemented a lookahead buffer (up to 50 keys cached for 30 seconds) so the receiver can pre-compute future ratchet keys without breaking the chain.

  4. Sending purge signals before the socket tears down. When a user logs out, we need to encrypt and send PURGE to every connected peer before the WebSocket disconnects. But logout can be triggered from the screen-off broadcast receiver, which fires with very little time before the process is killed. We added a 300ms flush delay after sending purge packets, which is a tradeoff — too short and packets might not leave the buffer; too long and the OS kills the process. Wrapping this in a foreground service's lifecycle helped, but it's inherently best-effort.

  5. Per-message encryption at rest with Android Keystore. Every message is encrypted in transit (ChaCha20-Poly1305 via the ratchet) and then re-encrypted at rest with a unique AES-256-GCM key from Android Keystore before being written to SQLCipher. This means even if someone extracts the database file and the database passphrase, each message row requires its own Keystore key to decrypt. The challenge was key lifecycle — on message expiry or purge, we need to delete the Keystore entry too, and orphaned keys (from crashed deletions) had to be handled gracefully.

  6. Secure keyboard without breaking UX. System keyboards (GBoard, SwiftKey) can log keystrokes, predict text, and sync to the cloud. We built an in-app keyboard (SecureKeyboard) that bypasses the IME entirely. The input fields are readOnly = true and all input routes through the custom keyboard composable. The challenge was making this not feel terrible — supporting lowercase, uppercase, symbols, backspace, and done actions while keeping it performant inside a Compose bottom bar that coexists with chat input, expiry picker

Challenges we ran into

Building a truly ephemeral and identity-free system introduced several technical challenges. Removing traditional authentication meant we had to implement passwordless access while still satisfying a server API designed for username/password logins, which we solved by deriving a deterministic password from the user’s Ed25519 identity key. Establishing a secure Diffie–Hellman key exchange between peers over an unreliable WebSocket relay required idempotent handshake logic so both parties could derive the same shared secret even when messages arrived out of order. Achieving forward secrecy within limited development time led us to implement a SHA-256 hash ratchet with a lookahead buffer to handle out-of-order messages without breaking the chain. On the device side, securely storing messages required a layered approach: each message is encrypted again at rest using AES-256-GCM keys from Android Keystore before being stored in SQLCipher, creating complex key-lifecycle management during expiry or purge events. Finally, Android itself posed reliability challenges—maintaining WebSocket connectivity through Doze mode, ensuring purge signals are sent before logout or screen lock, and coordinating foreground services and coroutine scopes so that session state remains consistent without leaking sensitive data.

Technologies used

Discussion

Builders also viewed

See more projects on Devfolio