Files
inzerosight.github.io/index.html
2026-03-10 16:26:39 -07:00

179 lines
5.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
</head>
<body>
<div id="overbar"><p>inØsight 2.1.0<a id="homepage" href="https://github.com/planetrenox/inzerosight" target="_blank">source</a></p></div>
<textarea id="textarea" placeholder="input text here..."></textarea>
<input id="encodeButton" type="button" name="button" value="encode to clipboard"/>
<input id="decodeButton" type="button" name="button" value="decode from text"/>
<select id="encoder">
<optgroup label="Standard">
<option value="ZWUS-3">ZWUS-3</option>
<option value="ZWUS-6">ZWUS-6</option>
<option value="ZWUS-8">ZWUS-8</option>
</optgroup>
</select>
<select id="cipher">
<optgroup label="Encryption">
<option value="PLAIN">PLAIN</option>
<option value="SPECK32_64ECB">SPECK32_64ECB</option>
</optgroup>
</select>
<p id="notice">
notice: some platforms restrict Ø width characters.
</p>
<script type="module">
import zwus from 'https://cdn.jsdelivr.net/npm/zwus@2.2.0/index.js';
const textarea = document.getElementById('textarea');
const encoderDropdown = document.getElementById('encoder');
const cipherDropdown = document.getElementById('cipher');
const DESCRY = {
NO: {
PLAIN: (ptStr, base) => zwus.encodeString(ptStr, parseInt(base))
},
YES: {
PLAIN: (ptStr, base) => zwus.decodeToString(ptStr, parseInt(base))
}
};
function ACT(event) {
if (!textarea.value) {
textarea.value = 'The text box is empty.';
return;
}
const op = event.target.id === 'encodeButton' ? 'NO' : 'YES';
const base = encoderDropdown.value.split('-')[1];
const cipher = cipherDropdown.value;
// Ensure the cipher method exists in our mapping
if (DESCRY[op][cipher]) {
textarea.value = DESCRY[op][cipher](textarea.value, base);
if (op === 'NO') {
textarea.select();
document.execCommand('copy');
textarea.value = 'Copied to your clipboard.\n A copy has been placed between these brackets [' + textarea.value + ']';
}
} else {
textarea.value = "Method " + cipher + " not implemented yet, Master.";
}
}
document.getElementById('encodeButton').addEventListener('click', ACT);
document.getElementById('decodeButton').addEventListener('click', ACT);
</script>
</body>
<style>
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
font-family: 'Open Sans', sans-serif;
background-color: #002b4d;
width: 500px;
height: 320px;
line-height: 1;
border: 1.5px solid rgb(0, 126, 199);
}
#overbar {
padding: 1.5%;
font-size: 10px;
font-weight: bold;
margin-bottom: 0px;
color: rgb(229, 244, 255, 0.6);
border-bottom: 1px solid rgb(0, 126, 199, .5);
}
#homepage {
position: fixed;
text-decoration: none;
color: yellow;
right: 2.5%;
}
#textarea {
background-color: #e6e6e6;
margin: 1.5%;
width: 95.5%;
height: 69%;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
input {
font-size: 11.5px;
}
#encodeButton {
display: inline-block;
margin-bottom: 0px;
margin-left: 1.5%;
color: #002b4d;
cursor: pointer;
}
#decodeButton {
margin-bottom: 0px;
margin-left: 1.5%;
color: #002b4d;
cursor: pointer;
}
select {
display: inline-block;
margin-bottom: 0px;
margin-left: 1.5%;
color: #002b4d;
background-color: #e6e6e6;
text-align: center;
font-size: 11px;
width: 8.5em;
}
#notice {
font-size: 10px;
margin-top: 1.5%;
padding: .8% 0% 0% 1.7%;
color: rgb(229, 244, 255, 0.6);
border-top: 1px solid rgb(0, 126, 199, .5);
}
</style>
</html>