Kiridharan

skiridharan.me@gmail.com

Get in touch

Koban: building a personal finance app with no network at all

How we built Koban, a local-first encrypted finance dashboard: redaction before storage, sandboxed parsers, unserializable secrets and no HTTP client.

Published
Reading time
5 min
Project
Koban
Topics
  • Rust
  • Tauri 2
  • React
  • SQLCipher
A bank statement with its account details redacted, sealed in a local vault with no network. Statement CSV no network

Most personal finance apps ask for the one thing you should be slowest to give: a live connection to your bank. Koban asks for nothing. You download statements from your banks, drop them in, and get one categorized, de-duplicated view of your money. No bank logins, no cloud, no telemetry. Everything lives in an encrypted vault on your machine, and the app has no network access at all. It is tuned for Indian banks — INR, UPI/NEFT/IMPS narrations, exports from HDFC, ICICI, SBI, Axis and Kotak — but it reads any CSV, Excel, OFX or text PDF statement.

“Private by design” is easy to write on a landing page. This build log is about the decisions that make it true in the code.

Redact at the door, not at the window

The usual approach to sensitive data is to store everything and hide it in the UI. We went the other way: identifiers are removed before anything is written. Account and card numbers, phone numbers, emails, PAN and Aadhaar, IFSC codes, personal UPI handles and transaction reference numbers are stripped during import. Original statement files are never kept.

That raises a practical problem. If you throw away the account number, how do you know two statements belong to the same account? Koban recognises accounts by a keyed HMAC fingerprint of the number, never the number itself. The vault can match accounts reliably while holding nothing an attacker could use.

We don’t take this on trust. A leak test imports planted identifiers through the real pipeline, then searches for them in every table of the decrypted vault, in the raw vault, WAL and header files, and in the payload sent to the UI. If any planted value survives, the build fails.

Treat the statement file as hostile

A bank statement is a file from outside, and parsers are a classic place for bugs to turn into exploits. So statements are parsed in a child process with an empty environment, a CPU limit and, on macOS, the pure-computation sandbox. The parser worker holds no vault, no keys, no filesystem access and no network. File bytes go in; rows come out as JSON.

The crate layout enforces the same idea. Only koban-vault touches cryptography and the database driver. The redaction, parsing and categorization crates are pure — no I/O, no keys. The only cryptography inside the parsers is opening your own password-protected PDF or Excel file, and that happens inside the sandbox, with the password used once, in memory.

Make leaking a compile error

The webview is treated as untrusted. It receives redacted data transfer objects only, and the types that hold secrets — Sensitive<T> and Restricted<T> — cannot be serialized. Compile-fail tests prove it: code that tries to send one across the IPC boundary doesn’t build.

The same thinking applies to the network. Tauri capabilities allow only Koban’s own commands and file dialogs; there are no filesystem, shell or HTTP plugins, and the content security policy is strict. One step further: cargo deny bans HTTP client crates from the dependency graph. A compromised dependency that wants to phone home has no client to do it with. We’re candid that this is a partial defence — the threat model marks it “partly” — but it moves the risk from “likely” to “has to work hard”.

Keys follow a familiar but careful shape:

master password ──Argon2id──▶ KEK ─┐
recovery phrase (24 words) ─HKDF─▶ KEK ─┤ unwrap (XChaCha20-Poly1305)
                                        ▼
                         random master data key (MDK)
                          ├─HKDF─▶ SQLCipher raw key
                          └─HKDF─▶ header MAC key

Changing your password rewraps one slot; the data isn’t re-encrypted. Lose both the password and the recovery phrase and the vault is unrecoverable — by design.

Never count the same rupee twice

Privacy is the foundation, but people stay for accuracy. Statements overlap, people re-import the same month, and money moving between your own accounts looks like spending on one side and income on the other.

Each row gets a fingerprint built from date, amount, reference-or-text and occurrence, so re-importing the same or an overlapping statement adds zero duplicates. Transfers between your own accounts and credit-card bill payments are linked and excluded from income and spending. Every import is previewed first — new versus duplicate rows, redaction counts, balance-continuity warnings — committed in one transaction, and can be rolled back later. Money is stored as signed integer paise everywhere; never floats.

Categorization that learns on your machine

Categorization runs in layers: your own rules first, then a built-in merchant list (Swiggy, Zomato, Amazon, Uber, BESCOM, Airtel and more), then bank-narration heuristics, then a small on-device model. Correct one transaction and Koban offers to turn it into a rule and apply it to similar ones. The model — naive Bayes, deliberately simple — learns from your own choices and suggests categories for the rest, and its accuracy is shown to you rather than hidden. The dashboard stays under 100 ms on a 100,000-transaction vault.

Koban is pre-1.0. It is feature-complete for v1 apart from Touch ID; what remains is an external security review, long fuzz campaigns and signed releases.

What we’d tell a team building something similar

Decide what you will never store, then build the pipeline so storing it is impossible rather than discouraged. Put untrusted input in a process that has nothing worth stealing. Push privacy rules into the type system and the dependency policy, where a reviewer can’t miss them and a deadline can’t erode them. And write the test that tries to find the leak — a planted value you go looking for is worth more than any number of assurances in a README.

If you’re weighing a build where trust is the product, get in touch.

Tell me what you are building.

For consulting, a build, or a question about a write-up.

  1. Full-stack developmentScalable frontend and backend systems with modern technologies.
  2. System architectureDistributed systems and microservices architectures.
  3. GenAI integrationAI-powered features and automation workflows.
  4. Technical consultingStrategic problem-solving and measurable client impact.

ChennaiIndia

Write to me

Or write directly

skiridharan.me@gmail.com