Gitlab CSE Unil

index.html 23.9 KB
Newer Older
M. Chardon's avatar
M. Chardon committed
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
<!DOCTYPE html>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Vigenere</title>
        <meta name="author" content="Marion CHARDON for ESC/RISET - University of Lausanne" />
        <meta name="description" content="Free Web tool for discovering Vigenère cipher" />
        <meta name="keywords" content="Cipher, Encrypting, Vigenere" />
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="../node_modules/bootstrap3/dist/css/bootstrap.min.css" />
        <link rel="stylesheet" href="css/dashboard.css" />
        <link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" />
        <link rel="stylesheet" href="../css/logo_unil.css" />
        <link rel="stylesheet" href="css/graph.css" />
        <link rel="stylesheet" href="css/general.css" />
        <link rel="stylesheet" href="js/jquery/jquery-ui.min.css" />
        <script src="../node_modules/jquery/dist/jquery.min.js"></script>
        <script src="../node_modules/bootstrap3/dist/js/bootstrap.min.js"></script>
        <script src="js/jquery/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/controlleur.js"></script>
        <script type="text/javascript" src="js/entity/text.js"></script>
        <script type="text/javascript" src="js/entity/letter.js"></script>
        <script type="text/javascript" src="js/view.js"></script>
        <script type="text/javascript" src="js/viewCommun.js"></script>
        <script type="text/javascript" src="js/graph/d3.v3.min.js" charset="utf-8"></script>
        <script type="text/javascript" src="js/graph.js"></script>
        <script src="../js/jquery.i18n/libs/CLDRPluralRuleParser/src/CLDRPluralRuleParser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.messagestore.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.fallbacks.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.parser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.emitter.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.language.js"></script>
        <script src="js/languages.js"></script>
    </head>

    <body>
        <!--nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#"><span class="i18n" data-lang="title"></span></a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="active"><a href="#"><span class="i18n" data-lang="menu_encryption"></span></a></li>
                        <li><a href="attack.html" target="_blank"><span class="i18n" data-lang="menu_decryption"></span></a></li>
                        <li><a onclick="initCommun('en');"><img style="background: white; height:25px;" alt="English" src="images/flags/english.png"/></a></li>
                        <li><a onclick="initCommun('fr');"><img style="background: white;height:25px;" alt="Français" src="images/flags/french.png"/></a></li>
                        <li><a href="#" data-toggle="modal" data-target="#help_cleartext"><span class="i18n" data-lang="menu_help"></span></a></li>
                    </ul>
                </div>
            </div>
        </nav-->

        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container" style="max-width: none;">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="../"><img src="../img/g3761.png" alt="" style="height:28px;display: inline;"/>Cryptex - <span class="i18n" data-lang="title"></span></a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="active"><a href="#"><span class="i18n" data-lang="menu_encryption"></span></a></li>
                        <li><a href="attack.html" target="_blank"><span class="i18n" data-lang="menu_decryption"></span></a></li>
                        <li><a onclick="initCommun('en');"><img style="background: white; height:25px;" alt="English" src="../img/flags/english.png"/></a></li>
                        <li><a onclick="initCommun('fr');"><img style="background: white;height:25px;" alt="Français" src="../img/flags/french.png"/></a></li>
                        <li><a href="#" data-toggle="modal" data-target="#help_cleartext"><span class="i18n" data-lang="menu_help"></span></a></li>
                    </ul>
                </div>
            </div>
        </nav>

        <div class="container-fluid" style="margin-bottom: 70px;">
            <div class="row">
                <div class="col-sm-3" style="min-height: 680px;margin-bottom: 20px;">
                    <fieldset>
                        <legend style="font-size: 14pt; border-color: rgba(0, 0, 0, 0.3);border-radius: 0.3em 0.3em 0.3em 0.3em;border-style: solid;border-width: 1px;box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2) inset;background-color:white;padding: 4px;">
                            <i class="fa fa-fw fa-unlock"></i>
                            <strong><span class="i18n" data-lang="encrypt_title_sub1"></span></strong>
                        </legend>
                    </fieldset>
                    <div id="div_text_input" style='height: 715px;'>
                        <div id="div_text_input_accordion">
                            <h3><span class="i18n" data-lang="encrypt_title_step1"></span></h3>
                            <div>
                                <div class="panel-group">
                                    <div class="panel panel-warning">
                                        <div class="panel-heading">
                                            <h4 class="panel-title">
                                                <a data-toggle="collapse" href="#exemplediv"><span class="i18n" data-lang="example"></span></a>
                                            </h4>
                                        </div>
                                        <div id="exemplediv" class="panel-collapse collapse">
                                            <div class="panel-body">
                                                <table  class="table table-condensed table-striped" id="exempleTable"></table>
                                            </div>
                                        </div>
                                    </div>
                                </div> 
                                <textarea id="text_brut" style="width:100%;height:500px;" onchange="initPage();" class="form-control" data-lang="encrypt_title_step1_textarea_placeholder"></textarea><br/>
                                <button type="button" class="btn btn-default" onclick="normaliser();"><i class="fa fa-fw fa-paint-brush"></i> <span class="i18n" data-lang="encrypt_title_step1_btn_normalize"></span></button>
                            </div>
                            <h3><span class="i18n" data-lang="encrypt_title_step2"></span></h3>
                            <div>
                                <div class="row" style="margin-bottom: 10px;">
                                    <div class="col-sm-12">
                                        <button type="button" class="btn btn-default" onclick="calculerIC(($('#text_normalise_masque')).val(), 0);" data-toggle="tooltip" data-lang="btn_ic_legend" data-placement="right">
                                            <i class="fa fa-fw fa-bar-chart"></i> <span class="i18n" data-lang="btn_ic"></span>
                                        </button>
                                        <div class="btn-group" data-toggle="buttons" style="padding-left: 5%;">
                                            <label class="btn btn-default active" onclick="textareaBrut('text_normalise', $('#text_normalise_masque').val());" >
                                                <input type="radio" name="formatText" id="formatTextClear1" checked="checked" /><i class="fa fa-fw fa-align-justify"></i>
                                            </label>
                                            <label class="btn btn-default" onclick="textareaCol('text_normalise', $('#text_normalise_masque').val());">
                                                <input type="radio" name="formatText" id="formatTextClear2" /><i class="fa fa-th" aria-hidden="true"></i>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div id="div_text_normalise_raw">
                                    <button type="button" class="btn btn-default" onclick="normaliser();" style="margin-top:20px;">
                                        <i class="fa fa-fw fa-paint-brush"></i> <span class="i18n" data-lang="encrypt_title_step2_btn_normalize"></span>
                                    </button>
                                </div>
                                <div id="div_text_normalise_column" style="display: none;"></div>
                                <input type="hidden" id="text_normalise_masque" />
                            </div>
                        </div>
                    </div> 
                </div>
                <div class="col-sm-9" style="min-height: 680px;min-width: 400px;">
                    <fieldset>
                        <legend style="font-size: 14pt; border-color: rgba(0, 0, 0, 0.3);border-radius: 0.3em 0.3em 0.3em 0.3em;border-style: solid;border-width: 1px;box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2) inset;background-color:white;padding: 4px;">
                            <i class="fa fa-fw fa-lock"></i>
                            <strong><span class="i18n" data-lang="encrypt_title_sub2"></span></strong>
                        </legend>
                    </fieldset>
                    <div id="div_text_crypt">
                        <h3><span class="i18n" data-lang="encrypt_title_step3"></span></h3>
                        <div>
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label"><span class="i18n" data-lang="encrypt_title_step3_key"></span></label>
                                    <div class="col-sm-3">
                                        <input id="cle" class='form-control' type="text" data-lang="encrypt_title_step3_input_placeholder" maxlength="10"/>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="chiffrer" type="button" class="btn btn-default" onclick="initCle();chiffrer();">
                                            <i class="fa fa-fw fa-key"></i> <span class="i18n" data-lang="encrypt_title_step3_btn_encrypt"></span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div id="div_crypt" style="margin-top: 10px;">
                                <ul>
                                    <li><a href="#tabs-1"><span class="i18n" data-lang="encrypt_title_step3_encrypt_sub1"></span></a></li>
                                    <li><a href="#tabs-2"><span class="i18n" data-lang="encrypt_title_step3_encrypt_sub2"></span></a></li>
                                </ul>
                                <div id="tabs-1" style="height: 521px;overflow: auto;">
                                    <div class="row">
                                        <div class="col-sm-5 col-md-3" style="margin-top: 48px;">
                                            <div id="div_chiffrage_operation"></div>
                                        </div>
                                        <div class="col-sm-offset-1 col-sm-6 col-md-offset-1 col-md-8">

                                            <div class="row" style="margin-bottom: 10px;">
                                                <div class="col-sm-12">
                                                    <button type="button" class="btn btn-default" onclick="calculerIC(($('#text_chiffre_masque')).val(), 0);" data-toggle="tooltip" data-lang="btn_ic_legend" data-placement="right">
                                                        <i class="fa fa-fw fa-bar-chart"></i> <span class="i18n" data-lang="btn_ic"></span>
                                                    </button>
                                                    <button id="copy_chiffre" type="button" class="btn btn-default" onclick="copyText('text_chiffre_copy');"><i class="fa fa-fw fa-copy"></i> <span class="i18n" data-lang="btn_copy"></span></button>
                                                    <button id="send_chiffre" type="button" class="btn btn-default" onclick="sendText('text_chiffre_copy');"><i class="fa fa-fw fa-send-o"></i> <span class="i18n" data-lang="btn_send"></span></button>

                                                    <div class="btn-group" data-toggle="buttons" style="padding-left:5%;margin-bottom: 5px;">
                                                        <label class="btn btn-default active" onclick="textareaBrut('text_chiffre', $('#text_chiffre_masque').val());" >
                                                            <input type="radio" name="formatTextEncrypted" id="formatTextEncrypted1" checked="checked" /><i class="fa fa-fw fa-align-justify"></i>
                                                        </label>
                                                        <label class="btn btn-default" onclick="textareaCol('text_chiffre', $('#text_chiffre_masque').val());">
                                                            <input type="radio" name="formatTextEncrypted" id="formatTextEncrypted2" /><i class="fa fa-th" aria-hidden="true"></i>
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div id="div_text_chiffre_raw"></div>
                                            <div id="div_text_chiffre_column" style="display: none;"></div>
                                            <textarea id="text_chiffre_copy" rows="20" cols="36" readonly="readonly" style="display:none;"></textarea>
                                        </div>
                                    </div>
                                    <div>
                                        <input type="hidden" id="text_chiffre_masque" />
                                    </div>
                                </div>
                                <div id="tabs-2">
                                    <div class="row" style="margin-bottom: 5px;">
                                        <div class="col-sm-12">
                                            <span class="i18n" data-lang="nbre_colmn"></span>: <input id="colonne" type="text" style="width: 50px;" class='form-control' onclick="$(this).select();" />
                                            <button type="button" class="btn btn-default" onclick="calculerIC(($('#text_chiffre_masque')).val(), $('#colonne').val());"><i class="fa fa-fw fa-bar-chart"></i> <span class="i18n" data-lang="lib_ic_by_column"></span></button>
                                        </div>
                                    </div>
                                    <textarea id="text_chiffre_colonnes" rows="20" readonly="readonly" class='form-control'></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div id='div_ic' class="modal fade" role="dialog" >
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title"><span class="i18n" data-lang="encrypt_popup_ic_title"></span></h4>
                    </div>
                    <div class="modal-body">
                        <div id='calculIcDetail'>
                            <div class="ui-corner-all" style="padding: 0 .7em;">
                                <p><i class="fa fa-arrow-right" aria-hidden="true"></i> <span class="i18n" data-lang="encrypt_popup_ic_res"></span> <input type="text" readonly="readonly" id="ic"/></p>
                            </div>
                            <div class="panel-group">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h4 class="panel-title">
                                            <a data-toggle="collapse" href="#collapseicmore" id='linkcollapseh1'>
                                                <span class="glyphicon glyphicon-collapse-down"></span>  <span class="i18n" data-lang="see_more_details"></span>
                                            </a>
                                        </h4>
                                    </div>
                                    <div id="collapseicmore" class="panel-collapse collapse">
                                        <div class="panel-body">
                                            <b><span class="i18n" data-lang="encrypt_popup_ic_lettre_occ"></span></b>
                                            <table style="margin-bottom: 10px;margin-top: 5px;">
                                                <tr>
                                                    <td>A</td><td><input type="text" class="icX" readonly="readonly" id="icA"/></td>
                                                    <td>C</td><td><input type="text" class="icX" readonly="readonly" id="icC"/></td>
                                                    <td>E</td><td><input type="text" class="icX" readonly="readonly" id="icE"/></td>
                                                    <td>G</td><td><input type="text" class="icX" readonly="readonly" id="icG"/></td>
                                                    <td>I</td><td><input type="text" class="icX" readonly="readonly" id="icI"/></td>
                                                    <td>K</td><td><input type="text" class="icX" readonly="readonly" id="icK"/></td>
                                                    <td>M</td><td><input type="text" class="icX" readonly="readonly" id="icM"/></td>
                                                    <td>O</td><td><input type="text" class="icX" readonly="readonly" id="icO"/></td>
                                                    <td>Q</td><td><input type="text" class="icX" readonly="readonly" id="icQ"/></td>
                                                    <td>S</td><td><input type="text" class="icX" readonly="readonly" id="icS"/></td>
                                                    <td>U</td><td><input type="text" class="icX" readonly="readonly" id="icU"/></td>
                                                    <td>W</td><td><input type="text" class="icX" readonly="readonly" id="icW"/></td>
                                                    <td>Y</td><td><input type="text" class="icX" readonly="readonly" id="icY"/></td>
                                                </tr>
                                                <tr>
                                                    <td>B</td><td><input type="text" class="icX" readonly="readonly" id="icB"/></td>
                                                    <td>D</td><td><input type="text" class="icX" readonly="readonly" id="icD"/></td>
                                                    <td>F</td><td><input type="text" class="icX" readonly="readonly" id="icF"/></td>
                                                    <td>H</td><td><input type="text" class="icX" readonly="readonly" id="icH"/></td>
                                                    <td>J</td><td><input type="text" class="icX" readonly="readonly" id="icJ"/></td>
                                                    <td>L</td><td><input type="text" class="icX" readonly="readonly" id="icL"/></td>
                                                    <td>N</td><td><input type="text" class="icX" readonly="readonly" id="icN"/></td>
                                                    <td>P</td><td><input type="text" class="icX" readonly="readonly" id="icP"/></td>
                                                    <td>R</td><td><input type="text" class="icX" readonly="readonly" id="icR"/></td>
                                                    <td>T</td><td><input type="text" class="icX" readonly="readonly" id="icT"/></td>
                                                    <td>V</td><td><input type="text" class="icX" readonly="readonly" id="icV"/></td>
                                                    <td>X</td><td><input type="text" class="icX" readonly="readonly" id="icX"/></td>
                                                    <td>Z</td><td><input type="text" class="icX" readonly="readonly" id="icZ"/></td>
                                                </tr>
                                            </table>
                                            <b><span class="i18n" data-lang="encrypt_popup_ic_nb_lettre"></span></b> <input type="text" readonly="readonly" id="nbreLettres"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <hr/>
                        </div>
                        <svg id='graphic'></svg>
                    </div>   
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
                    </div>
                </div>
            </div>
        </div>


        <div id='div_table_vigi' class="modal fade" role="dialog" >
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title"><span class="i18n" data-lang="encrypt_popup_vigi_square_title"></span></h4>
                    </div>
                    <div class="modal-body">
                        <div id='div_table_vigi_int_val' style="font-weight: bold;margin-bottom: 20px;margin-left: 30px;margin-top: 10px;"></div>
                        <div id='div_table_vigi_int'></div>  
                    </div>   
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
                    </div>
                </div>
            </div>
        </div>

        <div id="contacts" class="modal fade" role="dialog"></div>
        <div id="credits" class="modal fade" role="dialog"></div>
        <div id="help_cleartext" class="modal fade" role="dialog"></div>
        <footer class="footer"></footer>

        <script type="text/javascript">
312
313
            var lang = initCookieLang();
            initCommun(lang);
M. Chardon's avatar
M. Chardon committed
314
315
316
317
318
            init();
            updateText();
        </script>
    </body>
</html>