-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
133 lines (119 loc) · 4.97 KB
/
index.html
File metadata and controls
133 lines (119 loc) · 4.97 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LWE Cipher</title>
<!-- Jquery Library -->
<script src="js/jquery-3.4.1.js"></script>
<!-- ChartJS Library -->
<script src="js/chart/Chart.js"></script>
<script src="js/lwe/LWE.js"></script>
<!-- Bootstrap Style -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<!-- Underscore Library -->
<script src="js/underscore.js"></script>
<LINK href="styles.css" rel="stylesheet" type="text/css">
<link rel="icon" href="favicon.ico">
</head>
<body>
<div class="page-header">
<h1 class="header">Learning with Errors Cipher</h1>
<text class="heading-text">A Post-Quantum cipher utilizing the
<a href="https://cims.nyu.edu/~regev/papers/lwesurvey.pdf">Learning with Errors problem</a>
by Oded Regev. To begin, generate encryption options using a security parameter.
</text>
</div>
<div class = "container">
<div class="col-xs-12 col-sm-3 sidebar-offcanvas" id="optionsPanel" role="navigation">
<div class="panel panel-default">
<div class="options-header panel-heading">
<heading>Parameters</heading>
</div>
<div class="options panel-body">
<form>
<div class="form-group">
<label for="securityInput">Security Parameter</label>
<input type="text" class="option-theme form-control" id="securityInput" placeholder="Integer.."
data-toggle="tooltip" title="An Integer which can be used to generate a secure public encryption key.
As this parameter increases, the security increases, but the encryption speed decreases.">
</div>
<button type="button" class="option-button option-theme btn btn-success"
data-toggle="tooltip" title="Generates the following options to guarantee security and
correctness based on the Security Parameter"
onclick=generateOptions()>Generate Options
</button>
</form>
</div>
<div class="options panel-body">
<form>
<div class="col-xs-6 form-group">
<label for="optionSecretInput">Secret</label>
<input type="text" class="option-theme form-control" id="optionSecretInput" placeholder="Integer..">
</div>
<div class="col-xs-6 form-group">
<label for="modulusInput">Modulus</label>
<input type="text" class="option-theme form-control" id="modulusInput" placeholder=" Prime int..">
</div>
<div class="form-group">
<label for="publicKeyAInput">Public Key (A)</label>
<input type="text" class="option-theme form-control" id="publicKeyAInput" placeholder="10 2 3 15 ..">
</div>
<div class="form-group">
<label for="errorsInput">Errors</label>
<input type="text" class="option-theme form-control" id="errorsInput" placeholder="1 3 1 5 ..">
</div>
<div class="form-group">
<label for="publicKeyBInput">Public Key (B)</label>
<button type="button" class="option-button option-theme btn btn-success"
data-toggle="tooltip" title="Generates a Public Key (B) from the Secret,
Modulus, Public Key (A), and the Errors."
onclick=generateKeyB()>Generate
</button>
<input type="text" class="option-theme form-control" id="publicKeyBInput" placeholder="7 8 4 10 ..">
</div>
<button type="button" class="col-xs-6 btn btn-primary"
data-toggle="tooltip" title="Encrypts a message using ONLY both public keys and the modulus."
onclick=LWEEncrypt()>Encrypt
</button>
<button type="button" class="col-xs-6 btn btn-primary"
data-toggle="tooltip" title="Attempts to decrypt a given message
using ONLY the Secret and Modulus."
onclick=LWEDecrypt()>Decrypt
</button>
</form>
</div>
</div>
</div>
<div class="col-xs-9" role="navigation">
<div>
<heading for="inputBox">Input</heading><br>
<textarea type="text" id="inputBox" name="inputBoxName" autofocus="true"
placeholder="Message.." rows="8" cols="50"></textarea>
</div>
<div style="text-align:center">
<button type="button" class="btn swap-button"
data-toggle="tooltip" title="Swaps the text between the input and output boxes."
onclick=swapIO()>↑ Swap ↓
</button>
</div>
<div>
<heading for="outputBox">Output</heading><br>
<textarea type="text" id="outputBox" name="outputBoxName" rows="8" cols="50"></textarea>
</div>
</div>
<canvas id="myChart" style="min-height:100px" width="150" height="30"></canvas>
<script src="js/chart/FrequencyChart.js"></script>
</div>
<!-- Footer -->
<footer class="page-footer font-small">
<!-- Copyright -->
<div class="footer-copyright text-center py-3 options footer">Created by Roy Smith:
<a href="https://github.com/roykanesmith/lwe"> GitHub Repo</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
</body>
</html>