-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrack.php
84 lines (77 loc) · 2.09 KB
/
crack.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
<?php
/*
|| Crafted with pride by Dwiky
|| ( 0 ) ( 0 )
|| |__| |__|
*/
// initialize variables
$pswd = "";
$code = "";
$error = "";
$valid = true;
$color = "#FF0000";
// if form was submit
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
// declare encrypt and decrypt funtions
require_once('vigenere.php');
// set the variables
$cphr = $_POST['cphr'];
$code = $_POST['plain'];
// check if text is provided
if (empty($_POST['cphr']))
{
$error = "Masukkan Text Bos!";
$valid = false;
}
else if (empty($_POST['cphr']))
{
$error = "Masukkan Text Bos!";
$valid = false;
}
// inputs valid
if ($valid)
{
// if encrypt button was clicked
if (isset($_POST['crack']))
{
$code = crack($cphr, $code);
$error = "Sukses Crack Cipher!";
$color = "#526F35";
}
}
}
?>
<html>
<head>
<title>Keamanan Jaringan - Vigenere Cipher</title>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="Script.js"></script>
</head>
<body>
<br><br><br>
<form action="crack.php" method="post">
<table cellpadding="5" align="center" cellpadding="2" border="7">
<caption><hr><b>D3SI Vigenere Cipher Tools</b><hr><br/>
<b><a href='index.php'>Encrypt</a> | <a href='decrypt.php'>Decrypt</a> | <a href='crack.php'>Crack</a></b>
</caption>
<tr>
<td align="center"><textarea id="box" name="cphr">Ganti dengan Ciphertext</textarea></td>
</tr>
<tr>
<td align="center"><textarea id="box" name="plain">Ganti dengan Plaintext</textarea></td>
</tr>
<tr>
<td align="center">Password: <input disabled type="text" name="pswd" id="pass" value="<?php echo htmlspecialchars($code); ?>" /></td>
</tr>
<tr>
<td><input type="submit" name="crack" class="button" value="CRACK IT NOW" onclick="validate(1)" /></td>
</tr>
<tr>
<td><center><div style="color: <?php echo htmlspecialchars($color) ?>"><?php echo htmlspecialchars($error) ?></div></center></td>
</tr>
</table>
</form>
</body>
</html>