mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 18:05:55 +01:00
data key is not encrypted with aes-cbc as well
This commit is contained in:
25
migrations/0033__change_data_key_encryption_to_cbc.js
Normal file
25
migrations/0033__change_data_key_encryption_to_cbc.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const password_encryption = require('../services/password_encryption');
|
||||
const readline = require('readline');
|
||||
|
||||
const cl = readline.createInterface(process.stdin, process.stdout);
|
||||
|
||||
function question(q) {
|
||||
return new Promise( (res, rej) => {
|
||||
cl.question( q, answer => {
|
||||
res(answer);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = async () => {
|
||||
const password = await question("Enter password: ");
|
||||
let dataKey = await password_encryption.getDecryptedDataKey(password);
|
||||
|
||||
console.log("Original data key: ", dataKey);
|
||||
|
||||
dataKey = dataKey.slice(0, 16);
|
||||
|
||||
console.log("Trimmed data key: ", dataKey);
|
||||
|
||||
await password_encryption.setDataKeyCbc(password, dataKey);
|
||||
};
|
||||
Reference in New Issue
Block a user