
nodejsServerScripts.encrypt.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of encryptor Show documentation
Show all versions of encryptor Show documentation
API for encrypting and decrypting properties
The newest version!
var crypto = require('crypto');
var algorithm = 'aes-256-ctr';
var password = process.argv[2];
var message = process.argv[3];
function encrypt(text) {
var cipher = crypto.createCipher(algorithm, password);
var crypted = cipher.update(text, 'utf8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
console.log(encrypt(message));
© 2015 - 2025 Weber Informatics LLC | Privacy Policy