Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default ivLength in dump-db tool #947

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Nriver
Copy link
Member

@Nriver Nriver commented Jan 15, 2025

The dump-db tool appears to be designed for a much older version of Trilium.

Related issue:
zadam/trilium#3017
Referencing this commit:
Commit Reference

At that time, the ivLength was incorrectly set to 13 instead of the correct value of 16. Consequently, if you attempt to use this tool to decrypt encrypted notes from the current database version, you will encounter errors because the tool's default ivLength remains at 13.

Code reference:
Source Code Reference

Error message:
Caught WRONG_FINAL_BLOCK_LENGTH, returning cipherText instead

To reproduce the issue, you can use the following test code:

npx esrun dump-db.ts --password 1234 document.db output/

To resolve this issue and ensure compatibility with the current database, the ivLength should be updated to a default value of 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant