zentea-ypattzyw
v1.0.0
Published
Description of your project
Downloads
4
Maintainers
Readme
USAGE
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();