diff --git a/app/backend/encryption.js b/app/backend/encryption.js index c2488a7..b66baf9 100644 --- a/app/backend/encryption.js +++ b/app/backend/encryption.js @@ -4,7 +4,7 @@ const { Buffer } = require("buffer"); const app = { encrypt: function (data, password) { const salt = nodeCrypto.randomBytes(16); - const key = nodeCrypto.pbkdf2Sync(password, salt, 5, 32, "sha256"); + const key = nodeCrypto.pbkdf2Sync(password, salt, 100000, 32, "sha256"); const cipher = nodeCrypto.createCipheriv("aes-256-gcm", key, salt); const encryptedData = Buffer.concat([cipher.update(data), cipher.final()]); const authTag = cipher.getAuthTag(); @@ -15,7 +15,7 @@ const app = { const salt = data.subarray(0, 16); const authTag = data.subarray(16, 32); const encData = data.subarray(32, data.length); - const key = nodeCrypto.pbkdf2Sync(password, salt, 5, 32, "sha256"); + const key = nodeCrypto.pbkdf2Sync(password, salt, 100000, 32, "sha256"); const decipher = nodeCrypto.createDecipheriv("aes-256-gcm", key, salt); decipher.setAuthTag(authTag); const plainText = Buffer.concat([