-
Notifications
You must be signed in to change notification settings - Fork 0
/
simon.html
91 lines (76 loc) · 3.88 KB
/
simon.html
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
<!DOCTYPE html>
<html>
<head>
<title> Simon Wells Cipher </title>
<link rel="stylesheet" href="style/style.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/simon.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="index.html">Home</a>
<a href="caesar.html">Caesar Cipher</a>
<a href="playfair.html">Playfair Cipher</a>
<a href="rail.html">Rail Fence Cipher</a>
<a class="active" href="simon.html">Simon Wells Cipher</a>
</div>
<div class="navContainer">
<a href="javascript:void(0)" onclick="openNav()"><img id="navImg" src="assets/nav.png"/></a>
</div>
<div class="header">
<h1>Simon Wells Cipher</h1>
</div>
</head>
<body>
<br><br>
<br><br>
<div class="gridContainer">
<div class="cipherInput">
<br>
<label>Enter message for decryption</label><br><br>
<textarea id="encryptInput" type="text"></textarea><br>
<label>Enter text key for decryption</label><br><br>
<textarea id="encryptKey" type="text"></textarea><br>
<label class="numberKeyLabel">Enter numeric key for decryption</label><br><br>
<textarea class="numberKey" id="encryptNumericKey" type="text"></textarea>
<br>
<button onclick="encrypt()">Encrypt</button>
<br>
</div>
<div class="cipherOutput">
<br>
<label>Enter message for decryption</label><br><br>
<textarea id="decryptInput" type="text"></textarea><br>
<label>Enter text key for encryption</label><br><br>
<textarea id="decryptKey" type="text"></textarea><br>
<label class="numberKeyLabel">Enter numeric key for encryption</label><br><br>
<textarea class="numberKey" id="decryptNumericKey" type="text"></textarea>
<br>
<button onclick="decrypt()">Decrypt</button>
<br>
</div>
<div class="sidebar">
<h2>Usage:</h2>
<p>
Type the message you want to encrypt/decrypt.
</p>
<p>
The first key must be a word or phrase and the second key must be a number.
</p>
</div>
<div class="about">
<h2>How it works:</h2>
<p>
The way the Simon Wells cipher works is by taking the users message, and just like the Playfair Cipher, splits it into pairs of 2. There is no need for the letter 'x' to be inserted between letters that are the same for it does not matter in this case. Then just like the Playfair cipher, you find where each letter is positioned in the key matrix that is made out of the key phrase the user typed in. However, unlike the Playfair cipher, we find the row and column of each letter that is positioned in the key matrix and take those numbers. You are then left with numbers that for each pair of numbers represents a letter in the key matrix. Then each number gets an amount added depending on the second key the user types in which is numeric.
</p>
<p>
To decrypt you take away the amount added to each number and then find what letter each pair of number represents in the key matrix. In each pair, the first number is the row, and the second number is the column.
</p>
</div>
</div>
<footer>
Darwon Rashid Copyright © 2018
</footer>
</body>
</html>