Last active
January 5, 2019 10:40
-
-
Save DawnImpulse/811341747c4b1940c5a4b4668d0369de to your computer and use it in GitHub Desktop.
AES Encrypt / Decrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
// function to decryt data.............. | |
var decryptInformation = function(KEY,encryptedText){ | |
const decipher = crypto.createDecipher('aes192', KEY) | |
var decrypted = decipher.update(text,'hex','utf8') | |
decrypted += decipher.final('utf8'); | |
return decrypted; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
// function to encrypt data .... | |
var encryptInformation= function(KEY,normalText){ | |
const cipher = crypto.createCipher('aes192', KEY); | |
var encrypted = cipher.update(text,'utf8', 'hex'); | |
encrypted += cipher.final('hex'); | |
return encrypted; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment