Docs

Protected Notes

Trilium is designed to store a wide variety of data, including sensitive information such as personal journals, credentials, or confidential documents. To safeguard this type of content, Trilium offers the option to protect notes, which involves the following measures:

Using Protected Notes

By default, notes are unprotected. To protect a note, simply click on the shield icon next to the note’s title, as shown here:

example animation of unlocking protected notes

What is Encrypted?

Trilium encrypts the data within protected notes but not their metadata. Specifically:

Encrypted:

Not encrypted:

Encryption Details

The following steps outline how encryption and decryption work in Trilium:

  1. The user enters a password.
  2. The password is passed through the scrypt algorithm along with a “password verification” salt to confirm that the password is correct.
  3. The password is then processed again through scrypt with an “encryption” salt, which generates a hash.
    • Scrypt is used for key stretching to make the password harder to guess.
  4. The generated hash is used to decrypt the actual data encryption key.
    • The data encryption key is encrypted using AES-128 with a random IV.
    • The data encryption key is randomly generated during the database initialization and remains constant throughout the document’s lifetime. When the password is changed, only this key is re-encrypted.
  5. The data encryption key is then used to decrypt the actual content of the note, including its title and body.
    • The encryption algorithm used is AES-128 with CBC mode, where a unique IV is generated for each encryption operation and stored with the cipher text.

Sharing Protected Notes

Protected notes cannot be shared in the same way as regular notes. Their encryption ensures that only authorized users with the correct password can access them.