Skip to content

Commit

Permalink
Modify decrypt tool to prompt for key
Browse files Browse the repository at this point in the history
We don't want to be passing the key on the command line, this commit
modifies the tool to prompt for it
  • Loading branch information
Andrew Isherwood committed Feb 5, 2021
1 parent cceb997 commit 28daa59
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/decrypt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
const { decrypt } = require('../helpers/encryption');
const readline = require('readline');
const { decrypt } = require('../helpers/encryption');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

(async () => {
(() => {

const decrypted = await decrypt(process.argv[2]);
console.log(decrypted);
rl.question('Enter encryption key: ', async (key) => {
process.env.KEY = key;
const decrypted = await decrypt(process.argv[2]);
console.log(decrypted);
rl.close();
});

})();

0 comments on commit 28daa59

Please sign in to comment.