About and front page overhauls, other crap.

This commit is contained in:
Aaron D. Lee
2025-12-28 22:23:20 -05:00
parent a2c4c99fcc
commit f12544fd7f
4 changed files with 175 additions and 69 deletions

View File

@@ -76,7 +76,7 @@ from stegasoo.qr_utils import (
app = Flask(__name__) app = Flask(__name__)
app.secret_key = secrets.token_hex(32) app.secret_key = secrets.token_hex(32)
app.config['MAX_CONTENT_LENGTH'] = MAX_FILE_SIZE # 10MB max upload app.config['MAX_CONTENT_LENGTH'] = MAX_FILE_SIZE # 20MB max upload
# Temporary file storage for sharing (file_id -> {data, timestamp, filename}) # Temporary file storage for sharing (file_id -> {data, timestamp, filename})
TEMP_FILES: dict[str, dict] = {} TEMP_FILES: dict[str, dict] = {}
@@ -101,9 +101,7 @@ try:
print(f"Current MAX_FILE_SIZE from constants: {MAX_FILE_SIZE}") print(f"Current MAX_FILE_SIZE from constants: {MAX_FILE_SIZE}")
print(f"Current MAX_FILE_PAYLOAD_SIZE: {MAX_FILE_PAYLOAD_SIZE}") print(f"Current MAX_FILE_PAYLOAD_SIZE: {MAX_FILE_PAYLOAD_SIZE}")
# Try to increase payload size limit (in bytes) DESIRED_PAYLOAD_SIZE = 2 * 1024 * 1024 # 2MB
# 15MB should be enough for 7.6MB files with overhead
DESIRED_PAYLOAD_SIZE = 15 * 1024 * 1024 # 15MB
# Note: You might need to patch the stegasoo module # Note: You might need to patch the stegasoo module
# if MAX_FILE_PAYLOAD_SIZE is used internally # if MAX_FILE_PAYLOAD_SIZE is used internally

View File

@@ -21,19 +21,23 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Text &amp; File Embedding</strong> — Hide messages or any file type (PDF, ZIP, documents) <strong>Text &amp; File Embedding</strong>
<br/>Hide messages or any file type (PDF, ZIP, documents)
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Multi-Factor Security</strong> — Combines photo + phrase + PIN/RSA key <strong>Multi-Factor Security</strong>
<br/>Combines photo + phrase + PIN/RSA key
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>AES-256-GCM Encryption</strong> — Military-grade authenticated encryption <strong>AES-256-GCM Encryption</strong>
<br/>Military-grade authenticated encryption
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Daily Rotating Phrases</strong> — Different passphrase each day of the week <strong>Daily Rotating Phrases</strong>
<br/>Different passphrase each day of the week
</li> </li>
</ul> </ul>
</div> </div>
@@ -41,19 +45,23 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Random Pixel Embedding</strong> — Defeats statistical steganalysis <strong>Random Pixel Embedding</strong>
<br/>Defeats statistical steganalysis
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Format Preservation</strong> — Maintains PNG/BMP lossless formats <strong>Format Preservation</strong>
<br/>Maintains PNG/BMP lossless formats
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Large Capacity</strong> — Up to {{ max_payload_kb }} KB payload, 16MP images <strong>Large Capacity</strong>
<br/>Up to {{ max_payload_kb }} KB payload, 24MP images
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-check-circle text-success me-2"></i> <i class="bi bi-check-circle text-success me-2"></i>
<strong>Zero Server Storage</strong> — Nothing saved, files auto-expire <strong>Zero Server Storage</strong>
<br/>Nothing saved, files auto-expire and are scrubbed from disk.
</li> </li>
</ul> </ul>
</div> </div>
@@ -172,6 +180,135 @@
</div> </div>
</div> </div>
<!-- REST API Card - UPDATED BASED ON CURRENT IMPLEMENTATION -->
<div class="card mb-4">
<div class="card-header">
<h5 class="mb-0"><i class="bi bi-cpu me-2"></i>REST API</h5>
</div>
<div class="card-body">
<p>
<span class="badge bg-success me-1"><i class="bi bi-check-circle"></i> FastAPI</span>
Stegasoo includes a complete REST API built with FastAPI, featuring automatic documentation,
type validation, and comprehensive error handling.
</p>
<h6 class="mt-4"><i class="bi bi-layers me-2"></i>API Endpoints</h6>
<div class="row">
<div class="col-md-6">
<ul class="small">
<li><code>POST /generate</code> Generate credentials</li>
<li><code>POST /encode</code> Encode text message (JSON)</li>
<li><code>POST /encode/file</code> Encode binary file (JSON)</li>
<li><code>POST /encode/multipart</code> Encode with file uploads</li>
<li><code>POST /decode</code> Decode message (JSON)</li>
</ul>
</div>
<div class="col-md-6">
<ul class="small">
<li><code>POST /decode/multipart</code> Decode with file uploads</li>
<li><code>POST /extract-key-from-qr</code> Extract RSA key from QR</li>
<li><code>POST /image/info</code> Get image capacity</li>
<li><code>GET /</code> API status and capabilities</li>
</ul>
</div>
</div>
<h6 class="mt-4"><i class="bi bi-file-earmark-code me-2"></i>JSON API Examples</h6>
<pre class="bg-dark p-3 rounded"><code>// Generate credentials
curl -X POST "http://localhost:8000/generate" \
-H "Content-Type: application/json" \
-d '{"use_pin": true, "use_rsa": false, "pin_length": 6, "words_per_phrase": 3}'
// Encode text message
curl -X POST "http://localhost:8000/encode" \
-H "Content-Type: application/json" \
-d '{
"message": "secret message",
"reference_photo_base64": "BASE64_ENCODED_PHOTO",
"carrier_image_base64": "BASE64_ENCODED_IMAGE",
"day_phrase": "apple forest thunder",
"pin": "123456"
}'
// Encode file (base64)
curl -X POST "http://localhost:8000/encode/file" \
-H "Content-Type: application/json" \
-d '{
"file_data_base64": "BASE64_ENCODED_FILE",
"filename": "document.pdf",
"reference_photo_base64": "BASE64_ENCODED_PHOTO",
"carrier_image_base64": "BASE64_ENCODED_IMAGE",
"day_phrase": "apple forest thunder",
"pin": "123456"
}'</code></pre>
<h6 class="mt-4"><i class="bi bi-upload me-2"></i>Multipart API Examples</h6>
<pre class="bg-dark p-3 rounded"><code># Encode text with file uploads
curl -X POST "http://localhost:8000/encode/multipart" \
-F "day_phrase=apple forest thunder" \
-F "pin=123456" \
-F "reference_photo=@photo.jpg" \
-F "carrier=@carrier.png" \
-F "message=secret" \
--output stego.png
# Encode file with QR code key
curl -X POST "http://localhost:8000/encode/multipart" \
-F "day_phrase=apple forest thunder" \
-F "pin=123456" \
-F "reference_photo=@photo.jpg" \
-F "carrier=@carrier.png" \
-F "payload_file=@document.pdf" \
-F "rsa_key_qr=@keyqr.png" \
--output stego.png
# Decode with file uploads
curl -X POST "http://localhost:8000/decode/multipart" \
-F "day_phrase=apple forest thunder" \
-F "pin=123456" \
-F "reference_photo=@photo.jpg" \
-F "stego_image=@stego.png" \
--output result.json</code></pre>
<h6 class="mt-4"><i class="bi bi-qr-code me-2"></i>QR Code Support</h6>
<p class="small">
The API can extract RSA keys from QR code images. QR code reading requires
<code>pyzbar</code> and <code>libzbar</code> system library.
</p>
<pre class="bg-dark p-3 rounded"><code># Extract key from QR code
curl -X POST "http://localhost:8000/extract-key-from-qr" \
-F "qr_image=@keyqr.png"</code></pre>
<div class="alert alert-info small mt-3">
<i class="bi bi-journal-text me-2"></i>
<strong>Interactive Documentation:</strong> When running the API server, visit
<code>/docs</code> for Swagger UI or <code>/redoc</code> for ReDoc documentation.
All endpoints include detailed schemas and example requests.
</div>
<h6 class="mt-4"><i class="bi bi-terminal me-2"></i>Command Line Interface</h6>
<p class="small">
Stegasoo also includes a full-featured CLI. Install with <code>pip install stegasoo[cli]</code>
or see the <a href="/cli">CLI documentation</a> for complete usage.
</p>
<pre class="bg-dark p-3 rounded"><code># CLI Examples
stegasoo generate --pin --words 3
stegasoo encode -r photo.jpg -c meme.png -p "phrase" --pin 123456 -m "secret"
stegasoo decode -r photo.jpg -s stego.png -p "phrase" --pin 123456
stegasoo info image.png</code></pre>
<p class="small text-muted mt-3 mb-0">
API version: {{ version }} &bull;
<span class="badge bg-{% if has_argon2 %}success{% else %}warning{% endif %} me-1">
{% if has_argon2 %}Argon2 Available{% else %}PBKDF2 Fallback{% endif %}
</span>
<span class="badge bg-{% if has_qrcode_read %}success{% else %}secondary{% endif %}">
{% if has_qrcode_read %}QR Reading Available{% else %}QR Reading Not Available{% endif %}
</span>
</p>
</div>
</div>
<div class="card mb-4"> <div class="card mb-4">
<div class="card-header"> <div class="card-header">
<h5 class="mb-0"><i class="bi bi-question-circle me-2"></i>Usage Guide</h5> <h5 class="mb-0"><i class="bi bi-question-circle me-2"></i>Usage Guide</h5>
@@ -250,7 +387,7 @@
</div> </div>
</div> </div>
<div class="card mb-4"> <div class="card">
<div class="card-header"> <div class="card-header">
<h5 class="mb-0"><i class="bi bi-speedometer2 me-2"></i>Limits &amp; Specifications</h5> <h5 class="mb-0"><i class="bi bi-speedometer2 me-2"></i>Limits &amp; Specifications</h5>
</div> </div>
@@ -259,7 +396,7 @@
<tbody> <tbody>
<tr> <tr>
<td><i class="bi bi-file-text me-2"></i>Max text message</td> <td><i class="bi bi-file-text me-2"></i>Max text message</td>
<td><strong>250,000 characters</strong> (~250 KB)</td> <td><strong>2 million characters</strong> (~2 MB)</td>
</tr> </tr>
<tr> <tr>
<td><i class="bi bi-file-earmark me-2"></i>Max file payload</td> <td><i class="bi bi-file-earmark me-2"></i>Max file payload</td>
@@ -267,11 +404,11 @@
</tr> </tr>
<tr> <tr>
<td><i class="bi bi-image me-2"></i>Max carrier image</td> <td><i class="bi bi-image me-2"></i>Max carrier image</td>
<td><strong>16 megapixels</strong> (~4000×4000)</td> <td><strong>16 megapixels</strong> (~6000×4000)</td>
</tr> </tr>
<tr> <tr>
<td><i class="bi bi-upload me-2"></i>Max upload size</td> <td><i class="bi bi-upload me-2"></i>Max upload size</td>
<td><strong>10 MB</strong></td> <td><strong>30 MB</strong></td>
</tr> </tr>
<tr> <tr>
<td><i class="bi bi-clock me-2"></i>Temp file expiry</td> <td><i class="bi bi-clock me-2"></i>Temp file expiry</td>
@@ -289,61 +426,24 @@
<td><i class="bi bi-chat-quote me-2"></i>Phrase length</td> <td><i class="bi bi-chat-quote me-2"></i>Phrase length</td>
<td><strong>3-12 words</strong> (BIP-39 wordlist)</td> <td><strong>3-12 words</strong> (BIP-39 wordlist)</td>
</tr> </tr>
<tr>
<td><i class="bi bi-cpu me-2"></i>API documentation</td>
<td><strong>/docs (Swagger)</strong> and <strong>/redoc</strong></td>
</tr>
<tr>
<td><i class="bi bi-qr-code me-2"></i>QR code support</td>
<td><strong>RSA key encoding/extraction </strong>(up to 3072 bit keys)</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="card">
<div class="card-header">
<h5 class="mb-0"><i class="bi bi-terminal me-2"></i>CLI &amp; API</h5>
</div>
<div class="card-body">
<p>Stegasoo is also available as a command-line tool and REST API:</p>
<h6 class="mt-3">Command Line</h6>
<pre class="bg-dark p-3 rounded"><code># Generate credentials
stegasoo generate --pin --rsa
# Encode a text message
stegasoo encode -r photo.jpg -c meme.png -p "apple forest thunder" --pin 123456 -m "secret"
# Encode a file
stegasoo encode -r photo.jpg -c meme.png -p "apple forest thunder" --pin 123456 -e document.pdf
# Decode (auto-detects text vs file)
stegasoo decode -r photo.jpg -s stego.png -p "apple forest thunder" --pin 123456</code></pre>
<h6 class="mt-4">REST API</h6>
<pre class="bg-dark p-3 rounded"><code># Encode with multipart upload
curl -X POST http://localhost:8000/encode/multipart \
-F "reference_photo=@photo.jpg" \
-F "carrier=@meme.png" \
-F "message=secret" \
-F "day_phrase=apple forest thunder" \
-F "pin=123456" \
--output stego.png
# Encode a file
curl -X POST http://localhost:8000/encode/multipart \
-F "reference_photo=@photo.jpg" \
-F "carrier=@meme.png" \
-F "payload_file=@document.pdf" \
-F "day_phrase=apple forest thunder" \
-F "pin=123456" \
--output stego.png</code></pre>
<p class="small text-muted mt-3 mb-0">
API documentation available at <code>/docs</code> (Swagger) or <code>/redoc</code> when running the API server.
</p>
</div>
</div>
<div class="text-center mt-4 text-muted small"> <div class="text-center mt-4 text-muted small">
<p> <p>
Stegasoo v2.1.0 &bull; Stegasoo v2.1.0 &bull;
<i class="bi bi-github me-1"></i>Open Source &bull; <i class="bi bi-github me-1"></i>Open Source &bull;
Built with Python, Flask, and cryptography Built with Python, FastAPI, and cryptography
</p> </p>
</div> </div>
</div> </div>

