How to encrypt data that needs to be decrypted in node.js?

You can use the crypto module: var crypto = require(‘crypto’); var assert = require(‘assert’); var algorithm = ‘aes256’; // or any other algorithm supported by OpenSSL var key = ‘password’; var text=”I love kittens”; var cipher = crypto.createCipher(algorithm, key); var encrypted = cipher.update(text, ‘utf8’, ‘hex’) + cipher.final(‘hex’); var decipher = crypto.createDecipher(algorithm, key); var decrypted = … Read more