This commit is contained in:
MeowcaTheoRange 2024-10-08 21:39:20 -05:00
parent bfae46c42f
commit 2dd8c8f386

View file

@ -490,17 +490,17 @@ app.get('/updates', async (req, res) => {
const enc_key = Buffer.from(process.env.RESUME_ENCRYPTION_KEY, "hex");
app.get('/resumeEnc', async (req, res) => {
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(
"aes-256-cbc", enc_key, iv
);
// app.get('/resumeEnc', async (req, res) => {
// const iv = crypto.randomBytes(16);
// const cipher = crypto.createCipheriv(
// "aes-256-cbc", enc_key, iv
// );
let encrypted = cipher.update(req.query.text, 'utf8', 'hex');
encrypted += cipher.final('hex');
// let encrypted = cipher.update(req.query.text, 'utf8', 'hex');
// encrypted += cipher.final('hex');
res.send(encrypted + "\n" + iv.toString('hex'));
});
// res.send(encrypted + "\n" + iv.toString('hex'));
// });
function decipher(file, key) {
let hexKey;