-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
149 lines (132 loc) · 4.84 KB
/
index.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
<!--
Author : Vivek Kumar
Package : Hash Code Generator
Date : 04 - April - 2019
Time : 11:50 AM
-->
<html>
<head>
<link rel="stylesheet" href="css/style.css">
</head>
<title>Hash Code Generator</title>
<body>
<?php
error_reporting(0);
/**Header */
echo "<h1 style='color:#b36718'>
<u>
<i>
<b>
<center>Hash Code Generator</center>
</b>
</i>
</u>
</h1>
<br>
<hr style='background-color:#7800ff'>";
?>
<!--Clock Timer to show current time and date. i.e- now(); -->
<center>
<div class="header">
<div id="clockbox" style="text-align:right;color:#aa4b4b;font-weight:bold;"></div>
</div>
</center>
<?php
/***Script to perform hashing of given code */
if(isset($_POST['s']))
{
$st=$_POST['st']; //Receive the given Input String
$ha=$_POST['ha']; //Selected encryption method
$a="$ha";
$co=hash($a,$st); //Hash Operation
$br3=str_repeat("<br>",3);
$br2=str_repeat("<br>",2);
/***Displaying the Formatted Output Message */
$msg =" <centre>
<h2 style='color:#307fa1'> Your ( $ha ) Hash Code of text ( $st ) is = </h2>
</centre>";
}
?>
<!--Form Design to accept the User Input-->
<center>
<form action="" method="post">
<label>
<h3>Please Input Some Text which you want to Convert</h3>
</label>
<!--Input field to take the String to Hash.-->
<input class="form-control" type="text" name="st" required>
<br>
<br>
<hr style="background-color:#7800ff">
<br>
<!--PArt of Code to Select one of available Hash Methods-->
<h2><center>Please Select The Hash Code Engine</center></h2>
<select name="ha" class="form-control" required>
<option name="ha" value="md2" selected>md2</option>
<option name="ha" value="md4">md4</option>
<option name="ha" value="md5">md5</option>
<option name="ha" value="sha1">sha1</option>
<option name="ha" value="sha224">sha224</option>
<option name="ha" value="sha256">sha256</option>
<option name="ha" value="sha384">sha384</option>
<option name="ha" value="sha512">sha512</option>
<option name="ha" value="ripemd128">ripemd128</option>
<option name="ha" value="ripemd160">ripemd160</option>
<option name="ha" value="ripemd256">ripemd256</option>
<option name="ha" value="ripemd320">ripemd320</option>
<option name="ha" value="whirlpool">whirlpool</option>
<option name="ha" value="tiger128,3">tiger128,3</option>
<option name="ha" value="tiger160,3">tiger160,3</option>
<option name="ha" value="tiger192,3">tiger192,3</option>
<option name="ha" value="tiger128,4">tiger128,4</option>
<option name="ha" value="tiger160,4">tiger160,4</option>
<option name="ha" value="tiger192,4">tiger192,4</option>
<option name="ha" value="snefru">snefru</option>
<option name="ha" value="snefru256">snefru256</option>
<option name="ha" value="gost">gost</option>
<option name="ha" value="adler32">adler32</option>
<option name="ha" value="crc32">crc32</option>
<option name="ha" value="crc32b">crc32b</option>
<option name="ha" value="fnv132">fnv132</option>
<option name="ha" value="fnv164">fnv164</option>
<option name="ha" value="joaat">joaat</option>
<option name="ha" value="haval128,3">haval128,3</option>
<option name="ha" value="haval160,3">haval160,3</option>
<option name="ha" value="haval192,3">haval192,3</option>
<option name="ha" value="haval224,3">haval224,3</option>
<option name="ha" value="haval256,3">haval256,3</option>
<option name="ha" value="haval128,4">haval128,4</option>
<option name="ha" value="haval160,4">haval160,4</option>
<option name="ha" value="haval192,4">haval192,4</option>
<option name="ha" value="haval224,4">haval224,4</option>
<option name="ha" value="haval256,4">haval256,4</option>
<option name="ha" value="haval128,5">haval128,5</option>
<option name="ha" value="haval160,5">haval160,5</option>
<option name="ha" value="haval192,5">haval192,5</option>
<option name="ha" value="haval224,5">haval224,5</option>
<option name="ha" value="haval256,5">haval256,5</option>
</select>
<br>
<br>
<input id="o" type="submit" name="s" value="Generate Code">
</form></center>
<br>
<br>
<h3 style="color:green;">
<?php
echo $msg;
print_r($co);
?>
</h3>
<?PHP echo $br3; ?>
<!--<h1>User Agent :: </h1>
<h2 style="color:#5d2ec9"><?php //echo $_SERVER['HTTP_USER_AGENT']; ?></h2>-->
<?php echo $br2; ?>
<!--Footer-->
<h4 style="background:#cac4c4;width:100%;color:#fff;text-align:right">
<a href="https://github.com/Mr-viv1gupta"><center>
© Mr-viv1gupta @ github © </center></a>
</h4>
<script type="text/javascript" src="js/date.js"></script>
</body>
</html>