HTML fixes
This commit is contained in:
parent
37879ccb1b
commit
b931f18f03
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
|
@ -1,3 +1,3 @@
|
|||
require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var s=e[n]=new t.Module(n);r[n][0].call(s.exports,i,s,s.exports)}return e[n].exports}function o(r){this.id=r,this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.isParcelRequire=!0,t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({6:[function(require,module,exports) {
|
||||
require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var s=e[n]=new t.Module(n);r[n][0].call(s.exports,i,s,s.exports)}return e[n].exports}function o(r){this.id=r,this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.isParcelRequire=!0,t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({4:[function(require,module,exports) {
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","&","$"],t=exports.generatePad=function(t){for(var n=[],u=0;u<t;u++){var a=Math.floor(Math.random()*e.length);n.push(e[a])}return n},n=function(e){return e.replace(/[\s]+/g,"&").replace(/[^a-zA-Z0-9\&]/g,"$")},u=exports.encrypt=function(u){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,d=n(u).toUpperCase();return{oneTimePad:a=a||t(d.length),encryptedMessage:a.map(function(t,n){var u=d.charAt(n),a=""!==u?e.indexOf(u):e.length-1,r=e.indexOf(t);return e[(a+r)%e.length]}).join("")}},a=exports.decrypt=function(t,n){return t=t.toUpperCase(),n.map(function(n,u){for(var a=e.indexOf(t.charAt(u))-e.indexOf(n);a<0;)a+=e.length;return e[a%e.length]}).join("").replace(/\&/g," ").replace(/\$/g,"-")};window.onload=function(){document.getElementById("encryptInput").onclick=function(){var e=document.getElementById("inputError"),t=document.getElementById("input").value,a=n(document.getElementById("inputPad").value).toUpperCase(),d=""!==a?a.split(""):null;if(null!==d&&d.length<t.length)document.getElementById("inputPad").value=d.join(""),e.innerHTML="The pad must be at least as long as the input";else{e.innerHTML="";var r=u(t,d);document.getElementById("inputPad").value=r.oneTimePad.join(""),document.getElementById("encrypted").innerHTML=r.encryptedMessage}},document.getElementById("decryptInput").onclick=function(){var e=document.getElementById("encryptedInput").value,t=document.getElementById("encryptedInputPad").value.split(""),n=a(e,t);document.getElementById("decrypted").innerHTML=n},document.getElementById("padLength").oninput=function(e){parseInt(e.target.value)<1&&(e.target.value=1)},document.getElementById("generatePad").onclick=function(){var e=document.getElementById("padLength");""===e.value&&(e.value="10");var n=parseInt(e.value,10),u=t(n);document.getElementById("inputPad").value=u.join("")},document.getElementById("clearPad").onclick=function(){document.getElementById("padLength").value="",document.getElementById("inputPad").value=""}};
|
||||
},{}]},{},[6])
|
||||
},{}]},{},[4])
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,3 @@
|
|||
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>One-Time Pad Generator</title> <meta name="description" content="One-Time Pad Generator"> <link rel="stylesheet" href="2d72691b72b80268e116b606ca55ce89.css"> <link rel="stylesheet" href="f8167f18c4f78a03b0feca8921b96daa.css"> <style>pre{word-break:break-all;white-space:pre-wrap}</style> <!--[if lt IE 9]>
|
||||
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>One-Time Pad Generator</title> <meta name="description" content="One-Time Pad Generator"> <link rel="stylesheet" href="c612cd5e7d7f16f744f6cbfb390e8362.css"> <link rel="stylesheet" href="8e744682420400baa41f79ace446de2c.css"> <style>pre{word-break:break-all;white-space:pre-wrap}</style> <!--[if lt IE 9]>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
|
||||
<![endif]--> </head> <body> <div class="section"> <div class="container"> <div class="columns"> <div class="column"> <h2 class="title"> Encrypt a Message </h2> <div class="field"> <label class="label"> Your Message <div class="control"> <textarea id="input" class="textarea"></textarea> </div> </label> </div> <div class="control"> <label class="label"> One-Time Pad </label> </div> <div class="field has-addons is-small"> <div class="control"> <input class="input is-small" type="number" id="padLength" placeholder="Length"> </div> <div class="control"> <a class="button is-small" id="generatePad"> <span> Generate Pad </span> <span class="icon is-small"> <i class="fa fa-lock"></i> </span> </a> </div> <div class="control"> <a class="button is-small is-danger" id="clearPad"> <span> Clear Pad </span> <span class="icon is-small"> <i class="fa fa-asterisk"></i> </span> </a> </div> </div> <div class="control"> <textarea id="inputPad" class="textarea"></textarea> <div class="help is-danger" id="inputError"></div> </div> <div class="field"> <div class="control"> <a class="button" id="encryptInput"> <span> Encrypt </span> <span class="icon"> <i class="fa fa-lock"></i> </span> </a> </div> </div> <div class="columns"> <div class="column"> <label class="label">Encrypted Message</label> <div class="box"> <pre id="encrypted"></pre> </div> </div> </div> </div> <div class="column"> <h2 class="title"> Encrypt a Message </h2> <div class="field"> <label class="label"> Their Message <div class="control"> <textarea id="encryptedInput" class="textarea"></textarea> </div> </label> </div> <div class="field"> <label class="label"> One-Time Pad <div class="control"> <textarea id="encryptedInputPad" class="textarea"></textarea> </div> <div class="help is-error" id="inputError"></div> </label> </div> <div class="field"> <div class="control"> <a class="button" id="decryptInput"> <span> Decrypt </span> <span class="icon"> <i class="fa fa-unlock"></i> </span> </a> </div> </div> <div class="columns"> <div class="column"> <label class="label">Decrypted Message</label> <div class="box"> <pre id="decrypted"></pre> </div> </div> </div> </div> </div> </div> </div> <script src="c78a0231a6d0c69eb078bc96cafd649c.js"></script> </body> </html>
|
||||
<![endif]--> </head> <body> <div class="section"> <div class="container"> <div class="columns"> <div class="column"> <h2 class="title"> Encrypt a Message </h2> <div class="field"> <label class="label"> Your Message <div class="control"> <textarea id="input" class="textarea"></textarea> </div> </label> </div> <div class="control"> <label class="label"> One-Time Pad </label> </div> <div class="field has-addons is-small"> <div class="control"> <input class="input is-small" type="number" id="padLength" placeholder="Length"> </div> <div class="control"> <a class="button is-small" id="generatePad"> <span> Generate Pad </span> <span class="icon is-small"> <i class="fa fa-lock"></i> </span> </a> </div> <div class="control"> <a class="button is-small is-danger" id="clearPad"> <span> Clear Pad </span> <span class="icon is-small"> <i class="fa fa-asterisk"></i> </span> </a> </div> </div> <div class="control"> <textarea id="inputPad" class="textarea"></textarea> <div class="help is-danger" id="inputError"></div> </div> <div class="field"> <div class="control"> <a class="button" id="encryptInput"> <span> Encrypt </span> <span class="icon"> <i class="fa fa-lock"></i> </span> </a> </div> </div> <div class="columns"> <div class="column"> <label class="label">Encrypted Message</label> <div class="box"> <pre id="encrypted"></pre> </div> </div> </div> </div> <div class="column"> <h2 class="title"> Decrypt a Message </h2> <div class="field"> <label class="label"> Their Message <div class="control"> <textarea id="encryptedInput" class="textarea"></textarea> </div> </label> </div> <div class="field"> <label class="label"> One-Time Pad <div class="control"> <textarea id="encryptedInputPad" class="textarea"></textarea> </div> <div class="help is-error" id="inputError"></div> </label> </div> <div class="field"> <div class="control"> <a class="button" id="decryptInput"> <span> Decrypt </span> <span class="icon"> <i class="fa fa-unlock"></i> </span> </a> </div> </div> <div class="columns"> <div class="column"> <label class="label">Decrypted Message</label> <div class="box"> <pre id="decrypted"></pre> </div> </div> </div> </div> </div> </div> </div> <script src="af63cea32e54b78eeda13c0231ff431e.js"></script> </body> </html>
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>One-Time Pad Generator</title>
|
||||
<meta name="description" content="One-Time Pad Generator">
|
||||
|
@ -98,7 +99,7 @@
|
|||
|
||||
<div class="column">
|
||||
<h2 class="title">
|
||||
Encrypt a Message
|
||||
Decrypt a Message
|
||||
</h2>
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
|
|
Loading…
Reference in New Issue