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();
zentea-kykzsloc
1.0.0 • Public • PublishedPackage Sidebar
Install
npm i zentea-kykzsloc
Weekly Downloads
1
Version
1.0.0
License
MIT
Unpacked Size
2.81 kB
Total Files
3