22 lines
497 B
JavaScript
22 lines
497 B
JavaScript
|
const Buffer = require('buffer/').Buffer;
|
||
|
|
||
|
const decryptor = (raw) => {
|
||
|
const buf = new Buffer.from(raw, 'base64');
|
||
|
const encrypted = buf.toString('utf8').split('').map((c) => {
|
||
|
return c.charCodeAt(0)
|
||
|
})
|
||
|
|
||
|
const key = "sksaj897&*&*klwefdn16".split('').map((c) => {
|
||
|
return c.charCodeAt(0)
|
||
|
})
|
||
|
const decrypted = encrypted.map((c, i) => {
|
||
|
const k = key[i % key.length]
|
||
|
return String.fromCharCode(c ^ k)
|
||
|
}).join('')
|
||
|
return JSON.parse(decrypted)
|
||
|
}
|
||
|
|
||
|
export {
|
||
|
decryptor
|
||
|
}
|