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
var AES=function(key,iv){ | |
this.rc=function(l){ l=l||16; | |
var text = "", possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for(var i=0;i<l;i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} | |
this.iv =iv ||this.rc(); | |
this.key=key||this.rc(128); | |
this.decrypt = function(encryptdata) { | |
var decipher = crypto.createDecipheriv('aes-256-cbc', crypto.createHash('sha256').update(this.key).digest(), this.iv); |
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
Tsgt |