Revert "feat: use libsodium for all cryptography"

This reverts commit 668fe6fd33.
This commit is contained in:
thecodrr
2020-04-13 11:07:03 +05:00
parent aaf566924a
commit aaad7a4716
7 changed files with 53 additions and 30 deletions

View File

@@ -38,8 +38,7 @@ class Crypto {
return { key, salt: saltHex };
}
encrypt(password, data) {
if (typeof data === "object") data = JSON.stringify(data);
encrypt({ password, data }) {
this._throwIfNotReady();
const { key, salt } = this._deriveKey(
password,
@@ -66,7 +65,7 @@ class Crypto {
};
}
decrypt(password, { salt, iv, cipher }) {
decrypt({ password, data: { salt, iv, cipher } }) {
this._throwIfNotReady();
const { key } = this._deriveKey(
password,