Fixed and improved encryption handling. Also wrapping up for the day.

This commit is contained in:
Scott Idem
2025-05-16 17:29:33 -04:00
parent 8b68b0d2bb
commit f88e6cef89
5 changed files with 154 additions and 96 deletions

View File

@@ -740,7 +740,7 @@ export async function db_save_ae_obj_li__journal(
// tmp_sort_1: `${obj.original_datetime}_${obj.group}_${obj.priority}_${obj.sort}`,
// tmp_sort_2: `${obj.group}_${obj.original_datetime}_${obj.priority}_${obj.sort}`,
combined_passcode: `${obj.passcode}:${obj.private_passcode}`, // Combined Journal passcode and Journal private passcode to encrypt and decrypt Entries
combined_passcode: `${obj.passcode}:${obj.private_passcode ?? ''}`, // Combined Journal passcode and Journal private passcode to encrypt and decrypt Entries
// From SQL view
journal_entry_count: obj.journal_entry_count,

View File

@@ -101,7 +101,7 @@ export let decrypt_wrapper = async function decrypt_wrapper(
) {
if (!combined) {
console.error('No combined string provided. Returning empty string.');
return '';
return false;
}
const { iv, base64 } = split_iv_and_base64(combined);
let decrypted;
@@ -114,7 +114,7 @@ export let decrypt_wrapper = async function decrypt_wrapper(
}
} catch (error) {
console.error('Decryption failed:', error);
return '';
return false;
}
return decrypted;
}