View File

@@ -63,7 +63,7 @@
<div class="container text-center text-muted"> <div class="container text-center text-muted">
<small> <small>
<img src="{{ url_for('static', filename='favicon.svg') }}" alt="" height="16" class="me-1" style="vertical-align: text-bottom;"> <img src="{{ url_for('static', filename='favicon.svg') }}" alt="" height="16" class="me-1" style="vertical-align: text-bottom;">
Stegasoo v2.1.0 — Hybrid Photo + Day-Phrase + PIN Steganography Stegasoo v2.1.3 — Hybrid Photo + Day-Phrase + PIN Steganography
</small> </small>
</div> </div>
</footer> </footer>

View File

@@ -20,7 +20,7 @@
<div class="card-body text-center"> <div class="card-body text-center">
<h5 class="card-title">Encode Message</h5> <h5 class="card-title">Encode Message</h5>
<p class="card-text text-muted"> <p class="card-text text-muted">
Hide your secret message inside an innocent-looking image using your daily phrase + PIN. Hide and enrypt secret data in an image like a photo or meme.
</p> </p>
</div> </div>
</div> </div>
@@ -37,7 +37,7 @@
<div class="card-body text-center"> <div class="card-body text-center">
<h5 class="card-title">Decode Message</h5> <h5 class="card-title">Decode Message</h5>
<p class="card-text text-muted"> <p class="card-text text-muted">
Extract and decrypt hidden messages from Stegasoo-encoded images using your credentials. Extract and decrypt data from Stegasoo-encoded images
</p> </p>
</div> </div>
</div> </div>
@@ -54,7 +54,7 @@
<div class="card-body text-center"> <div class="card-body text-center">
<h5 class="card-title">Generate Keys</h5> <h5 class="card-title">Generate Keys</h5>
<p class="card-text text-muted"> <p class="card-text text-muted">
Create your weekly phrase card and PIN. Memorize 21 words + 6 digits for maximum security. Create weekly phrase card with PIN and/or RSA key.
</p> </p>
</div> </div>
</div> </div>
@@ -77,17 +77,25 @@
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-chat-quote text-info me-2"></i> <i class="bi bi-chat-quote text-info me-2"></i>
<strong>Day Phrase</strong> — 3 words, different each day of the week <strong>Day Phrase</strong> — 3 to 12 words, one each day of the week
</li>
<li class="mb-2">
<i class="bi bi-key text-info me-2"></i>
<strong>RSA Key</strong> — 2048, 3072, or 4096 bit, password protected PEM or printable QR code.
</li> </li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-123 text-info me-2"></i> <i class="bi bi-123 text-info me-2"></i>
<strong>Static PIN</strong> — 6 digits, same every day <strong>Static PIN</strong> — 6-9 digits, same every day
</li> </li>
</ul> </ul>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<h6 class="text-primary"><i class="bi bi-2-circle me-2"></i>Security Features</h6> <h6 class="text-primary"><i class="bi bi-2-circle me-2"></i>Security Features</h6>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="mb-2">
<i class="bi bi-shield-check text-success me-2"></i>
Perfect for async communication and encoding/decoding on air-gapped devices.
</li>
<li class="mb-2"> <li class="mb-2">
<i class="bi bi-shield-check text-success me-2"></i> <i class="bi bi-shield-check text-success me-2"></i>
Argon2id memory-hard key derivation (256MB) Argon2id memory-hard key derivation (256MB)