Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // https://www.tools4noobs.com/online_tools/encrypt/
  2. var crypto = require('crypto'),
  3. algorithm = 'aes-128-cbc',
  4. password = '0123456789abcdef';
  5.  
  6. // module.exports.encrypt=function(text){
  7. // var cipher = crypto.createCipher(algorithm,password)
  8. // var crypted = cipher.update(text,'utf8','hex')
  9. // crypted += cipher.final('hex');
  10. // return crypted;
  11. // }
  12.  
  13. module.exports.decrypt=function(text){
  14. var decipher = crypto.createDecipher(algorithm,password)
  15. var dec = decipher.update(text,'hex','utf8')
  16. dec += decipher.final('utf8');
  17. return dec;
  18. }
  19. if(!module.parent){
  20. var text=module.exports.decrypt('8b25e846b6a2d52ad87f38f8134906c3')
  21. console.log(text)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement