This commit is contained in:
Tben
2023-08-12 14:36:18 +01:00
parent f34d90d147
commit 16be9117e9
44 changed files with 3456 additions and 7 deletions
+11
View File
@@ -1,7 +1,18 @@
// @ts-check
const { scryptSync, createCipheriv } = require("crypto");
const { Buffer } = require("buffer");
const encrypt = ({ data, encryptionKey, encryptionSalt }) => {
if (!encryptionKey?.match(/.{8,}/)) {
console.log("Encryption key is invalid");
return data;
}
if (!encryptionSalt?.match(/.{8,}/)) {
console.log("Encryption salt is invalid");
return data;
}
const algorithm = "aes-192-cbc";
const password = encryptionKey;