Created
October 17, 2022 16:32
-
-
Save salman0ansari/299f96b51a1d69e99197129749d3b529 to your computer and use it in GitHub Desktop.
generate auth
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 cryptoJS = require("crypto-js") | |
function genAuth() { | |
let e = (new Date).toUTCString() | |
, t = cryptoJS.enc.Utf8.parse((!0 ? "PaRr8".split("").reverse().join("") : "") + | |
function (e) { | |
return e ? "s7Xp?".split("").reverse().join("") : "" | |
}(!0) + | |
function (e) { | |
return e ? "%#5hf".split("").reverse().join("") : "" | |
}(!0) + | |
function (e) { | |
return e ? "324SXF".split("").reverse().join("") : "" | |
}(!0) | |
+ function (e) { | |
return e ? "5te%Gk".split("").reverse().join("") : "" | |
}(!0) + function (e) { | |
return e ? "NeVxq".split("").reverse().join("") : "" | |
}(!0)) | |
, r = cryptoJS.lib.WordArray.random(16) | |
, n = cryptoJS.AES.encrypt(e, t, { | |
mode: cryptoJS.mode.CBC, | |
padding: cryptoJS.pad.Pkcs7, | |
iv: r | |
}); | |
return r.concat(n.ciphertext).toString(cryptoJS.enc.Base64) | |
} | |
console.log(genAuth()) |
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
{ | |
"name": "reverse", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"crypto-js": "^4.1.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment