-
Notifications
You must be signed in to change notification settings - Fork 12
/
fpalgo.js
57 lines (41 loc) · 1.78 KB
/
fpalgo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
function processFingerprint(_0x4a761c) {
var _0x2ce575;
var _0x40db03 = unescape(encodeURIComponent(JSON.stringify(_0x4a761c)));
var _0x16633c = [];
var _0x446316 = 0;
var _0x2e8cf0 = '';
for (var _0x477886 = 0; _0x477886 < 256; _0x477886++) {
_0x16633c[_0x477886] = _0x477886;
}
for (var _0x59729b = 0; _0x59729b < 256; _0x59729b++) {
_0x446316 = (_0x446316 + _0x16633c[_0x59729b] + "FZMÛSê/·V«xÞhí¢³4<`ô2ª,µ¦Yû".charCodeAt(_0x59729b % "FZMÛSê/·V«xÞhí¢³4<`ô2ª,µ¦Yû".length)) % 256;
_0x2ce575 = _0x16633c[_0x59729b];
_0x16633c[_0x59729b] = _0x16633c[_0x446316];
_0x16633c[_0x446316] = _0x2ce575;
}
var _0x710ce1 = 0;
_0x446316 = 0;
for (var _0x16418d = 0; _0x16418d < _0x40db03.length; _0x16418d++) {
_0x446316 = (_0x446316 + _0x16633c[_0x710ce1 = (_0x710ce1 + 1) % 256]) % 256;
_0x2ce575 = _0x16633c[_0x710ce1];
_0x16633c[_0x710ce1] = _0x16633c[_0x446316];
_0x16633c[_0x446316] = _0x2ce575;
_0x2e8cf0 += String.fromCharCode(_0x40db03.charCodeAt(_0x16418d) ^ _0x16633c[(_0x16633c[_0x710ce1] + _0x16633c[_0x446316]) % 256]);
}
return btoa(_0x2e8cf0);
}
app.post('/process_fingerprint', (req, res) => {
const data = req.body;
const result = processFingerprint(data);
// console log part of the result like 100 chars
console.log("fingerprint result: ", result.substring(0, 100));
res.json({ result });
});
const port = 3000;
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});