mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
feat: use libsodium for all cryptography
This commit is contained in:
@@ -38,7 +38,8 @@ class Crypto {
|
||||
return { key, salt: saltHex };
|
||||
}
|
||||
|
||||
encrypt({ password, data }) {
|
||||
encrypt(password, data) {
|
||||
if (typeof data === "object") data = JSON.stringify(data);
|
||||
this._throwIfNotReady();
|
||||
const { key, salt } = this._deriveKey(
|
||||
password,
|
||||
@@ -65,7 +66,7 @@ class Crypto {
|
||||
};
|
||||
}
|
||||
|
||||
decrypt({ password, data: { salt, iv, cipher } }) {
|
||||
decrypt(password, { salt, iv, cipher }) {
|
||||
this._throwIfNotReady();
|
||||
const { key } = this._deriveKey(
|
||||
password,
|
||||
|
||||
Reference in New Issue
Block a user