Architecture & Recovery
Zero-Knowledge
Recovery Protocol
Medodi is engineered with uncompromising privacy. We do not have your keys, and we cannot recover your data. Understanding the cryptographic flow is essential to ensuring you never lose access to your medical vault.
The 3 Golden Rules of Recovery
Use the same Google/Apple Account
To find your backup file, you must authenticate with the exact same cloud account you used when creating the vault.
Know your exact 24-word Phrase
The backup file is mathematically locked. Without the precise 24 words in the exact order, decryption is impossible. We cannot reset it for you.
Data is Local until you press BACKUP
This is the most critical step. Your data is stored only on your phone by default. You MUST go to Settings and manually press the Backup Now button to encrypt and upload your latest changes to the cloud before deleting the app or losing your phone.
How your data is secured
The Master Key & Recovery Phrase
When you create a Medodi vault, a cryptographic Master Key is generated locally on your device. This key is represented by your 24-word Recovery Phrase.
Behind the scenes: We use the Argon2id memory-hard key derivation function. Your 24-word phrase acts as the password, combined with a unique cryptographic kdf_salt securely stored on our Supabase servers. This process derives the final 256-bit Master Key that locks your vault. The Master Key itself never leaves your device's hardware Secure Enclave.
Encrypted Cloud Sync
When you enable Google Drive sync, your medical data is encrypted on your device before it is ever uploaded.
Behind the scenes: Medodi takes a full snapshot of your local database, encrypts it using AES-256-GCM authenticated encryption with your derived Master Key, and only then uploads the resulting opaque ciphertext. To anyone else—including Google and Medodi—the file looks like random noise. It is mathematically impossible to read without the exact 24-word phrase.
Moving to a new device
Because your encryption keys are tied to your device's Secure Enclave, moving to a new phone requires reconstructing the Master Key from scratch using your 24 words.
- 01
On your old device, go to Cloud Sync and tap Backup Now to ensure your latest data is uploaded.
- 02
Ensure you have written down your exact 24-word Recovery Phrase from the Settings menu.
- 03
On your new device, install Medodi, log in with the same account, and enter your 24-word phrase when prompted.
- 04
Connect to Google Drive. The app will fetch the encrypted backup, re-derive your Master Key, decrypt the data locally, and restore your vault.
Troubleshooting "Backup Locked"
If you receive a Decryption Failed or Backup Locked error when attempting to restore from Google Drive, it means the 24-word phrase you provided does not match the phrase that was used to encrypt the backup file.
Why this happens: If you created a new vault on a new device (generating a new 24-word phrase) instead of restoring your old one, your Master Key changed. The app correctly refuses to overwrite or read the old data because the cryptographic signatures (MACs) reject the new key.
Resolution
If you have intentionally created a new vault and wish to discard your old backup in favor of your new data, you must force an overwrite:
- Ensure the data on your current device is exactly what you want to keep.
- Navigate to Settings > Cloud Sync.
- Tap Backup Now. This will replace the old ciphertext on Google Drive with a new backup encrypted with your current Master Key.
Warning: If you lost your original 24-word phrase, the data inside the old backup file is permanently lost. Overwriting it is the only way to re-enable cloud sync for your new vault.