Relative Content

Tag Archive for node.jsencryptioncrypt

CamsPay eNach API Node.JS – Incorrect Key Length

var crypto = require(“crypto”); var algorithm = “aes-256-cbc”; var self = module.exports = { encryption: function (inputdata, key) { // Generating 16 bytes random value & convert to hex var iv = crypto.randomBytes(16); var id = “a5b459000402bd8999fac0d68ec2b90e467f358f45880ada3375d81e4819c1c1”; iv = iv.toString(“hex”); var hash = crypto.createHash(‘sha256’).update(String(key)); var hashstring = hash.toString(“hex”).substring(0, 32); var cipher = crypto.createCipheriv(algorithm, Buffer.from(hashstring, “hex”), […]

CamsPay eNach API Node.JS – Incorrect Key Length

var crypto = require(“crypto”); var algorithm = “aes-256-cbc”; var self = module.exports = { encryption: function (inputdata, key) { // Generating 16 bytes random value & convert to hex var iv = crypto.randomBytes(16); var id = “a5b459000402bd8999fac0d68ec2b90e467f358f45880ada3375d81e4819c1c1”; iv = iv.toString(“hex”); var hash = crypto.createHash(‘sha256’).update(String(key)); var hashstring = hash.toString(“hex”).substring(0, 32); var cipher = crypto.createCipheriv(algorithm, Buffer.from(hashstring, “hex”), […]