Documentation

A quick technical tour of how hamro is built.

Getting started

Sign in with your phone number, confirm the one-time code, and optionally set a 2FA password in Settings. Then drag and drop a file into any folder to see client-side encryption in action.

Encryption model

AES-256-GCM per file with a random key, wrapped via AES-KW using a PBKDF2-derived key from your password (210,000 iterations, SHA-256). Large files are split into 4MB plaintext chunks before encryption, each with a deterministically-derived IV so chunk order can't be tampered with silently.

Uploads & resumability

Uploads call /api/upload/init to register file metadata, then stream encrypted chunks to /api/upload/chunk. If a chunk fails, only that chunk needs retrying — already-uploaded chunks are skipped on resume.

Sharing

Share links choose 1 hour, 1 day, or 7 days max expiry, with an optional password and download counter. Revoking a link takes effect immediately.

Storage backend

The storage layer is defined by a small StorageAdapter interface (see src/lib/storage/adapter.ts). Today it's implemented against local encrypted-blob storage; wiring in real Telegram MTProto later means implementing the same interface without touching the rest of the app.