Zero-Knowledge Design for a Private Diary App
RozVibe is a privacy-focused app and client-side encrypted journal for Android.
Security should not depend solely on policy. It should be reinforced by cryptography, transparent architecture, and clearly defined threat models.
This document outlines the technical architecture of RozVibe. It explains how our secure journaling app is designed to protect data before it leaves the device, our threat model, and the cryptographic trade-offs made in designing our local-first encryption architecture.
Why RozVibe Was Built
I started digital journaling years ago, but quickly realized I was self-censoring. The knowledge that my private thoughts resided in plaintext on remote servers—accessible to developers, vulnerable to database breaches, and susceptible to AI profiling—fundamentally changed how honestly I wrote.
That realization led to the creation of RozVibe. I wanted an encrypted diary where privacy was designed into the architecture natively, helping minimize reliance on a trust-based privacy policy.
Core Security Principles
No-Trust Architecture
Our backend cloud systems are designed not to require trust with plaintext data. Security relies on cryptographic controls rather than network perimeters.
Client-Side Execution
Cryptographic operations occur natively on the user's Android device, intended to isolate raw inputs from transit vulnerabilities.
Data Minimization
We collect only the essential metadata required for the application to function, minimizing the potential impact of data exposure.
Architecture Transparency
RozVibe's security architecture is publicly documented because privacy designs should be verifiable. Users deserve to understand how their data is protected.
Transparency is a core part of building trust. We believe users have the right to know how data is encrypted, where that encryption occurs, what assumptions the system makes, and what limitations exist within the security model.
Encryption Architecture
In our privacy-first journaling model, encryption is applied before data leaves the device. Firestore does not receive journal plaintext. Instead, Firestore stores only base64-encoded ciphertext payloads.
We rely on AES-256-GCM to protect both the confidentiality and integrity of your encrypted notes. This helps prevent tampering or passive decryption by untrusted infrastructure.
Who Manages The Encryption Keys?
A critical component of a client-side encryption model is key management. In RozVibe, keys are reconstructed locally, not retrieved from a remote server.
- The local application derives keys from user credentials and holds them temporarily in memory (RAM).
- Reconstructed keys are used for session tasks and are cleared from RAM upon logout or when the session is closed.
- Keys are generated on login and immediately wiped from RAM on logout.
- Encryption keys are **not stored** in Firestore, and are **not stored** in local SharedPreferences.
PBKDF2 Key Derivation & AES-256-GCM Flow
To transform a user's password into strong cryptographic material, RozVibe utilizes PBKDF2-HMAC-SHA256 with 100,000 iterations. This iteration count deliberately slows down the derivation process, helping protect against offline brute-force and dictionary attacks by making them computationally expensive.
Password Security
Because keys are derived directly from user credentials, your choice of password is the most critical factor in securing your journal. We recommend using a long, unique password that is not reused across other accounts. While our implementation of PBKDF2 with 100,000 iterations significantly raises the cost of dictionary attacks, it cannot fully compensate for weak, short, or compromised passwords.
The Encryption Flow:
A secure 12-byte random Initialization Vector (IV) is
generated via SecureRandom.
The plaintext journal entry is encrypted using AES-256-GCM with the derived key.
GCM mode appends a 16-byte authentication tag to verify integrity against tampering.
The IV and ciphertext are concatenated and encoded as a Base64 string for transmission and storage.
What Firestore Stores
In our client-side encryption model, Firestore acts as an encrypted cloud storage layer. It receives only base64-encoded ciphertext payloads and essential routing metadata. Firestore does not receive or store plaintext journal entries.
Below is an illustrative, simplified JSON representation of an encrypted document document schema stored in the cloud:
"entryId": "doc_8f92a",
"encryptedPayload": "BASE64_ENCODED_CIPHERTEXT_EXAMPLE",
"timestamp": 1718000000000
}
Multi-Device Sync Architecture
Multi-device sync works through deterministic key reconstruction. When logging into a secondary device, the application retrieves your unique cryptographic salt from Firestore, prompts for your password, and re-derives the identical AES key locally. This enables synchronization across your devices without storing or exposing keys on the server.
Client-Side & Blind Index Search Architecture
Search functionality poses a unique challenge in client-side encrypted systems. In RozVibe, search queries are processed locally. The current implementation relies on client-side search: the local application decrypts records into RAM and performs keyword matching entirely on-device.
To support larger journal databases efficiently, we are designing a blind index search architecture using HMAC-SHA256 token hashes. In this model, the local SQLite cache will store deterministic token hashes of words rather than plaintext journal words. This is intended to allow the local database to resolve searches without needing to decrypt the entire vault into memory, helping protect privacy bounds.
RozVibe Threat Model
This threat model describes common scenarios the architecture is designed to mitigate. It should not be interpreted as protection against every possible attack.
| Designed to Mitigate | Out of Scope / Not Mitigated |
|---|---|
| ✓ Server-side database breaches exposing journal text | ✗ Malware or spyware active on the host device |
| ✓ Backup intercept or unauthorized cloud database access | ✗ Rooted or compromised operating system security |
| ✓ Developer access to plaintext journal entries | ✗ Device physical theft while in an unlocked state |
| ✓ Firestore data intercept and exposure | ✗ Weak password choice susceptible to brute force |
Designed to Mitigate
By enforcing client-side encryption, RozVibe is designed to protect against server-side threats. A database breach or Firestore data exposure yields only AES-encrypted blobs, which are designed to be computationally infeasible to decrypt without the user's password. This architecture is intended to prevent developer access to plaintext entries and isolate user data from unauthorized cloud access.
Out of Scope / Not Mitigated
RozVibe depends on the security integrity of the host device. We cannot protect against malware on the user's device (such as keyloggers) or a compromised operating system. Similarly, if an adversary achieves device-level compromise, gains access via PIN disclosure, or has physical access to unlocked devices while the app is active, the data decrypted in memory remains vulnerable.
Security Assumptions & Limitations
Cryptography is a powerful tool for protecting data, but it operates within a larger ecosystem. The security of RozVibe depends on several assumptions and contains inherent limits:
- Device Integrity: We assume the user's device is free from active spyware, keyloggers, and malware. If the operating system is compromised, cryptographic protections can be bypassed by capturing inputs or memory contents directly.
- Operating System Sandbox: On heavily modified or rooted devices, the standard application sandbox defenses provided by Android may be weakened, increasing the risk of local database access by unauthorized apps.
- Password Entropy: The strength of the derived encryption key is limited by the password's strength. Weak, short, or common passwords can be broken by dictionary attacks if an attacker obtains the encrypted database.
- Physical Security: If an adversary gains physical access to your device while it is unlocked and the application is open, they can read your entries. Encryption protects data at rest, not active sessions.
Understanding these boundaries is crucial for maintaining a realistic security posture. No software system can eliminate every possible threat vector.
Trade-Offs We Made
In cryptography, architecture choices involve balancing security, usability, and recoverability.
The Trade-Off: The cryptographic salt used for PBKDF2 derivation is stored in Firestore alongside the encrypted payload.
The Alternative: We could have implemented a strict user-managed key backup system, requiring users to safely store a recovery key offline.
Why We Chose This: We prioritized recoverability and multi-device synchronization. Storing the salt in Firestore allows a user to log into a new device and reconstruct their keys locally using their password. While an offline key approach provides tighter boundaries, the risk of a user losing their recovery key (and irrevocably losing all their journal entries) was deemed to outweigh the risk of salt exposure, as the derived key remains protected by the entropy of the user's password.
Technology Stack
RozVibe is built using the following components to provide its security and synchronization features:
- • Framework: Flutter & Dart
- • Authentication: Firebase Authentication
- • Cloud Database: Cloud Firestore (acting as an encrypted storage relay)
- • Key Derivation: PBKDF2-HMAC-SHA256 (100,000 iterations)
- • Symmetric Encryption: AES-256-GCM
- • Local Secret Storage: flutter_secure_storage backed by Android EncryptedSharedPreferences
- • Local Database: SQLite
- • State Management: Riverpod
Future Improvements
We are continuously working to improve the application. Our roadmap includes transitioning fully to a blind index search architecture to support local search functionality in larger databases without RAM overhead. Additionally, we are exploring hardware-backed key integration options to provide additional protection for local secrets on supported devices.
RozVibe's architecture is continuously reviewed and improved. Security features evolve over time as the application matures.
Responsible Disclosure
We believe that security is an ongoing, collaborative process. We invite security researchers, cryptographers, and privacy advocates to analyze our architecture, review our implementation, and report any findings.
If you identify a potential vulnerability, please contact us securely at roninytbusiness@gmail.com. We prioritize investigating and remediating responsibly disclosed issues.
Security Frequently Asked Questions
Founder Note
"When you write a journal, you are having a conversation with yourself. The moment you suspect someone else might be listening, that conversation changes. I built RozVibe because I wanted to write honestly again. By moving the boundary of trust from legal privacy policies to cryptographic protections, RozVibe minimizes the need to trust servers with journal content while helping keep your thoughts private. Privacy is not a premium feature; it is a fundamental requirement for honest self-reflection."
— Keshav Chauhan, Founder
Related Reading
How RozVibe Encrypts Journal Entries
A technical deep dive into RozVibe's client-side cryptographic pipeline and database architecture.
Read Article →Client-Side Encryption Explained
A beginner-friendly guide comparing client-side and server-side encryption models.
Read Article →AES-256-GCM Encryption Explained
Learn how the Advanced Encryption Standard (AES) secures files and protects data authenticity.
Read Article →How Secure Journaling Works
An in-depth look at key derivation, block ciphers, and blind indexes in modern journals.
Read Article →Why Client-Side Encryption Matters
Understand why end-to-end security is essential for personal privacy and diary applications.
Read Article →Security Disclaimer
Security is a continuous process rather than a final state.
While RozVibe is designed using modern cryptographic practices and privacy-first principles, no software can guarantee protection against every possible attack scenario. Users should maintain strong passwords, keep devices updated, and follow general security best practices.