Skip to content

Improve note encryption with per-note KDF salt #3598

@pbek

Description

@pbek

Note encryption should stop relying on legacy weak key derivation/static salt behavior and move to a portable, self-contained encrypted-note format.

Requested changes:

  • Add a versioned encrypted note envelope that stores non-secret metadata with the ciphertext.
  • Store a per-note/per-encryption salt in the encrypted note block so synced notes remain portable across machines.
  • Use Botan PBKDF2 with stored parameters for new encrypted notes; the exact PRF should match what the bundled/system Botan builds support portably.
  • Use authenticated encryption semantics for new encrypted notes, e.g. an authenticated mode where available or encrypt-then-MAC with a random IV when using the bundled Botan feature set.
  • Keep legacy encrypted notes decryptable and migrate them by re-encrypting with the new format on save/edit where possible.
  • Avoid YAML/frontmatter for crypto metadata; the encrypted block should be self-contained.

The synced Markdown file should remain the source of truth so Nextcloud Sync continues to work without local database metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions