ig it seems to be workan rn

This commit is contained in:
PrincessPi committed 2026-07-25 22:46:26 -06:00
1 parent a4a8fec901
commit 39d7d3afe3
3 files changed
+729 -54

No files matched your search

+533
View File
@@ -0,0 +1,533 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Princess Pi's One Time Pad Fuckery App (LOVE)</title>
<link rel="icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMWL+v/Dm+//qq/L/3XKiv9j0Xb/lryx/7So2f/ImPX/yZf2/7yh5f+uq9H/pbLE/6WyxP+trND/vKHk/82p9P/Ei/r/wJ3q/6K0wP9A4E3/Mus7/1TXZv+lssT/v57o/7qi4v+ktML/lb+s/4/Dpf+Qw6b/lcCs/6S1wf+5o+P/ypD8/8Oc7v+ls8T/bc6B/zLqPP8840n/mru1/7Gp1f+nscb/gceX/0XfU/8+4kv/YdVy/4zHoP+Uwav/p6bO/8+U///HmPT/rKzO/5LBqf9J3Vf/NuZB/5HBqP+ktML/mb2y/0jdV/8y7Dv/Mug+/zDpOv9g1XD/j8Sk/6GywP/PlP//ypb4/7Sn2v+XvrD/YtN0/zToP/+KxZ//mry0/5HCp/855UX/OOVE/4TImf9n0Hr/OeJG/5DDpv+ks8P/y5X6/8Sa8P+zqNj/mruz/3XMif8w6Tv/gsiX/5XArf+NxKL/N+ZC/0vcWv+VwKz/n7e7/4XAnv+jtcH/tKfa/8Gc7P+xqtT/oba+/5TArP9/yZP/L+g6/33Jkf+Twar/jcSi/zjlRP9X2Gf/m7q1/7Sn2f+7oeP/vaDm/8Wa8f+2pdz/nbq4/3XLif9Y1mn/g8mX/y/oOv92zIn/ksKp/47Fov8940r/Wtdp/524uP+8oOX/ypb4/8uV+v/Nl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429;
--text-main: #f472b6;
--text-muted: #c084fc;
--primary: #ec4899;
--primary-hover: #db2777;
--success-bg: rgba(112, 26, 117, 0.4);
--success-border: #c084fc;
--success-text: #f472b6;
--error-bg: rgba(153, 27, 27, 0.4);
--error-border: #f43f5e;
--error-text: #fda4af;
}
body {
font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", sans-serif;
max-width: 620px;
margin: 40px auto;
padding: 0 20px;
line-height: 1.5;
background-color: var(--bg-color);
/* Add your PNG image path/URL below */
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABhEAAATiCAYAAAC0kcIdAAAAx3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVDbDcMgDPxnio7gF2DGIQ2VukHHr8FOlFQ9ieNsw2Gcxuf9So8JQkmSq5ZWChikSaNuQsHRFyPIYg8QSmRv+TRohQBkKbadvaAlLh75uHAadlP5YqTPKGz3QnN7IP0xiod4dkQm9jBqYcTkBQyD7t+C0rRev7ANuEN9pUlcl/dp8htLtent2ZJMNBgZjJnVG+C5cuJuQoyRxQ4iF9OyGLlFJzaQf3M6kL45nVlhXAMGqAAAAYRpQ0NQSUNDIHByb2ZpbGUAAHicfZE9SMNAHMVf04qiVQc7iDhEqE52URHHUsUiWChthVYdTC79giYNSYqLo+BacPBjserg4qyrg6sgCH6AuAtOii5S4v+SQosYD4778e7e4+4dIDQqTDUDUUDVLCMVj4nZ3KrY/YoABtCHMQgSM/VEejEDz/F1Dx9f7yI8y/vcn6NfyZsM8InEUaYbFvEG8eympXPeJw6xkqQQnxNPGnRB4keuyy6/cS46LPDMkJFJzROHiMViB8sdzEqGSjxDHFZUjfKFrMsK5y3OaqXGWvfkLwzmtZU012mOIo4lJJCECBk1lFGBhQitGikmUrQf8/CPOP4kuWRylcHIsYAqVEiOH/wPfndrFqan3KRgDOh6se2PcaB7F2jWbfv72LabJ4D/GbjS2v5qA5j7JL3e1sJHwOA2cHHd1uQ94HIHGH7SJUNyJ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kZjpTZXE+CiAgIDwveG1wTU06SGlzdG9yeT4KICA8L3JkZjpEZXNjcmlwdGlvbj4KIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLine truncated
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
background-size: cover;
color: var(--text-main);
}
.card {
background-color: var(--card-bg);
border: 2px solid var(--border-color);
border-radius: 12px;
padding: 24px;
backdrop-filter: blur(8px);
box-shadow: 0 10px 30px -5px rgba(236, 72, 153, 0.3);
}
h2 {
margin-top: 0;
color: var(--primary);
font-size: 1.35rem;
letter-spacing: -0.01em;
text-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}
.form-group {
margin-bottom: 16px;
}
label {
display: block;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-main);
font-size: 0.9rem;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 8px;
font-weight: normal;
font-size: 0.85rem;
color: var(--text-muted);
cursor: pointer;
margin-top: 6px;
user-select: none;
}
.checkbox-label input[type="checkbox"] {
accent-color: var(--primary);
width: 16px;
height: 16px;
cursor: pointer;
}
input[type="number"], select {
width: 100%;
padding: 10px 12px;
box-sizing: border-box;
background-color: var(--input-bg);
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-main);
font-size: 0.95rem;
font-family: inherit;
}
input[type="number"]:disabled {
opacity: 0.5;
cursor: not-allowed;
}
input[type="file"] {
width: 100%;
padding: 8px;
box-sizing: border-box;
background-color: var(--input-bg);
border: 1px dashed var(--border-color);
border-radius: 8px;
color: var(--text-muted);
font-size: 0.85rem;
font-family: inherit;
}
input[type="file"]::file-selector-button {
background: var(--border-color);
color: var(--text-main);
border: none;
padding: 6px 12px;
border-radius: 6px;
cursor: pointer;
margin-right: 10px;
font-family: inherit;
}
input:focus, select:focus {
outline: 2px solid var(--primary);
border-color: transparent;
}
button {
width: 100%;
padding: 12px;
margin-top: 8px;
background-color: var(--primary);
color: #ffffff;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: bold;
font-family: inherit;
cursor: pointer;
transition: background-color 0.15s ease, transform 0.05s ease;
box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}
button:hover {
background-color: var(--primary-hover);
}
button:active {
transform: scale(0.98);
}
button:disabled {
opacity: 0.6;
cursor: wait;
}
.info {
margin-top: 14px;
font-size: 0.85rem;
color: var(--text-muted);
}
.progress-bar-container {
width: 100%;
background-color: var(--input-bg);
border: 1px solid var(--border-color);
border-radius: 8px;
height: 12px;
margin-top: 12px;
overflow: hidden;
display: none;
}
.progress-bar {
width: 0%;
height: 100%;
background-color: var(--primary);
transition: width 0.1s ease;
}
.status {
margin-top: 16px;
padding: 12px;
border-radius: 8px;
display: none;
font-size: 0.85rem;
line-height: 1.6;
}
.status.success {
background-color: var(--success-bg);
color: var(--success-text);
border: 1px solid var(--success-border);
}
.status.error {
background-color: var(--error-bg);
color: var(--error-text);
border: 1px solid var(--error-border);
}
</style>
</head>
<body>
<div class="card">
<h2>Princess Pi's One Time Pad Fuckery App (LOVE)</h2>
<div class="form-group">
<label for="modeSelect">Poni Mode:</label>
<select id="modeSelect">
<option value="encode-new">Encrypt Pony File (Generate New Pad)</option>
<option value="encode-existing">Encrypt Pony File (Use Existing Pad)</option>
<option value="decode-existing">Decrypt Pony File (Use Existing Pad)</option>
</select>
</div>
<div class="form-group" id="messageGroup">
<label for="messageInput">Select Pony File / Pony Message:</label>
<input type="file" id="messageInput">
</div>
<div class="form-group" id="padGroup" style="display: none;">
<label for="padInput">Select Existing Key Pad Pony (*.pad):</label>
<input type="file" id="padInput">
</div>
<div class="form-group" id="sizeGroup">
<label for="multiplier">Pony Pad Block Multiplier (X*16-bits):</label>
<input type="number" id="multiplier" min="1" value="600" placeholder="Enter an integer">
<label class="checkbox-label">
<input type="checkbox" id="autoEstimateCheck" checked>
Auto-detect pony size (+ random padding buffer)
</label>
<div class="info" id="bitCountInfo">
Generated pony pad size: 9,600 bits (1,200 bytes)
</div>
</div>
<button id="processBtn">Go, Baby, Go!</button>
<div class="progress-bar-container" id="progressContainer">
<div class="progress-bar" id="progressBar"></div>
</div>
<div id="statusBox" class="status"></div>
</div>
<!-- Inline Web Worker Script -->
<script id="workerScript" type="text/plain">
function erfc(x) {
const z = Math.abs(x);
const t = 1.0 / (1.0 + 0.5 * z);
const ans = t * Math.exp(-z * z - 1.26551223 +
t * (1.00002368 +
t * (0.37409196 +
t * (0.09678418 +
t * (-0.18628806 +
t * (0.27886807 +
t * (-1.13520398 +
t * (1.48851587 +
t * (-0.82215223 +
t * 0.17087277))))))))) ;
return x >= 0 ? ans : 2.0 - ans;
}
function runMonobitTest(uint8Array) {
let sum = 0;
const totalBits = uint8Array.length * 8;
for (let i = 0; i < uint8Array.length; i++) {
let byte = uint8Array[i];
for (let bit = 0; bit < 8; bit++) {
sum += ((byte >> bit) & 1) ? 1 : -1;
}
}
const sObs = Math.abs(sum) / Math.sqrt(totalBits);
const pValue = erfc(sObs / Math.sqrt(2));
return { passed: pValue >= 0.01, pValue: pValue };
}
self.onmessage = async (e) => {
const { mode, messageFile, padFile, targetByteCount } = e.data;
const CHUNK_SIZE = 1024 * 1024; // 1 MB Streaming Chunks
try {
if (mode === 'encode-new') {
if (messageFile.size > targetByteCount) {
self.postMessage({ error: `Message (${messageFile.size.toLocaleString()} bytes) exceeds pad size (${targetByteCount.toLocaleString()} bytes).` });
return;
}
const sampleSize = Math.min(targetByteCount, 1024 * 1024);
const sampleBuffer = new Uint8Array(sampleSize);
self.crypto.getRandomValues(sampleBuffer);
const testResult = runMonobitTest(sampleBuffer);
if (!testResult.passed) {
self.postMessage({ error: `Randomness check failed (P-value: ${testResult.pValue.toFixed(4)} < 0.01). Process aborted.` });
return;
}
const cipherChunks = [];
const padChunks = [];
let processedBytes = 0;
while (processedBytes < targetByteCount) {
const currentChunkSize = Math.min(CHUNK_SIZE, targetByteCount - processedBytes);
const padChunk = new Uint8Array(currentChunkSize);
self.crypto.getRandomValues(padChunk);
padChunks.push(padChunk.buffer);
if (processedBytes < messageFile.size) {
const msgSlice = messageFile.slice(processedBytes, processedBytes + currentChunkSize);
const msgBuffer = new Uint8Array(await msgSlice.arrayBuffer());
const cipherChunk = new Uint8Array(msgBuffer.length);
for (let i = 0; i < msgBuffer.length; i++) {
cipherChunk[i] = msgBuffer[i] ^ padChunk[i];
}
cipherChunks.push(cipherChunk.buffer);
}
processedBytes += currentChunkSize;
self.postMessage({ progress: processedBytes / targetByteCount });
}
self.postMessage({
success: true,
mode: mode,
pValue: testResult.pValue,
cipherChunks: cipherChunks,
padChunks: padChunks
}, cipherChunks.concat(padChunks));
} else {
if (messageFile.size > padFile.size) {
self.postMessage({ error: `Message length (${messageFile.size.toLocaleString()} bytes) exceeds pad length (${padFile.size.toLocaleString()} bytes).` });
return;
}
const outputChunks = [];
let processedBytes = 0;
while (processedBytes < messageFile.size) {
const currentChunkSize = Math.min(CHUNK_SIZE, messageFile.size - processedBytes);
const msgSlice = messageFile.slice(processedBytes, processedBytes + currentChunkSize);
const padSlice = padFile.slice(processedBytes, processedBytes + currentChunkSize);
const msgBuffer = new Uint8Array(await msgSlice.arrayBuffer());
const padBuffer = new Uint8Array(await padSlice.arrayBuffer());
const outChunk = new Uint8Array(msgBuffer.length);
for (let i = 0; i < msgBuffer.length; i++) {
outChunk[i] = msgBuffer[i] ^ padBuffer[i];
}
outputChunks.push(outChunk.buffer);
processedBytes += currentChunkSize;
self.postMessage({ progress: processedBytes / messageFile.size });
}
self.postMessage({
success: true,
mode: mode,
outputChunks: outputChunks
}, outputChunks);
}
} catch (err) {
self.postMessage({ error: err.message });
}
};
</script>
<script>
const modeSelect = document.getElementById('modeSelect');
const messageInput = document.getElementById('messageInput');
const padInput = document.getElementById('padInput');
const multiplierInput = document.getElementById('multiplier');
const autoEstimateCheck = document.getElementById('autoEstimateCheck');
const bitCountInfo = document.getElementById('bitCountInfo');
const processBtn = document.getElementById('processBtn');
const progressContainer = document.getElementById('progressContainer');
const progressBar = document.getElementById('progressBar');
const statusBox = document.getElementById('statusBox');
const padGroup = document.getElementById('padGroup');
const sizeGroup = document.getElementById('sizeGroup');
const workerBlob = new Blob([document.getElementById('workerScript').textContent], { type: 'text/javascript' });
let worker = new Worker(URL.createObjectURL(workerBlob));
function updateBitCountDisplay() {
const x = parseInt(multiplierInput.value, 10) || 0;
const bits = x * 16;
const bytes = bits / 8;
bitCountInfo.textContent = `Generated pad size: ${bits.toLocaleString()} bits (${bytes.toLocaleString()} bytes)`;
}
function autoEstimatePadSize() {
if (!autoEstimateCheck.checked || modeSelect.value !== 'encode-new') return;
if (messageInput.files.length > 0) {
const fileSize = messageInput.files[0].size;
const baseBlocks = Math.max(1, Math.ceil(fileSize / 2));
// Generate a secure random float multiplier between 1.10 and 1.50 (10% - 50% extra length buffer)
const randomBuf = new Uint32Array(1);
window.crypto.getRandomValues(randomBuf);
const randomFloat = 1.10 + ((randomBuf[0] % 41) / 100);
const paddedX = Math.ceil(baseBlocks * randomFloat);
multiplierInput.value = paddedX;
updateBitCountDisplay();
}
}
modeSelect.addEventListener('change', () => {
const mode = modeSelect.value;
if (mode === 'encode-new') {
padGroup.style.display = 'none';
sizeGroup.style.display = 'block';
autoEstimatePadSize();
} else {
padGroup.style.display = 'block';
sizeGroup.style.display = 'none';
}
statusBox.style.display = 'none';
});
messageInput.addEventListener('change', autoEstimatePadSize);
autoEstimateCheck.addEventListener('change', () => {
multiplierInput.disabled = autoEstimateCheck.checked;
if (autoEstimateCheck.checked) {
autoEstimatePadSize();
}
});
multiplierInput.addEventListener('input', updateBitCountDisplay);
multiplierInput.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
event.preventDefault();
processBtn.click();
}
});
multiplierInput.disabled = autoEstimateCheck.checked;
function generateRandom8Digits() {
const randomBuffer = new Uint32Array(1);
window.crypto.getRandomValues(randomBuffer);
const num = 10000000 + (randomBuffer[0] % 90000000);
return num.toString();
}
function triggerDownloadFromChunks(chunks, filename) {
const blob = new Blob(chunks, { type: 'application/octet-stream' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
processBtn.addEventListener('click', () => {
statusBox.style.display = 'none';
const mode = modeSelect.value;
if (!messageInput.files.length) {
alert('Please select an input message/file.');
return;
}
if (mode !== 'encode-new' && !padInput.files.length) {
alert('Please select an existing .pad file.');
return;
}
const messageFile = messageInput.files[0];
const padFile = padInput.files[0] || null;
const x = parseInt(multiplierInput.value, 10) || 0;
const targetByteCount = x * 2;
processBtn.disabled = true;
progressContainer.style.display = 'block';
progressBar.style.width = '0%';
worker.onmessage = (e) => {
if (e.data.progress !== undefined) {
progressBar.style.width = `${Math.round(e.data.progress * 100)}%`;
return;
}
processBtn.disabled = false;
progressContainer.style.display = 'none';
if (e.data.error) {
statusBox.className = 'status error';
statusBox.innerHTML = `<strong>Process Failed!</strong><br>${e.data.error}`;
statusBox.style.display = 'block';
return;
}
const randomPrefix = generateRandom8Digits();
if (e.data.mode === 'encode-new') {
triggerDownloadFromChunks(e.data.cipherChunks, `${randomPrefix}_${messageFile.name}.enc`);
triggerDownloadFromChunks(e.data.padChunks, `${randomPrefix}_onetime_${x}x16bits.pad`);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Encryption Complete!</strong><br>` +
`Monobit P-value: ${e.data.pValue.toFixed(4)}<br>` +
`Downloaded: Encrypted payload & matching <code>.pad</code> file.`;
} else if (e.data.mode === 'encode-existing') {
triggerDownloadFromChunks(e.data.outputChunks, `${randomPrefix}_${messageFile.name}.enc`);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Encryption Complete!</strong><br>File encrypted using supplied pad.`;
} else {
let originalName = messageFile.name.replace(/\.enc$/i, '');
triggerDownloadFromChunks(e.data.outputChunks, `decrypted_${originalName}`);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Decryption Complete!</strong><br>File decrypted using supplied pad.`;
}
statusBox.style.display = 'block';
};
worker.postMessage({
mode: mode,
messageFile: messageFile,
padFile: padFile,
targetByteCount: targetByteCount
});
});
</script>
</body>
</html>
+3 -1
View File
@@ -1,2 +1,4 @@
# One Time Pad Cipher Fuckery # One Time Pad Cipher Fuckery
for when __nearly__ impossible to crack just isnt good enoug for when __nearly__ impossible to crack just isnt good enough
**jfc im high as fuck lmao**
+193 -53
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Binary Generator with Monobit Test</title> <title>One-Time Pad Tool</title>
<style> <style>
:root { :root {
--bg-color: #030712; --bg-color: #030712;
@@ -27,7 +27,7 @@
body { body {
font-family: system-ui, -apple-system, sans-serif; font-family: system-ui, -apple-system, sans-serif;
max-width: 500px; max-width: 520px;
margin: 40px auto; margin: 40px auto;
padding: 0 20px; padding: 0 20px;
line-height: 1.5; line-height: 1.5;
@@ -47,6 +47,9 @@
font-size: 1.35rem; font-size: 1.35rem;
letter-spacing: -0.01em; letter-spacing: -0.01em;
} }
.form-group {
margin-bottom: 16px;
}
label { label {
display: block; display: block;
font-weight: 600; font-weight: 600;
@@ -54,24 +57,43 @@
color: var(--text-main); color: var(--text-main);
font-size: 0.9rem; font-size: 0.9rem;
} }
input[type="number"] { input[type="number"], select {
width: 100%; width: 100%;
padding: 10px 12px; padding: 10px 12px;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 16px;
background-color: var(--input-bg); background-color: var(--input-bg);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 6px; border-radius: 6px;
color: var(--text-main); color: var(--text-main);
font-size: 1rem; font-size: 0.95rem;
} }
input[type="number"]:focus { input[type="file"] {
width: 100%;
padding: 8px;
box-sizing: border-box;
background-color: var(--input-bg);
border: 1px dashed var(--border-color);
border-radius: 6px;
color: var(--text-muted);
font-size: 0.85rem;
}
input[type="file"]::file-selector-button {
background: var(--border-color);
color: var(--text-main);
border: none;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
margin-right: 10px;
}
input:focus, select:focus {
outline: 2px solid var(--primary); outline: 2px solid var(--primary);
border-color: transparent; border-color: transparent;
} }
button { button {
width: 100%; width: 100%;
padding: 12px; padding: 12px;
margin-top: 8px;
background-color: var(--primary); background-color: var(--primary);
color: #ffffff; color: #ffffff;
border: none; border: none;
@@ -112,37 +134,76 @@
<body> <body>
<div class="card"> <div class="card">
<h2>CSPRNG Binary Generator</h2> <h2>One-Time Pad Cipher Tool</h2>
<label for="multiplier">Enter Max Message Length (X*16-bits):</label>
<input type="number" id="multiplier" min="1" value="600" placeholder="Enter an integer">
<button id="generateBtn">Generate, Validate & Download</button> <div class="form-group">
<label for="modeSelect">Operation Mode:</label>
<div class="info" id="bitCountInfo"> <select id="modeSelect">
Total bits: 9,600 bits (1,200 bytes) <option value="encode-new">Encrypt File (Generate New Pad)</option>
<option value="encode-existing">Encrypt File (Use Existing Pad)</option>
<option value="decode-existing">Decrypt File (Use Existing Pad)</option>
</select>
</div> </div>
<div class="form-group" id="messageGroup">
<label for="messageInput">Select File / Message:</label>
<input type="file" id="messageInput">
</div>
<div class="form-group" id="padGroup" style="display: none;">
<label for="padInput">Select Existing Key Pad (.pad):</label>
<input type="file" id="padInput">
</div>
<div class="form-group" id="sizeGroup">
<label for="multiplier">Pad Block Multiplier (X*16-bits):</label>
<input type="number" id="multiplier" min="1" value="600" placeholder="Enter an integer">
<div class="info" id="bitCountInfo">
Generated pad size: 9,600 bits (1,200 bytes)
</div>
</div>
<button id="processBtn">Process & Download</button>
<div id="statusBox" class="status"></div> <div id="statusBox" class="status"></div>
</div> </div>
<script> <script>
const modeSelect = document.getElementById('modeSelect');
const messageInput = document.getElementById('messageInput');
const padInput = document.getElementById('padInput');
const multiplierInput = document.getElementById('multiplier'); const multiplierInput = document.getElementById('multiplier');
const bitCountInfo = document.getElementById('bitCountInfo'); const bitCountInfo = document.getElementById('bitCountInfo');
const generateBtn = document.getElementById('generateBtn'); const processBtn = document.getElementById('processBtn');
const statusBox = document.getElementById('statusBox'); const statusBox = document.getElementById('statusBox');
const padGroup = document.getElementById('padGroup');
const sizeGroup = document.getElementById('sizeGroup');
// Toggle visible UI controls depending on selected mode
modeSelect.addEventListener('change', () => {
const mode = modeSelect.value;
if (mode === 'encode-new') {
padGroup.style.display = 'none';
sizeGroup.style.display = 'block';
} else {
padGroup.style.display = 'block';
sizeGroup.style.display = 'none';
}
statusBox.style.display = 'none';
});
multiplierInput.addEventListener('input', () => { multiplierInput.addEventListener('input', () => {
const x = parseInt(multiplierInput.value, 10) || 0; const x = parseInt(multiplierInput.value, 10) || 0;
const bits = x * 16; const bits = x * 16;
const bytes = bits / 8; const bytes = bits / 8;
bitCountInfo.textContent = `Total bits: ${bits.toLocaleString()} bits (${bytes.toLocaleString()} bytes)`; bitCountInfo.textContent = `Generated pad size: ${bits.toLocaleString()} bits (${bytes.toLocaleString()} bytes)`;
}); });
// Trigger generator when pressing Enter inside the input field
multiplierInput.addEventListener('keydown', (event) => { multiplierInput.addEventListener('keydown', (event) => {
if (event.key === 'Enter') { if (event.key === 'Enter') {
event.preventDefault(); event.preventDefault();
generateBtn.click(); processBtn.click();
} }
}); });
@@ -171,7 +232,6 @@
for (let i = 0; i < uint8Array.length; i++) { for (let i = 0; i < uint8Array.length; i++) {
let byte = uint8Array[i]; let byte = uint8Array[i];
for (let bit = 0; bit < 8; bit++) { for (let bit = 0; bit < 8; bit++) {
// Convert bit (0 -> -1, 1 -> +1)
sum += ((byte >> bit) & 1) ? 1 : -1; sum += ((byte >> bit) & 1) ? 1 : -1;
} }
} }
@@ -179,7 +239,6 @@
const sObs = Math.abs(sum) / Math.sqrt(totalBits); const sObs = Math.abs(sum) / Math.sqrt(totalBits);
const pValue = erfc(sObs / Math.sqrt(2)); const pValue = erfc(sObs / Math.sqrt(2));
// NIST standard threshold: p-value must be >= 0.01 to pass
return { return {
passed: pValue >= 0.01, passed: pValue >= 0.01,
pValue: pValue, pValue: pValue,
@@ -188,7 +247,6 @@
}; };
} }
// Helper to generate a cryptographically secure 8-digit random integer string
function generateRandom8Digits() { function generateRandom8Digits() {
const randomBuffer = new Uint32Array(1); const randomBuffer = new Uint32Array(1);
window.crypto.getRandomValues(randomBuffer); window.crypto.getRandomValues(randomBuffer);
@@ -196,53 +254,135 @@
return num.toString(); return num.toString();
} }
generateBtn.addEventListener('click', () => { // Reads a File object into an ArrayBuffer asynchronously
statusBox.style.display = 'none'; function readFileAsBuffer(file) {
const x = parseInt(multiplierInput.value, 10); return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(new Uint8Array(reader.result));
reader.onerror = () => reject(reader.error);
reader.readAsArrayBuffer(file);
});
}
// Helper to trigger direct browser file download
function triggerDownload(uint8Array, filename) {
const blob = new Blob([uint8Array], { type: 'application/octet-stream' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
processBtn.addEventListener('click', async () => {
statusBox.style.display = 'none';
const mode = modeSelect.value;
if (!messageInput.files.length) {
alert('Please select a input message/file to process.');
return;
}
const messageFile = messageInput.files[0];
let messageData;
try {
messageData = await readFileAsBuffer(messageFile);
} catch (err) {
alert('Error reading input message file: ' + err.message);
return;
}
const randomPrefix = generateRandom8Digits();
// MODE 1: Encrypt with a newly generated CSPRNG pad
if (mode === 'encode-new') {
const x = parseInt(multiplierInput.value, 10);
if (isNaN(x) || x < 1) { if (isNaN(x) || x < 1) {
alert('Please enter a valid positive integer for X.'); alert('Please enter a valid positive integer for X.');
return; return;
} }
const byteCount = x * 2; const generatedPadByteCount = x * 2;
const buffer = new Uint8Array(byteCount); if (messageData.length > generatedPadByteCount) {
try {
// 1. Generate CSPRNG bytes
window.crypto.getRandomValues(buffer);
// 2. Perform Randomness Check
const testResult = runMonobitTest(buffer);
if (!testResult.passed) {
statusBox.className = 'status error'; statusBox.className = 'status error';
statusBox.innerHTML = `<strong>Test Failed!</strong><br>Sequence failed Monobit randomness test (P-value: ${testResult.pValue.toFixed(4)} < 0.01). Download aborted.`; statusBox.innerHTML = `<strong>Encryption Failed!</strong><br>Message size (${messageData.length.toLocaleString()} bytes) exceeds pad size (${generatedPadByteCount.toLocaleString()} bytes). Increase X.`;
statusBox.style.display = 'block'; statusBox.style.display = 'block';
return; return;
} }
// Display Success Stats const padData = new Uint8Array(generatedPadByteCount);
statusBox.className = 'status success'; window.crypto.getRandomValues(padData);
statusBox.innerHTML = `<strong>Randomness Test Passed!</strong><br>` +
`P-value: ${testResult.pValue.toFixed(4)} (&ge; 0.01)<br>` + const testResult = runMonobitTest(padData);
`Bit distribution: ${testResult.onesCount} ones out of ${testResult.totalBits} bits.`; if (!testResult.passed) {
statusBox.className = 'status error';
statusBox.innerHTML = `<strong>Randomness Check Failed!</strong><br>Generated key failed Monobit test (P-value: ${testResult.pValue.toFixed(4)} < 0.01). Process aborted.`;
statusBox.style.display = 'block'; statusBox.style.display = 'block';
return;
}
// 3. Trigger Download with random 8-digit prefix // Bitwise XOR encryption
const randomPrefix = generateRandom8Digits(); const cipherData = new Uint8Array(messageData.length);
const blob = new Blob([buffer], { type: 'application/octet-stream' }); for (let i = 0; i < messageData.length; i++) {
const url = URL.createObjectURL(blob); cipherData[i] = messageData[i] ^ padData[i];
const a = document.createElement('a'); }
a.href = url;
a.download = `${randomPrefix}_onetime_${x}x16bits.pad`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a); // Trigger downloads for both the cipher text and key pad
URL.revokeObjectURL(url); triggerDownload(cipherData, `${randomPrefix}_${messageFile.name}.enc`);
} catch (error) { triggerDownload(padData, `${randomPrefix}_onetime_${x}x16bits.pad`);
alert('An error occurred during process: ' + error.message);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Encryption Complete!</strong><br>` +
`Monobit P-value: ${testResult.pValue.toFixed(4)}<br>` +
`Downloaded: Encrypted payload and matching <code>.pad</code> key.`;
statusBox.style.display = 'block';
}
// MODE 2 & 3: Encrypt or Decrypt using a supplied .pad file
else {
if (!padInput.files.length) {
alert('Please select an existing .pad file.');
return;
}
let padData;
try {
padData = await readFileAsBuffer(padInput.files[0]);
} catch (err) {
alert('Error reading key pad file: ' + err.message);
return;
}
if (messageData.length > padData.length) {
statusBox.className = 'status error';
statusBox.innerHTML = `<strong>Process Failed!</strong><br>Payload length (${messageData.length.toLocaleString()} bytes) exceeds key pad length (${padData.length.toLocaleString()} bytes).`;
statusBox.style.display = 'block';
return;
}
// Bitwise XOR operation (Symmetric)
const outputData = new Uint8Array(messageData.length);
for (let i = 0; i < messageData.length; i++) {
outputData[i] = messageData[i] ^ padData[i];
}
if (mode === 'encode-existing') {
triggerDownload(outputData, `${randomPrefix}_${messageFile.name}.enc`);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Encryption Complete!</strong><br>File encrypted using supplied key pad.`;
} else {
// Strip .enc extension if present during decryption
let originalName = messageFile.name.replace(/\.enc$/i, '');
triggerDownload(outputData, `decrypted_${originalName}`);
statusBox.className = 'status success';
statusBox.innerHTML = `<strong>Decryption Complete!</strong><br>File successfully decrypted using supplied key pad.`;
}
statusBox.style.display = 'block';
} }
}); });
</script> </script>