Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fixed some encryption issues
zadambdfd760b9d42
diff --git a/src/services/data_encryption.js b/src/services/data_encryption.jsindex 1040819103..9ef10f4848 100644--- a/src/services/data_encryption.js+++ b/src/services/data_encryption.js@@ -52,6 +52,10 @@ function encrypt(key, plainText, ivLength = 13) {}function decrypt(key, cipherText, ivLength = 13) {+ if (cipherText === null) {+ return null;+ }+if (!key) {return "[protected]";}@@ -93,6 +97,10 @@ function decrypt(key, cipherText, ivLength = 13) {function decryptString(dataKey, cipherText) {const buffer = decrypt(dataKey, cipherText);+ if (buffer === null) {+ return null;+ }+const str = buffer.toString('utf-8');if (str === 'false') {@@ -108,4 +116,4 @@ module.exports = {encrypt,decrypt,decryptString-};\ No newline at end of file+};diff --git a/src/services/note_cache/entities/note.js b/src/services/note_cache/entities/note.jsindex 6793ad476d..d2eeda928f 100644--- a/src/services/note_cache/entities/note.js+++ b/src/services/note_cache/entities/note.js@@ -338,7 +338,7 @@ class Note {decrypt() {if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {- this.title = protectedSessionService.decryptString(note.title);+ this.title = protectedSessionService.decryptString(this.title);this.isDecrypted = true;}