-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
316 lines (273 loc) · 15.5 KB
/
index.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
<tag autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
<link rel="shortcut icon" type="image/png" href="css/images/favicon.png">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>VBreaker_JS</title>
<!-- Font Awesome -->
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- VBreaker CSS -->
<link href="css/vbreaker.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/shop-homepage.css" rel="stylesheet">
<!-- ChartJS Library -->
<script src="js/includes/chartjs/chart.js"></script>
<!-- Jquery Library -->
<link rel="stylesheet" href="css/jquery-ui.css">
<script src="js/includes/jquery.min.js"></script>
<script src="js/includes/jquery-ui.min.js"></script>
<!-- Tabulator -->
<link href="css/tabulator/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="js/tabulator/tabulator.min.js"></script>
<!-- Cipher Javascript Code-->
<script src="js/inputFunctions.js"></script>
<script src="js/indexOfCoincidence.js"></script>
<script src="js/frequency.js"></script>
<script src="js/ngraph.js"></script>
<script src="js/ciphers/vigenere.js"></script>
<script src="js/ciphers/columnarTransposition.js"></script>
<script src="js/ciphers/caesar.js"></script>
<script src="js/ciphers/keyword.js"></script>
<script src="js/ciphers/affine.js"></script>
<script src="js/ciphers/multiplicative.js"></script>
<script src="js/ciphers/hill.js"></script>
<!-- VBreaker Javascript Code-->
<script src="js/vbreaker.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button id= "navbutton" type="button" class="navbar-toggle" data-toggle="offcanvas" data-target=".sidebar-nav">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Cryptanalyze</a>
</div>
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div id="mainmenu">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-9">
<p class="lead">Input</p>
<p id="ioc" style="text-align:right;" hidden></p>
<div class="alert alert-danger" id="inputWarning" hidden> </div>
<textarea class="form-control" rows="8" id="input"></textarea>
<br /><i title="swap" onclick="swapInputOutput()" style="font-size: 30px" class="fa fa-arrows-v"></i><br /><br />
<p class="lead">Output</p>
<textarea class="form-control" rows="8" id="output"></textarea>
</div>
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
<p class="lead">Tools</p>
<div class="list-group">
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="list-group-item" onclick="getFrequencies_Clicked()">Get Frequencies</a>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="list-group-item" onclick="calculateIOC_Clicked()">Calculate Index of Coincidence</a>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="list-group-item" id="stripalphabets">Strip Alphabets<br/><input id="spinner" name="value" value="1"></a>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="list-group-item" id="getngraphs">Get N-Graphs<br/><input id="spinner2" name="value" value="1"></a>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="list-group-item" id="runshifter" onclick="runShifter_Clicked()">Run Shifter</a>
</div>
<p class="lead">Solve</p>
<div class="list-group">
<div class="dropdown">
<label for="cipherSelect">Choose A Cipher</label>
<select id="cipherSelect" class="form-control" onchange="cipherChange()">
<option value="Caesar">Caesar</option>
<option value="Multiplicative">Multiplicative</option>
<option value="Affine">Affine</option>
<option value="Vigenere">Vigenere</option>
<option value="Hill">Hill</option>
<option value="Columnar Transposition">Columnar Transposition</option>
</select>
</div><br/>
<div id="cipherParameters">
<div id="caesarCipher">
<label for="caesar-shift">Caesar Shift:</label>
<input type="number" name="quantity" min="1" max="26" class="form-control" id="caesar-shift" value=1>
</div>
<div id="multiplicativeCipher" class="d-none">
<label for="multiplicative">Multiplicative Key:</label>
<input type="text" class="form-control" list="multiplicativePossible" value="1" autocomplete="off" id="multiplicative">
<!-- Multiplicative Numbers: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, and 25 -->
<datalist id="multiplicativePossible">
<option value="1"></option>
<option value="3"></option>
<option value="5"></option>
<option value="7"></option>
<option value="9"></option>
<option value="11"></option>
<option value="15"></option>
<option value="17"></option>
<option value="19"></option>
<option value="21"></option>
<option value="23"></option>
<option value="25"></option>
</datalist>
</div>
<div id="vigenereCipher" class="d-none">
<label for="vigenere">Keyword:</label>
<input type="text" class="form-control" id="vigenere">
</div>
<div id="keywordCipher" class="d-none">
<label for="keyword"></label>
<input type="text" class="form-control" id="keyword">
</div>
<div id="hillCipher" class="d-none">
<label for="hillKey00">Key:</label>
<div class="hillKey">
<div style="display: flex;">
<input type="number" min="1" class="form-control" id="hillKey00">
<input type="number" min="1" class="form-control" id="hillKey01">
</div>
<div style="margin-top: 8px; display: flex;">
<input type="number" min="1" class="form-control" id="hillKey10">
<input type="number" min="1" class="form-control" id="hillKey11">
</div>
<label for="hillDeterminate">Determinant:</label>
<div id="hillDeterminate"></div>
</div>
</div>
<br/>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#cipherModal" id="btnModal" class="d-none" onclick="openModal()">Open Modal</button>
</div>
<br/>
<label class="checkbox-inline"><input type="checkbox" id="formatCheckbox" value="">Retain Formatting?</label><br/>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="btn btn-primary" onclick="encipher_Clicked()">Encipher</a>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="btn btn-primary" onclick="decipher_Clicked()">Decipher</a><br/><br/>
<a href="#" data-toggle="offcanvas" data-target=".sidebar-nav" class="btn btn-primary" onclick="clear_Clicked()">Clear</a>
</div>
</div>
</div>
</div>
<div id="frequencies" class="row" hidden>
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<a href="#" class="btn btn-primary" onclick="hideFrequenciesMenu()">Back</a>
<p class="lead" style="text-align: center;">Letter Frequencies</p>
<pre id="letterFrequencies" style="white-space: pre-wrap; word-break: break-word;"></pre>
<canvas id="frequencyChart"></canvas>
</div>
</div>
</div>
</div>
<div id="alphabets" class="row" hidden>
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div id="exTab1" class="container">
<a href="#" class="btn btn-primary" onclick="hideAlphabetsMenu()">Back</a>
<p class="lead" style="text-align: center;">Alphabets</p>
<ul id="alphabetTabs" class="nav nav-tabs">
</ul>
<div id="alphabetTabContents" class="tab-content ">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="ngraphs" class="row" hidden>
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div id="exTab2" class="container">
<a href="#" class="btn btn-primary" onclick="hideNGraphsMenu()">Back</a>
<p class="lead" style="text-align: center;">N-Graphs</p>
<ul class="nav nav-tabs">
<li class="active">
<a href="#1" data-toggle="tab">Frequency Order</a>
</li>
<li>
<a href="#2" data-toggle="tab">Alphabetical Order</a>
</li>
</ul>
<div class="tab-content ">
<div class="tab-pane active" id="1">
<h3>Sorted by Most Frequent</h3>
<pre id="ngraphmostfrequent" style="white-space: pre-wrap; word-break: break-word;"></pre>
</div>
<div class="tab-pane" id="2">
<h3>Sorted in Alphabetical Order</h3>
<pre id="ngraphalphabetical" style="white-space: pre-wrap; word-break: break-word;"></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="shifter" class="row" hidden>
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div id="exTab3" class="container">
<a href="#" class="btn btn-primary" onclick="hideShifterMenu()">Back</a>
<p class="lead" style="text-align: center;">Shifter</p>
<div style="display:flex;">
<div style="flex:.75;"><canvas id="shiftercanvas"></canvas></div>
<div style="flex:.25;margin-left: 20px;"><pre id="shiftertext"></pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="cipherModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" id="modalHeader"></h4>
<input type="number" name="quantity" min="2" max="10" class="form-control d-none" id="keywordSize" value="5" onchange="updateTable()">
</div>
<div id="cipherModalBody" class="modal-body">
<div id="columnarTable" style="width:100%"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- /.container -->
<div class="container">
<hr>
<!-- Footer -->
<footer>
<div class="row">
<div class="col-lg-12">
<small>Copyright © <script>document.write(new Date().getFullYear())</script> (James Snider, <a href="http://ivan-the-terrible.com"> Ivan Chwalik</a>, <a href="https://github.com/odherty">Patrick O'Doherty</a>, <a href="https://github.com/OGoodness" >Noah Fields</a>) </small>
<p>Site designed for CSC483 Cryptology at <a href="https://www.nku.edu">Northern Kentucky University</a></p>
<p><a href="https://github.com/OGoodness/VBreaker-JS">GitHub Repository</a></p>
</div>
</div>
</footer>
</div>
<!-- /.container -->
<!-- Bootstrap Core JavaScript -->
<script src="js/includes/bootstrap.min.js"></script>
<script src="js/ciphers/columnarTransposition.js"></script>
</body>
</html>