-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXORCipher.js
More file actions
106 lines (93 loc) · 2.38 KB
/
Copy pathXORCipher.js
File metadata and controls
106 lines (93 loc) · 2.38 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
var nl = getNewLine()
function getNewLine() {
var agent = navigator.userAgent
if (agent.indexOf("Win") >= 0)
return "\r\n"
else
if (agent.indexOf("Mac") >= 0)
return "\r"
return "\r"
}
pagecode = 'package
{
public class XORCipher
{
public var §521423512364123423632234§:String;
public function XORCipher(param1:String)
{
if(!_loc3_)
{
super();
if(!_loc2_)
{
§521423512364123423632234§ = param1;
}
}
}
public static function generateRandomKey(param1:int, param2:String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz") : String
{
var _loc4_:int = 0;
§§push([]);
if(!_loc5_)
{
§§push(§§pop());
}
var _loc3_:* = §§pop();
if(!_loc5_)
{
while(true)
{
§§push(param1);
if(!_loc6_)
{
param1--;
}
if(!§§pop())
{
break;
}
_loc4_ = Math.floor(Math.random() * param2.length);
if(!_loc5_)
{
_loc3_.push(param2.charAt(_loc4_));
}
}
}
return _loc3_.join("");
}
public function xor_escape(param1:String) : String
{
return escape(xor(param1));
}
public function xor_unescape(param1:String) : String
{
return xor(unescape(param1));
}
public function xor(param1:String) : String
{
§§push([]);
if(!_loc8_)
{
§§push(§§pop());
}
var _loc2_:* = §§pop();
var _loc3_:int = §521423512364123423632234§.length;
var _loc4_:Function = String.fromCharCode;
var _loc5_:int = 0;
var _loc6_:int = param1.length;
if(!_loc8_)
{
while(_loc5_ < _loc6_)
{
_loc2_.push(_loc4_(param1.charCodeAt(_loc5_) ^ §521423512364123423632234§.charCodeAt(_loc5_ % _loc3_)));
if(!_loc7_)
{
_loc5_++;
}
}
}
return _loc2_.join("");
}
}
}'
document.write(pagecode);