diff --git a/frontends/web/app.py b/frontends/web/app.py index 9cfc79b..41e5cba 100644 --- a/frontends/web/app.py +++ b/frontends/web/app.py @@ -76,7 +76,7 @@ from stegasoo.qr_utils import ( app = Flask(__name__) 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}) 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_PAYLOAD_SIZE: {MAX_FILE_PAYLOAD_SIZE}") - # Try to increase payload size limit (in bytes) - # 15MB should be enough for 7.6MB files with overhead - DESIRED_PAYLOAD_SIZE = 15 * 1024 * 1024 # 15MB + DESIRED_PAYLOAD_SIZE = 2 * 1024 * 1024 # 2MB # Note: You might need to patch the stegasoo module # if MAX_FILE_PAYLOAD_SIZE is used internally diff --git a/frontends/web/templates/about.html b/frontends/web/templates/about.html index c275f0e..bb1f517 100644 --- a/frontends/web/templates/about.html +++ b/frontends/web/templates/about.html @@ -21,19 +21,23 @@
+ FastAPI + Stegasoo includes a complete REST API built with FastAPI, featuring automatic documentation, + type validation, and comprehensive error handling. +
+ +POST /generate – Generate credentialsPOST /encode – Encode text message (JSON)POST /encode/file – Encode binary file (JSON)POST /encode/multipart – Encode with file uploadsPOST /decode – Decode message (JSON)POST /decode/multipart – Decode with file uploadsPOST /extract-key-from-qr – Extract RSA key from QRPOST /image/info – Get image capacityGET / – API status and capabilities// 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"
+ }'
+
+ # 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
+
+
+ The API can extract RSA keys from QR code images. QR code reading requires
+ pyzbar and libzbar system library.
+
# Extract key from QR code
+curl -X POST "http://localhost:8000/extract-key-from-qr" \
+ -F "qr_image=@keyqr.png"
+
+ /docs for Swagger UI or /redoc for ReDoc documentation.
+ All endpoints include detailed schemas and example requests.
+
+ Stegasoo also includes a full-featured CLI. Install with pip install stegasoo[cli]
+ or see the CLI documentation for complete usage.
+
# 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
+
+ + API version: {{ version }} • + + {% if has_argon2 %}Argon2 Available{% else %}PBKDF2 Fallback{% endif %} + + + {% if has_qrcode_read %}QR Reading Available{% else %}QR Reading Not Available{% endif %} + +
+Stegasoo is also available as a command-line tool and REST API:
- -# 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
-
- # 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
-
-
- API documentation available at /docs (Swagger) or /redoc when running the API server.
-
Stegasoo v2.1.0 • Open Source • - Built with Python, Flask, and cryptography + Built with Python, FastAPI, and cryptography
- 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.
- Extract and decrypt hidden messages from Stegasoo-encoded images using your credentials. + Extract and decrypt data from Stegasoo-encoded images
- 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.