oops!
This commit is contained in:
parent
bfae46c42f
commit
2dd8c8f386
1 changed files with 9 additions and 9 deletions
18
index.js
18
index.js
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue