INNER CODE UNIT · Python
decode
Nour833/StegoForge · web/app.py:495
def decode():
try:
result, payload = _decode_operation(request.form, request.files)
mime = result.get("detected_mime", "application/octet-stream")
dl_name = result.get("download_name", "decoded_payload.bin")
# For encrypted/opaque blobs, add a hint in the header
extra_headers = {}
if payload[:4] == b"SFRG":
extra_headers["X-StegoForge-Hint"] = (
"Payload appears to be another StegoForge-encrypted blob. "
"Use 'stegoforge decode' with the correct key to unwrap it."
)
buf = io.BytesIO(payload)
buf.seek(0)
response = send_file(