mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-05-01 17:59:51 -05:00
changing from AES-256-CTR to AES-128-CBC for note encryption
This commit is contained in:
@@ -15,8 +15,8 @@ router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
|
||||
|
||||
for (const hist of history) {
|
||||
if (hist.is_protected) {
|
||||
hist.note_title = data_encryption.decrypt(dataKey, hist.note_title);
|
||||
hist.note_text = data_encryption.decrypt(dataKey, hist.note_text);
|
||||
hist.note_title = data_encryption.decryptCbc(dataKey, data_encryption.noteTitleIv(hist.note_history_id), hist.note_title);
|
||||
hist.note_text = data_encryption.decryptCbc(dataKey, data_encryption.noteTitleIv(hist.note_history_id), hist.note_text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
|
||||
if (detail.is_protected) {
|
||||
const dataKey = protected_session.getDataKey(req);
|
||||
|
||||
detail.note_title = data_encryption.decrypt(dataKey, detail.note_title);
|
||||
detail.note_text = data_encryption.decrypt(dataKey, detail.note_text);
|
||||
detail.note_title = data_encryption.decryptCbc(dataKey, data_encryption.noteTitleIv(noteId), detail.note_title);
|
||||
detail.note_text = data_encryption.decryptCbc(dataKey, data_encryption.noteTextIv(noteId), detail.note_text);
|
||||
}
|
||||
|
||||
res.send({
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
||||
|
||||
for (const note of notes) {
|
||||
if (note.is_protected) {
|
||||
note.note_title = data_encryption.decrypt(dataKey, note.note_title);
|
||||
note.note_title = data_encryption.decryptCbc(dataKey, data_encryption.noteTitleIv(note.note_id), note.note_title);
|
||||
}
|
||||
|
||||
note.children = [];
|
||||
|
||||
Reference in New Issue
Block a user