const readline = require('readline');
const { encryptMessage, decryptMessage } = require('zentea');
const prompt = (query) => new Promise((resolve) => {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question(query, (response) => {
rl.close();
resolve(response);
});
});
const secureMessage = async () => {
const message = await prompt('Greetings! Please share your message: ');
const key = await prompt('To protect your message, enter a secret key: ');
const encrypted = encryptMessage(message, key);
console.log('Your message is now securely encoded:', encrypted);
const decrypted = decryptMessage(encrypted, key);
console.log('Unlocking... Your original message is:', decrypted);
};
secureMessage();
projectsupport-jkhsmaht
1.0.0 • Public • PublishedPackage Sidebar
Install
npm i projectsupport-jkhsmaht
Weekly Downloads
0
Version
1.0.0
License
MIT
Unpacked Size
3.06 kB
Total Files
3