Now version 2.0.1, I guess.

This commit is contained in:
Aaron D. Lee
2025-12-28 00:07:04 -05:00
parent 5c6f86a12c
commit 1538943451
5 changed files with 30 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ Host: localhost:8000
```json
{
"version": "2.0.0",
"version": "2.0.1",
"has_argon2": true,
"day_names": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
}
@@ -271,7 +271,8 @@ Content-Type: application/json
#### cURL Example
REF_B64=$(base64 -w0 reference.jpg)
```bash
# Prepare base64-encoded images
REF_B64=$(base64 -w0 reference.jpg)
CARRIER_B64=$(base64 -w0 carrier.png)
@@ -282,7 +283,8 @@ Content-Type: application/json
\"reference_photo_base64\": \"$REF_B64\",
\"carrier_image_base64\": \"$CARRIER_B64\",
\"day_phrase\": \"apple forest thunder\",
}" | jq -r '.stego_image_base64' | base64 -d > stego.png
\"pin\": \"123456\"
}" | jq -r '.stego_image_base64' | base64 -d > stego.png
```
---
@@ -360,6 +362,9 @@ Content-Type: image/png
--output stego.png
```
**With RSA key:**
```bash
curl -X POST http://localhost:8000/encode/multipart \
-F "message=Secret message" \
-F "day_phrase=apple forest thunder" \
-F "rsa_key=@mykey.pem" \
@@ -624,7 +629,8 @@ curl -X POST http://localhost:8000/image/info \
"message": "string"
}
```
### ImageInfoResponse
### ImageInfoResponse
```json
{

View File

@@ -24,6 +24,7 @@ import stegasoo
from stegasoo import (
encode, decode, generate_credentials,
validate_image, calculate_capacity,
get_day_from_date,
DAY_NAMES, __version__,
StegasooError, DecryptionError, CapacityError,
has_argon2,
@@ -83,6 +84,7 @@ class EncodeResponse(BaseModel):
filename: str
capacity_used_percent: float
date_used: str
day_of_week: str
class DecodeRequest(BaseModel):
@@ -193,11 +195,15 @@ async def api_encode(request: EncodeRequest):
stego_b64 = base64.b64encode(result.stego_image).decode('utf-8')
# Get day of week from the date used
day_of_week = get_day_from_date(result.date_used)
return EncodeResponse(
stego_image_base64=stego_b64,
filename=result.filename,
capacity_used_percent=result.capacity_percent,
date_used=result.date_used
date_used=result.date_used,
day_of_week=day_of_week
)
except CapacityError as e:
@@ -253,7 +259,7 @@ async def api_encode_multipart(
"""
Encode using multipart form data (file uploads).
Returns the stego image directly as PNG.
Returns the stego image directly as PNG with metadata headers.
"""
try:
ref_data = await reference_photo.read()
@@ -271,10 +277,18 @@ async def api_encode_multipart(
date_str=date_str if date_str else None
)
# Get day of week from the date used
day_of_week = get_day_from_date(result.date_used)
return Response(
content=result.stego_image,
media_type="image/png",
headers={"Content-Disposition": f"attachment; filename={result.filename}"}
headers={
"Content-Disposition": f"attachment; filename={result.filename}",
"X-Stegasoo-Date": result.date_used,
"X-Stegasoo-Day": day_of_week,
"X-Stegasoo-Capacity-Percent": f"{result.capacity_percent:.1f}"
}
)
except CapacityError as e:

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "stegasoo"
version = "2.0.0"
version = "2.0.1"
description = "Secure steganography with hybrid photo + passphrase + PIN authentication"
readme = "README.md"
license = "MIT"

View File

@@ -11,7 +11,7 @@ from pathlib import Path
# VERSION
# ============================================================================
__version__ = "2.0.0"
__version__ = "2.0.1"
# ============================================================================
# FILE FORMAT

View File

@@ -208,7 +208,7 @@ class TestVersion:
def test_version_exists(self):
assert hasattr(stegasoo, '__version__')
assert stegasoo.__version__ == "2.0.0"
assert stegasoo.__version__ == "2.0.1"
def test_day_names(self):
assert len(stegasoo.DAY_NAMES) == 7