How your journal is encrypted

Your entries are encrypted in your browser, with a key only you can unlock, before they are saved. This page explains exactly how: the algorithms, the keys, what is encrypted and what isn't, what we can and can't see, and the limits. Trust is the whole point of this journal, so we would rather tell you the limits than overpromise.

In short

What is encrypted, and what isn't

Encrypted with your keyVisible to us and to our database host (Google Firebase)
The title of each entryYour email address, and your name if you added one
The text of each entry, with its formatting and image linksHow you sign in, and when you accepted the terms
Drafts you haven't saved, kept only on your deviceThe date of each entry, and when it was last changed
The search index, kept only on your deviceHow many entries you have
The photos you upload, and their small copiesHow many photos you have, and when each was uploaded or deleted
The size of each photo, rounded up to the next 64 KB
How much of your storage is used
The size of each entry, rounded up to the next kilobyte
When entries were deleted (their ids, not their content)
When you use the journal, and the network address you connect from
Your wrapped keys, with their salt and Argon2id settings

A photo you upload is made smaller on your device first. A photo's file also hides details you don't see when you look at it: where it was taken (often to within a few metres), when, and with which phone or camera. These are removed on your device as the photo is made smaller, so they never reach us, not even encrypted. The photo is then encrypted with a key of its own, derived from your master key, and stored in Google Cloud Storage: your entry only holds its random id. Photos you have looked at are kept on your device, still encrypted.

Pictures can also be added by their web address. Your entry stores the address encrypted, but the site that hosts the picture sees your network address when your browser loads it.

The building blocks

We use standard, well-reviewed algorithms only. Nothing here is custom cryptography.

PurposeAlgorithm
Encrypting entries and keysAES-256-GCM, with a fresh random 96-bit IV for every encryption, from your browser's built-in Web Crypto
Turning your passphrase into a keyArgon2id: 64 MiB of memory, 3 iterations, parallelism 1, random 128-bit salt, run by hash-wasm in a Web Worker
Deriving one key per purposeHKDF-SHA-256, from Web Crypto
Randomnesscrypto.getRandomValues, from Web Crypto

AES-GCM is authenticated encryption: any change to the encrypted data, or the wrong key, makes decryption fail instead of returning garbage. That is also how the app knows a passphrase is wrong.

Argon2id is deliberately slow and memory-hungry. Unlocking once costs you a moment; someone who copied our database and tries to guess your passphrase pays that cost for every single guess. The salt makes the same passphrase give a different key for every account.

The keys

In one line: your passphrase (through Argon2id) or your recovery key unlocks the master key, and the master key gives the entry key (through HKDF), which encrypts your entries.

Each wrapped key is bound to your account and to its slot (passphrase or recovery), and each encrypted entry is bound to your account and to that entry. Someone with access to the database can't move an encrypted entry into another entry or another account: decryption would fail.

Before encrypting, each saved entry is padded to a multiple of 1 KiB, so its exact length doesn't show, only its size class.

Your passphrase and your login

The encryption passphrase is separate from how you log in (password, Google or an email link).

Unlocking, and "Remember this device"

When you unlock your journal, your browser reads the wrapped master key, derives the passphrase key with Argon2id and unwraps the master key. The master key then lives in the page's memory, in a form JavaScript can use but can't read back: it can only derive other keys, which come out in the same unreadable form.

If you tick Remember this device, the master key is kept in this browser's storage (IndexedDB) in the same form, so the journal opens without your passphrase until you log out. Logging out, by any route, deletes it. Anyone who can use that browser while you are logged in can read your journal, so don't use it on a shared computer.

If you lose your passphrase or your recovery key

When you change your passphrase or recovery key, the old copy of the wrapped key is deleted (if that fails, the app tries again, or asks you to from your Profile). Two limits apply. Our database backups keep deleted data for a while (daily backups for 30 days), so for that long an old passphrase still opens an old backup copy. And the master key itself never changes: someone who copied your data earlier and knows an old passphrase or recovery key could still read the entries in that copy. Changing the master key ("key rotation") isn't supported yet.

What we can and can't see

We can't see: the title or text of any entry, your drafts, your search index, your passphrase, your recovery key or your master key.

We can see: the metadata listed in the table above, and the encrypted data itself. Our database rules reject entries that aren't in the encrypted format, but they can't check that the encrypted bytes really are encrypted. That guarantee comes from the app's code and its tests.

If we were asked for your data, by a court or anyone else, we could only hand over what we hold: the encrypted entries, the wrapped keys and the metadata.

What this protects against

What this doesn't protect against

Deleting your account

Deleting your account deletes your entries and your wrapped keys from our database. Backups keep the encrypted entries and wrapped keys until they expire, up to 30 days.

Questions, or found a problem?

If you think something here is wrong, or you have found a security issue, email contact@my-personal-journal.com. We'll reply and correct this page when it is.

My Personal Journal · How to · Blog · Security · Legal · Made by PrismaLink

My Personal Journal