-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathantikey.php
202 lines (130 loc) · 5.36 KB
/
antikey.php
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<title>Alcatraz</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
<link rel="stylesheet" href="css/main.css" type="text/css" media="all" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
<style>
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
width: 100%;
margin: auto;
}
</style>
</head>
<?php
$username= $_GET['username'];
$email= $_GET['email'];
$password= $_GET['password'];
$form_name= $_GET['form_name'];
$address= $_GET['address'];
?>
<script>
var client_id="@hBKqnEf8shAADJQ";
var client_secret_key="zj7ZObhErbWgc0nS";
var formname="<?php echo $form_name= $_GET['form_name'];?>";
var username="<?php echo $form_name= $_GET['username'];?>";
var password="<?php echo $form_name= $_GET['password'];?>";
var address="<?php echo $form_name= $_GET['address'];?>";
var email="<?php echo $form_name= $_GET['email'];?>";
function isAuthenticationRequired(){
var auth;
var auth2;
var reply,reply_JSON;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
reply=this.responseText;
reply_JSON=JSON.parse(reply);
for( var i in reply_JSON.pages){
if(pagename==reply_JSON.pages[i].name){
auth=reply_JSON.pages[i].auth_required;
break;
}
}
}
};
xmlhttp.open("GET", "auth_required.txt", true);
xmlhttp.send();
}
function getHash(){
var param=username+password+client_id;
// alert(param);
var hash = 0;
if (param.length == 0) return hash;
for (i = 0; i < param.length; i++) {
char = param.charCodeAt(i);
hash = ((hash<<5)-hash)+char;
hash = hash & hash; // Convert to 32bit integer
}
if(hash<0)
hash=hash*-1;
return hash;
}
function encrypt(){
var e_username=CryptoJS.AES.encrypt(username, hash.toString());
// alert(e_username);
var e_email=CryptoJS.AES.encrypt(email, hash.toString());
var e_password=CryptoJS.AES.encrypt(password, hash.toString());
var e_address=CryptoJS.AES.encrypt(address, hash.toString());
var d_username = CryptoJS.AES.decrypt(e_username, hash.toString());
//alert(hash.toString());
// alert(d_username.toString(CryptoJS.enc.Utf8));
window.location="output_encoded.php?username="+e_username+"&email="+e_email+"&address="+e_address+"&password="+e_password+"&hash="+hash;
}
isAuthenticationRequired();
if(formname=="form1"){
var hash=getHash();
//alert(hash);
encrypt();
}
</script>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#myPage">Alcatraz</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html">HOME</a></li>
<li><a href="#about">ABOUT</a></li>
<li><a href="#services">DESIGN</a></li>
<li><a href="#view">VIEW</a></li>
<li><a href="#pricing">DEMO</a></li>
<li><a href="#contact">GITHUB</a></li>
</ul>
</div>
</div>
</nav>
<br><br><br><br>
<h1>Encryption not required</h1>
<div>
Username : <span id="username"></span><br>
Email : <span id="email"></span><br>
Password : <span id="password"></span><br>
Adress : <span id="address"></span><br>
</div>
<script type="text/javascript">
document.getElementById("username").innerHTML = username;
document.getElementById("email").innerHTML = email;
document.getElementById("password").innerHTML = password;
document.getElementById("address").innerHTML = address;
</script>
</body>
</html>