Skip to content

Latest commit

ย 

History

History
1194 lines (998 loc) ยท 58.9 KB

File metadata and controls

1194 lines (998 loc) ยท 58.9 KB

๐Ÿ—๏ธ Meow Decoder - Architecture Documentation

Version: 1.0.0 (INTERNAL REVIEW โ€” no external audit) Date: 2026-02-22 Status: Production


๐Ÿ“‹ Overview

Meow Decoder is an optical air-gap file transfer system that combines:

  • Cryptography (AES-256-GCM, Argon2id, X25519, ML-KEM-768/1024 PQXDH hybrid)
  • Error Correction (Luby Transform fountain codes โ€” Python + JavaScript)
  • Visual Encoding (QR codes in GIF animations)
  • Optical Transfer (screen โ†’ camera with 33% frame loss tolerance)
  • Mobile Capture (Meow Capture โ€” iOS/Android companion app for on-device scanning and export)

๐Ÿ“ฑ Mobile Companion App โ€” Meow Capture

Meow Capture is a secure offline QR capture companion app for air-gapped file transfer. It is the recommended way to use a phone as the receiving device.

๐Ÿ“ฅ Download: Meow Capture v3.2.2 APK (Android) โ€” sideload on Android, iOS & store listings coming soon.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚             MEOW CAPTURE (React Native)                โ”‚
โ”‚         A secure offline QR capture companion app      โ”‚
โ”‚              for air-gapped file transfer              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

 Camera (VisionCamera v4)
        โ”‚  MLKit / AVFoundation QR decode (on-device)
        โ–ผ
 useQRScanner hook  โ”€โ”€โ”€ dedup + fountain droplet parse
        โ”‚
        โ–ผ
 useSessionManager  โ”€โ”€โ”€ fountain auto-complete at 1.5ร— threshold
        โ”‚
        โ–ผ
 CaptureScreen
  โ”œโ”€โ”€ ProgressHUD        โ”€โ”€โ”€ confidence tier + safeToStop pill
  โ”œโ”€โ”€ CaptureCoachPanel  โ”€โ”€โ”€ decode-rate / shake / exposure hints
  โ””โ”€โ”€ CameraPreview      โ”€โ”€โ”€ pinch zoom, exposure nudge

        โ”‚  User taps "Confirm & Export"
        โ–ผ
 Biometric gate (Face ID / fingerprint)
        โ”‚
        โ–ผ
 jsonExporter  โ”€โ”€โ”€ chunked JSON โ†’ Downloads/ + SHA-256
        โ”‚
        โ–ผ
 ExportScreen  โ”€โ”€โ”€ SHA-256 display, ADB pull cmd, filename copy

Security invariants enforced by the app:

  • No INTERNET permission (enforced by Android OS / iOS sandbox)
  • Frame payload strings wiped from JS heap on AppState background/inactive
  • Panic wipe via 3-second long-press (zeroes all session state)
  • FLAG_SECURE + iOS snapshot overlay (no screenshots / task-switcher leak)
  • Biometric export gate before any file write

Integration with CLI pipeline:

# Desktop โ†’ generate request
meow-encode -i secret.pdf -o secret.gif -p "password" --output-request request.json

# Phone โ†’ scan GIF, export โ†’ Downloads/meow-capture-<id>.json

# Desktop โ†’ retrieve + decode
adb pull /sdcard/Download/meow-capture-<id>.json ./
meow-decode-gif -i meow-capture-<id>.json -p "password"

# Multi-device โ†’ merge first
python -m meow_decoder.merge --input capture-a.json capture-b.json --output merged.json
meow-decode-gif -i merged.json -p "password"

๐ŸŽฏ High-Level Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         MEOW DECODER                             โ”‚
โ”‚                  Air-Gap File Transfer System                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   SENDER    โ”‚    โ”‚   OPTICAL    โ”‚    โ”‚  RECEIVER   โ”‚
โ”‚   DEVICE    โ”‚โ”€โ”€โ”€โ–ถโ”‚   CHANNEL    โ”‚โ”€โ”€โ”€โ–ถโ”‚   DEVICE    โ”‚
โ”‚             โ”‚    โ”‚  (screen โ†’   โ”‚    โ”‚             โ”‚
โ”‚  encode.py  โ”‚    โ”‚   camera)    โ”‚    โ”‚ decode.py   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚                                       โ”‚
      โ–ผ                                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ secret.pdf  โ”‚                        โ”‚ secret.pdf  โ”‚
โ”‚  (plain)    โ”‚                        โ”‚  (plain)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ Data Flow - Encoding Pipeline

INPUT FILE (secret.pdf)
    โ”‚
    โ”‚  1. READ
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  FILE BYTES (original_data)              โ”‚
โ”‚  Size: N bytes                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  2. COMPRESS (zlib level 9)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  COMPRESSED DATA                         โ”‚
โ”‚  Size: ~0.7N bytes (typical)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  3. ENCRYPT (AES-256-GCM + Argon2id)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CIPHERTEXT                              โ”‚
โ”‚  Size: ~0.7N bytes                       โ”‚
โ”‚  + Nonce (12B)                           โ”‚
โ”‚  + GCM Tag (16B)                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  4. FOUNTAIN ENCODE (Luby Transform)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  FOUNTAIN DROPLETS (kibbles)             โ”‚
โ”‚  Count: K blocks ร— 1.5 redundancy        โ”‚
โ”‚  (33% frame loss tolerance)              โ”‚
โ”‚  Each: block_size bytes                  โ”‚
โ”‚  Format: seed + block_indices + XOR_data โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  5. QR ENCODE (per droplet)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  QR CODE FRAMES (paw prints)             โ”‚
โ”‚  Count: K ร— 1.5 frames                   โ”‚
โ”‚  Each: 600ร—600 pixels                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  6. GIF CREATION
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ANIMATED GIF (yarn ball)                โ”‚
โ”‚  Frames: K ร— 1.5                         โ”‚
โ”‚  FPS: 10                                 โ”‚
โ”‚  Size: ~10 MB (for 1 MB input)          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  7. DISPLAY (optical transfer)
    โ–ผ
OUTPUT GIF (secret.gif)

๐Ÿ”„ Data Flow - Decoding Pipeline

INPUT GIF (secret.gif)
    โ”‚
    โ”‚  1. GIF PARSE
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  GIF FRAMES (extracted)                  โ”‚
โ”‚  Count: K ร— 1.5 frames                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  2. QR DECODE (each frame)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  QR DATA (droplets)                      โ”‚
โ”‚  Frame 0: Manifest (collar tag)          โ”‚
โ”‚  Frame 1+: Fountain droplets             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  3. FOUNTAIN DECODE (belief propagation)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  RECONSTRUCTED CIPHERTEXT                โ”‚
โ”‚  Size: ~0.7N bytes                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  4. DECRYPT (AES-256-GCM + verify HMAC)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  COMPRESSED DATA                         โ”‚
โ”‚  Size: ~0.7N bytes                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  5. DECOMPRESS (zlib)
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ORIGINAL DATA                           โ”‚
โ”‚  Size: N bytes                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ”‚  6. VERIFY (SHA-256 check)
    โ–ผ
OUTPUT FILE (secret.pdf)

๐Ÿงฉ Component Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        MEOW DECODER MODULES                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚   CONFIG    โ”‚  โ”‚   CRYPTO    โ”‚  โ”‚  FOUNTAIN   โ”‚             โ”‚
โ”‚  โ”‚             โ”‚  โ”‚             โ”‚  โ”‚             โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Settings  โ”‚  โ”‚ โ€ข AES-GCM   โ”‚  โ”‚ โ€ข Encoder   โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Presets   โ”‚  โ”‚ โ€ข Argon2id  โ”‚  โ”‚ โ€ข Decoder   โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Validate  โ”‚  โ”‚ โ€ข HMAC      โ”‚  โ”‚ โ€ข Soliton   โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚   QR CODE   โ”‚  โ”‚  GIF HANDLERโ”‚  โ”‚  CAT UTILS  โ”‚             โ”‚
โ”‚  โ”‚             โ”‚  โ”‚             โ”‚  โ”‚             โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Generate  โ”‚  โ”‚ โ€ข Create    โ”‚  โ”‚ โ€ข Sounds    โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Read      โ”‚  โ”‚ โ€ข Parse     โ”‚  โ”‚ โ€ข Facts     โ”‚             โ”‚
โ”‚  โ”‚ โ€ข Webcam    โ”‚  โ”‚ โ€ข Optimize  โ”‚  โ”‚ โ€ข Progress  โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚           SECURITY ENHANCEMENTS                 โ”‚            โ”‚
โ”‚  โ”‚                                                 โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Forward Secrecy (MEOW3)                     โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Post-Quantum (MEOW5/MEOW4)                  โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Steganography (Ninja Cat + Phase 1)             โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Streaming Crypto (Prowling)                 โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Resume Support                              โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚              USER INTERFACES                    โ”‚            โ”‚
โ”‚  โ”‚                                                 โ”‚            โ”‚
โ”‚  โ”‚  โ€ข encode.py (CLI encoder)                     โ”‚            โ”‚
โ”‚  โ”‚  โ€ข decode_gif.py (CLI decoder + --tamper-report)โ”‚            โ”‚
โ”‚  โ”‚  โ€ข decode_webcam.py (webcam capture)           โ”‚            โ”‚
โ”‚  โ”‚  โ€ข meow_dashboard.py (GUI)                     โ”‚            โ”‚
โ”‚  โ”‚  โ€ข Meow Capture (iOS/Android companion app)    โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚              SUPPORT MODULES                    โ”‚            โ”‚
โ”‚  โ”‚                                                 โ”‚            โ”‚
โ”‚  โ”‚  โ€ข canonical_aad.py (deterministic AAD)        โ”‚            โ”‚
โ”‚  โ”‚  โ€ข tamper_report.py (frame MAC timeline)       โ”‚            โ”‚
โ”‚  โ”‚  โ€ข merge.py (multi-device capture merge CLI)   โ”‚            โ”‚
โ”‚  โ”‚  โ€ข mobile/bridge/protocol.py (CLI phone bridge)โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚                                                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ” Security Layers

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   SECURITY ONION                         โ”‚
โ”‚              (Defense in Depth - 7 Layers)               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Layer 7: Air-Gap (optical transfer, no network)
           โ†‘
Layer 6: Steganography (optional, hides presence โ€” APNG for lossless stego)
           โ†‘
Layer 5: Per-Frame Ratchet (MSR v1.2: header encryption, key commitment, forward secrecy)
           โ†‘
Layer 4: Encryption (AES-256-GCM)
           โ†‘
Layer 3: Authentication (HMAC-SHA256)
           โ†‘
Layer 2: KDF (Argon2id, memory-hard)
           โ†‘
Layer 1: Strong Password + Optional Keyfile (2FA)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Attack Surface: Minimal (endpoint only)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿฆ€ Rust Crypto Backend

All secret-handling cryptographic operations are implemented in the Rust crypto_core/ crate and exposed to Python via PyO3 bindings (meow_crypto_rs module).

Why Rust?

  • Constant-time operations: The subtle crate provides timing-safe comparisons
  • Secure zeroing: The zeroize crate guarantees secrets are wiped from memory
  • Memory safety: No buffer overflows or use-after-free vulnerabilities
  • Performance: Native-speed crypto without Python GIL overhead

What the Rust Migration Does โ€” and Does Not โ€” Change

Moving cryptographic primitives from Python (cryptography library) to Rust (meow_crypto_rs) does not upgrade the underlying algorithms. The math stays exactly the same:

  • AES-256-GCM is still 256-bit secure.
  • X25519 is still Curve25519 Diffie-Hellman.
  • HKDF-SHA256 is still RFC 5869.
  • Argon2id is still the same memory-hard KDF with the same parameters.
  • ML-KEM-768/1024 is still the same post-quantum KEM.
  • The ratchet math, transcript binding, and post-quantum assumptions are unchanged.

What it improves is the implementation layer โ€” the code that handles secrets at runtime. In real-world systems, implementation failures (memory leaks, timing side-channels, silent fallbacks) are far more common than broken mathematical primitives. The Rust migration hardens precisely the layer where most real bugs happen.

1. Memory Safety and Secret Hygiene

Before (Python): Secrets live in garbage-collected objects. Python's GC makes no guarantee about when โ€” or whether โ€” sensitive bytes are zeroed. Copies may linger in memory across heap allocations, and secrets can be accidentally logged or serialized.

After (Rust): The zeroize crate provides Zeroize on Drop โ€” secrets are deterministically wiped when they leave scope. Rust's ownership model prevents accidental copies, gives the developer controlled secret lifecycles, and eliminates an entire class of memory-inspection risks.

This reduces: secret retention risk, key leakage through memory dumps, accidental logging of sensitive material.

2. Secret Boundary Clarity

Before: Cryptographic operations were mixed with protocol orchestration in the same Python modules. Python code touched raw key material directly, making it harder to audit which code paths handle secrets.

After: Python handles orchestration only (manifest parsing, fountain coding, QR generation). Rust handles the cryptographic boundary (key derivation, encryption, signing, zeroing). This separation makes the architecture cleaner and makes both halves easier to audit independently.

3. Constant-Time Discipline

Before (Python): Python offers limited constant-time guarantees. hmac.compare_digest() exists but reasoning about timing behavior across the interpreter, bytecode, and GC is difficult. Custom comparisons are nearly impossible to make genuinely constant-time in CPython.

After (Rust): The subtle crate provides explicit constant-time types (Choice, CtEq) with well-understood timing properties. Constant-time comparisons are enforced at the type level, not by convention. This narrows the timing-leak attack surface considerably.

4. Auditability

The Rust crypto core (crypto_core/src/) is a deliberately small, tightly-scoped surface. It contains only primitive operations โ€” no protocol logic, no I/O, no user-facing code. This makes it:

  • Easier for external reviewers to read in a single sitting
  • Easier to verify ownership and data-flow properties
  • Compatible with Rust-native formal verification tools (Verus, Kani)
  • Backed by a well-audited crate ecosystem (aes-gcm, argon2, x25519-dalek, hkdf)

5. Elimination of Silent Fallbacks

Before: A misconfigured environment could silently fall back to a Python crypto path that lacked constant-time guarantees and memory zeroing โ€” with no indication to the user.

After: The Rust backend is required. If meow_crypto_rs is not available, the system fails closed with a clear error. CI enforces RUST_BACKEND_REQUIRED=1, and an AST-based import scanner blocks from cryptography in all production modules. There are no shadow crypto paths, no partial migrations, no "works locally but insecure in production" surprises.

Honest Summary

Before Rust Migration After Rust Migration
Protocol strength Strong (AES-256-GCM, Argon2id, X25519, ML-KEM) Identical โ€” no algorithm changes
Implementation risk Moderate (Python secret handling, GC, timing) Lower (Rust ownership, zeroize, subtle)
Crypto boundary Blurred (Python touches secrets) Clean (Rust = secrets, Python = orchestration)
Fallback behavior Silent Python fallback possible Fail-closed, CI-enforced
Auditability Harder (crypto spread across Python modules) Easier (compact Rust core)

This is not increasing cryptographic strength. It is increasing implementation security, operational robustness, secret hygiene, side-channel discipline, and architectural integrity. That is a meaningful upgrade.

Backend Functions (73 PyO3 bindings)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    meow_crypto_rs Module                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                   โ”‚
โ”‚  Key Derivation:          Symmetric Crypto:      Hashing:         โ”‚
โ”‚  โ”œโ”€ derive_key_argon2id   โ”œโ”€ aes_gcm_encrypt     โ”œโ”€ sha256        โ”‚
โ”‚  โ”œโ”€ derive_key_hkdf       โ”œโ”€ aes_gcm_decrypt     โ”œโ”€ hmac_sha256   โ”‚
โ”‚  โ”œโ”€ hkdf_extract          โ””โ”€ aes_ctr_crypt       โ””โ”€ hmac_verify   โ”‚
โ”‚  โ””โ”€ hkdf_expand                                                   โ”‚
โ”‚                                                                   โ”‚
โ”‚  Key Exchange:            Utilities:             Post-Quantum:    โ”‚
โ”‚  โ”œโ”€ x25519_generate       โ”œโ”€ constant_time_cmp   โ”œโ”€ mlkem768_*    โ”‚
โ”‚  โ”œโ”€ x25519_exchange       โ”œโ”€ secure_zero         โ””โ”€ mlkem1024_*   โ”‚
โ”‚  โ””โ”€ x25519_pub_from_priv  โ””โ”€ secure_random                        โ”‚
โ”‚                                                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

CI Enforcement

  • RUST_BACKEND_REQUIRED=1 environment gate โ€” CI fails if Rust backend unavailable
  • AST-based import scanner blocks from cryptography in production modules
  • Golden vector regression tests verify Python/Rust output parity

Production vs Non-Production Code

All production meow_decoder/*.py modules route crypto through crypto_backend.CryptoBackend() (Rust). No production module imports cryptography at module level or runtime.

Non-production / legacy modules (exempt from enforcement):

Module Status Reason
crypto_DEBUG.py Debug-only Verbose logging variant, not imported by production
pq_crypto_real.py Dead code raise RuntimeError before imports; kept for audit trail
pq_signatures.py Experimental Ed25519 not yet in Rust backend; _PQ_EXPERIMENTAL = True
x25519_forward_secrecy.py Legacy PEM fallback New keys use MEOW_X25519 format via Rust; legacy PEM path imports cryptography only when loading old-format keys
spec_v12/ Reference spec Not imported by production entrypoints

๐Ÿ›๏ธ Architectural Layer Boundaries

Meow Decoder's codebase is organized into five strict layers. These boundaries exist to prevent refactors, AI-assisted edits, or well-meaning contributions from flattening the project's personality, renaming cryptographic primitives, altering protocol invariants, or reintroducing Python cryptography imports into production code.

Every module in the project belongs to exactly one layer. Code in a given layer may call downward (Layer 4 โ†’ Layer 3 โ†’ Layer 2 โ†’ Layer 1) but never upward.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Layer 5 โ€” Demos / Documentation / Branding                 โ”‚
โ”‚  examples/, docs/, README.md, assets/, Jupyter notebooks    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 4 โ€” Themed Faรงade API (Cat Personality)               โ”‚
โ”‚  meow_encode.py, cat_utils.py, cat_errors.py,               โ”‚
โ”‚  meow_gui_enhanced.py, gui_logo_example.py, logo_eyes.py    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 3 โ€” Protocol Orchestration                            โ”‚
โ”‚  crypto.py, encode.py, decode_gif.py, ratchet.py,            โ”‚
โ”‚  forward_secrecy.py, fountain.py, pq_hybrid.py,              โ”‚
โ”‚  schrodinger_encode.py, quantum_mixer.py, frame_mac.py       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 2 โ€” crypto_backend (Python โ†” Rust Bridge)             โ”‚
โ”‚  crypto_backend.py โ†’ CryptoBackend()                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 1 โ€” crypto_core (Rust)                                โ”‚
โ”‚  crypto_core/src/ โ†’ meow_crypto_rs (PyO3)                    โ”‚
โ”‚  pure_crypto.rs, aead_wrapper.rs, nonce.rs, lib.rs           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Layer 1 โ€” crypto_core (Rust)

Location: crypto_core/src/

Pure cryptographic primitives only: AES-256-GCM, Argon2id, HKDF-SHA256, X25519, SHA-256, HMAC-SHA256, ML-KEM-768/1024. Built with the subtle crate (constant-time) and zeroize crate (memory zeroing).

Rules:

  1. No humor in function names. Identifiers are cryptographic domain terms (aes_gcm_encrypt, hkdf_expand, x25519_exchange).
  2. No renaming of domain separation labels. Strings like "meow_pqxdh_v1", "meow-fs-block", "meow-ratchet-chain" are protocol constants bound in formal proofs and test vectors.
  3. No playful identifiers inside primitive logic.
  4. Zero jokes below this layer. External auditors read this code.

Layer 2 โ€” crypto_backend (Python โ†” Rust Bridge)

Location: meow_decoder/crypto_backend.py

A thin wrapper that exposes Rust primitives to Python via the CryptoBackend class and get_default_backend() factory.

Rules:

  1. Thin wrapper only โ€” each method delegates directly to meow_crypto_rs. No multi-step crypto logic.
  2. No business logic. Protocol decisions belong in Layer 3.
  3. No cryptography library imports. The Python cryptography package is permanently banned from this module and all production modules.
  4. Stable primitive names. Method names (derive_key_argon2id, aes_gcm_encrypt, x25519_generate_keypair, etc.) are the API contract.

Layer 3 โ€” Protocol Orchestration

Location: meow_decoder/crypto.py, encode.py, decode_gif.py, ratchet.py, forward_secrecy.py, fountain.py, pq_hybrid.py, schrodinger_encode.py, quantum_mixer.py, frame_mac.py, double_ratchet.py, and related modules.

Protocol logic that composes Layer 2 primitives into the MEOW protocol: manifest packing (MEOW2โ€“MEOW5), AAD construction, fountain coding, symmetric ratchet (MSR v1.2), PQXDH key exchange, Schrรถdinger mode, QR/GIF encoding.

Rules:

  1. All crypto calls go through CryptoBackend(). Never import raw primitives.
  2. No renaming of protocol invariants โ€” manifest magic bytes, mode bytes, domain separation strings, struct layouts, and AAD field ordering are frozen.
  3. Light comments are fine, but do not rename variables that track protocol state (chain_key, message_key, ephemeral_public_key, pq_ciphertext).
  4. Fail-closed on all MAC verification (ValueError on failure, never silently disable).
  5. Constant-time comparisons for all authentication checks.

Layer 4 โ€” Themed Faรงade API (Cat Personality)

Location: meow_decoder/meow_encode.py, cat_utils.py, cat_errors.py, meow_gui_enhanced.py, gui_logo_example.py, logo_eyes.py, ascii_qr.py, and similar user-facing wrappers.

Playful, cat-themed wrappers around Layer 3 operations. CollarTag for manifests, CatError for exceptions, themed progress messages, GUI skins with cat imagery, CLI names like meow-encode.

Rules:

  1. Safe to introduce playful wrapper names (whisker_check(), purr_progress(), etc.).
  2. Must call Layer 2/3 functions internally. Personality is a naming layer, not a reimplementation.
  3. Must not alter semantics โ€” no changing encryption parameters, skipping verification, or adding new cryptographic behavior.
  4. No "fun encryption" or "cat cipher" โ€” only delegate to established primitives.

Layer 5 โ€” Demos / Documentation / Branding

Location: examples/, docs/, README.md, QUICKSTART.md, assets/, Jupyter notebooks, HTML demos.

Everything that helps humans understand and enjoy the project: example scripts, browser demos, JavaScript fountain codes, cat imagery, markdown documentation.

Rules:

  1. Fully allowed to be playful โ€” cat puns, emoji, personality, creative writing all welcome.
  2. Must not contradict the protocol spec. Playful framing is fine; incorrect security claims are not.
  3. Demo code may use simplified patterns but must not demonstrate insecure usage without explicit warnings.

๐Ÿ” Crypto Core Is Sacred

The following invariants are load-bearing. Violating any one of them constitutes a security regression, not a style preference.

Invariant Why It Exists How It Is Enforced
No from cryptography in production modules Rust backend provides constant-time operations and memory zeroing that Python cryptography cannot guarantee AST-based import scanner (tests/test_crypto_enforcement.py); CI gate RUST_BACKEND_REQUIRED=1
Manifest magic bytes and mode bytes are frozen MEOW2=0x02, MEOW3=0x03, MEOW4=0x04, MEOW5=0x05, duress=|0x80 โ€” changing them breaks all existing encoded files Golden vector tests (tests/test_golden_vectors.py)
Domain separation strings are immutable "meow_pqxdh_v1", "meow-fs-block", "meow-ratchet-chain", etc. are bound in formal proofs and interop test vectors verify_domain_separation.sh; formal model checks
AAD field ordering is fixed orig_len โ€– comp_len โ€– salt โ€– sha256 โ€– magic โ€– ephemeral_pub โ€– pq_ciphertext โ€” reordering silently breaks authentication Tamper detection tests (tests/test_security.py)
HMAC-then-use for manifests Manifest HMAC must be verified before any field is trusted; skipping this enables oracle attacks Adversarial tests (tests/test_adversarial.py)
Fail-closed MAC verification ValueError on invalid MAC; silent MAC bypass is a critical vulnerability Unit tests assert ValueError is raised, never caught
Argon2id production parameters 512 MiB memory, 20 iterations, 4 threads โ€” lowering them weakens brute-force resistance Config tests; MEOW_TEST_MODE flag for CI only
Nonce uniqueness LRU cache (10K cap) + HKDF-derived synthetic IV + Rust CAS loop (prevents u64 counter wrap) Nonce reuse guard tests
Fountain code frame format FOUNTAIN:<k>:<block_size>:<length>:<droplet_b64> โ€” changing this breaks Python โ†” JavaScript interop Interop tests across both implementations
Rust primitive function names aes_gcm_encrypt, derive_key_hkdf, x25519_exchange, etc. โ€” renaming them breaks every Layer 3 module Layer 2 API contract; compilation and import tests

What "Sacred" Means in Practice

  • Do not rename Layer 1 or Layer 2 function signatures without updating every call site, every test, and every formal proof.
  • Do not add new cryptographic algorithms to Layer 4 or Layer 5. All crypto lives in Layer 1; orchestration lives in Layer 3.
  • Do not weaken Argon2id parameters, MAC verification, or AAD bindings for convenience, performance, or "simplicity."
  • Do not bypass the CryptoBackend() abstraction. If a module needs a cryptographic operation, it calls Layer 2.

๐ŸŽจ Where Personality Is Allowed

Meow Decoder's cat-themed identity is part of the project, but it must not leak into security-critical code. The table below defines where personality is safe and where it is forbidden.

Layer Personality Level What Is OK What Is Not OK
Layer 1 (Rust primitives) None aes_gcm_encrypt, hkdf_expand paws_encrypt, meow_hkdf
Layer 2 (crypto_backend) None CryptoBackend.derive_key_argon2id CatCryptoBackend.scratch_key
Layer 3 (protocol orchestration) Minimal Conversational code comments; technical names (pack_manifest, ratchet_step) Replacing HMAC-SHA256 with whisker-hash in protocol code
Layer 4 (themed faรงade) Full CollarTag, CatError, purr_progress() โ€” but must delegate to Layers 2/3 Implementing a custom cipher, skipping MAC checks
Layer 5 (demos/docs) Full Cat art, emoji, playful tutorials, meow-encode CLI name Documenting incorrect security properties

Encouraged Patterns

  • Layer 4 wrapper: class CollarTag that internally calls pack_manifest() / unpack_manifest()
  • Layer 4 error: class CatError(Exception) with a friendly message wrapping a raw ValueError
  • Layer 5 docs: "Your secret file is now wearing its invisible collar!"
  • Layer 5 CLI: meow-encode as the user-facing command (delegates to encode.py)

Anti-Patterns (Do Not Do)

  • Renaming aes_gcm_encrypt โ†’ cat_encrypt in Layer 1 or 2
  • Adding meow_ prefix to Rust function names in pure_crypto.rs
  • Using cat puns in domain separation strings ("meow-purr-chain" instead of "meow-ratchet-chain")
  • Creating a FunCipher class that implements novel crypto in Layer 4
  • Replacing protocol variable names (chain_key โ†’ yarn_key) in Layer 3

๐Ÿ”’ Cryptographic Architecture

MEOW2: Base Encryption

PASSWORD + SALT
    โ”‚
    โ”‚  Argon2id (512 MiB, 20 iter)
    โ–ผ
256-bit MASTER KEY
    โ”‚
    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                 โ”‚                 โ”‚
    โ–ผ                 โ–ผ                 โ–ผ
AES-256-GCM      HMAC Key         (unused)
Encryption       (manifest
                 auth)

MEOW3: Forward Secrecy

PASSWORD + SALT
    โ”‚
    โ”‚  Argon2id
    โ–ผ
MASTER KEY
    โ”‚
    โ”‚  HKDF
    โ–ผ
INITIAL CHAIN KEY
    โ”‚
    โ”œโ”€โ”€โ–ถ Block 0 Key โ”€โ”€โ–ถ Encrypt Block 0
    โ”‚         โ”‚
    โ”‚         โ”‚  HKDF (ratchet)
    โ”‚         โ–ผ
    โ”œโ”€โ”€โ–ถ Block 1 Key โ”€โ”€โ–ถ Encrypt Block 1
    โ”‚         โ”‚
    โ”‚         โ”‚  HKDF (ratchet)
    โ”‚         โ–ผ
    โ””โ”€โ”€โ–ถ Block 2 Key โ”€โ”€โ–ถ Encrypt Block 2
          ...

(Each block key is independent!)

MEOW5 (default) / MEOW4 (paranoid): PQXDH Post-Quantum Hybrid

PASSWORD + SALT
    โ”‚
    โ”‚  Argon2id
    โ–ผ
MASTER KEY
    โ”‚
    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚               โ”‚                    โ”‚
    โ–ผ               โ–ผ                    โ–ผ
Generate        Generate             Generate
X25519          ML-KEM-768 (MEOW5)   HKDF Keys
Keypair         ML-KEM-1024 (MEOW4)
    โ”‚               โ”‚
    โ”‚  ECDH         โ”‚  KEM Encap
    โ–ผ               โ–ผ
Classical     Quantum
Shared (32B)  Shared (32B)
    โ”‚               โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚  PQXDH Two-Step HKDF
            โ”‚
            โ”‚  1. PRK = HMAC-SHA256(0x00*32, classical_ss || pq_ss)
            โ”‚  2. transcript = SHA256(domain || eph_pub || recv_cls_pub || recv_pq_pub || pq_ct)
            โ”‚  3. key = HKDF-Expand(PRK, "meow_pqxdh_v1" || transcript, 32)
            โ–ผ
    HYBRID SHARED SECRET
            โ”‚
            โ–ผ
    AES-256-GCM Key

๐ŸŒŠ Fountain Code Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            LUBY TRANSFORM FOUNTAIN                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

ENCODING:

Input Data (N bytes)
    โ”‚
    โ”‚  Split into K blocks
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
โ”‚ B0 โ”‚ B1 โ”‚ B2 โ”‚ B3 โ”‚ B4 โ”‚ B5 โ”‚  K blocks
โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜
  โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”‚
  โ””โ”€โ”€โ”ฌโ”€โ”ดโ”€โ”€โ”ฌโ”€โ”ดโ”€โ”€โ”ฌโ”€โ”ดโ”€โ”€โ”ฌโ”€โ”ดโ”€โ”€โ”ฌโ”€โ”˜
     โ”‚    โ”‚    โ”‚    โ”‚    โ”‚
     โ”‚  Robust Soliton Distribution
     โ”‚  (determines degree d)
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   SELECT d random blocks      โ”‚
โ”‚   XOR them together           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚
     โ–ผ
  DROPLET (can reconstruct infinite!)

DECODING (Belief Propagation):

Collect droplets until K blocks solved
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  DEGREE 1 DROPLETS                โ”‚
โ”‚  (single block)                   โ”‚
โ”‚  โ†’ Immediately solved!            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  DEGREE 2+ DROPLETS               โ”‚
โ”‚  (multiple blocks)                โ”‚
โ”‚  โ†’ XOR out solved blocks          โ”‚
โ”‚  โ†’ May become degree 1            โ”‚
โ”‚  โ†’ Cascade solving!               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
ALL K BLOCKS SOLVED โ†’ SUCCESS!

๐ŸŒ JavaScript Implementation (Web Demo)

The fountain code implementation is available in both Python (CLI) and JavaScript (web demo):

File: examples/fountain-codes.js (414 lines)

Classes:

  • FountainEncoder: Generate droplets from source data
  • FountainDecoder: Reconstruct via belief propagation
  • Droplet: Serialization (pack/unpack for QR transmission)
  • RobustSolitonDistribution: Optimal degree sampling
  • SeededRandom: Deterministic PRNG (reproducible block selection)

Integration Points:

[ENCODING - wasm_browser_example.html]
User encrypts large file (>2500 bytes)
    โ†“
FountainEncoder(payloadBytes, kBlocks, blockSize)
    โ†“
Generate kร—1.5 droplets (50% redundancy)
    โ†“
Each droplet โ†’ Pack to bytes โ†’ Base64 โ†’ QR frame
    Frame format: FOUNTAIN:<k>:<block_size>:<length>:<droplet_b64>
    โ†“
Animated QR cycling through droplet frames

[DECODING - webcam scanner]
Point camera at animated QR
    โ†“
jsQR detects frame: "FOUNTAIN:5:600:2847:AAB..."
    โ†“
Parse metadata, initialize FountainDecoder(5, 600, 2847)
    โ†“
Droplet.unpack(base64ToBytes(droplet_b64), 600)
    โ†“
decoder.addDroplet(droplet)  โ†’ belief propagation
    โ†“
Progress: "Collecting: 8 scanned, 80% decoded (4/5 blocks)"
    โ†“
decoder.isComplete() โ†’ true
    โ†“
recovered = decoder.getData(originalLength)
    โ†“
Decrypt with password โ†’ Original file!

Frame Loss Tolerance:

  • 33% loss: With 1.5ร— redundancy (k โ†’ 1.5k droplets), can lose 33% of frames
  • Automatic retry: Keep scanning until enough droplets collected
  • Visual progress: Real-time feedback shows decode percentage

Performance:

  • Encoding: ~10ms for typical payloads (1000 blocks)
  • Decoding: O(n ร— k) belief propagation, runs in real-time
  • Memory: O(k ร— block_size) - stores only decoded blocks

See the MEOW5/MEOW4 PQXDH section and the fountain coding implementation in meow_decoder/fountain.py for full technical details.


๐Ÿ“Š Module Dependencies

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  encode.py   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚
       โ”œโ”€โ”€โ–ถ config.py (load settings)
       โ”œโ”€โ”€โ–ถ crypto.py (encrypt)
       โ”œโ”€โ”€โ–ถ fountain.py (encode)
       โ”œโ”€โ”€โ–ถ qr_code.py (generate QR)
       โ”œโ”€โ”€โ–ถ gif_handler.py (create GIF)
       โ””โ”€โ”€โ–ถ cat_utils.py (fun features)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ decode_gif.pyโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚
       โ”œโ”€โ”€โ–ถ config.py (load settings)
       โ”œโ”€โ”€โ–ถ crypto.py (decrypt)
       โ”œโ”€โ”€โ–ถ fountain.py (decode)
       โ”œโ”€โ”€โ–ถ qr_code.py (read QR)
       โ”œโ”€โ”€โ–ถ gif_handler.py (parse GIF)
       โ””โ”€โ”€โ–ถ cat_utils.py (fun features)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ meow_dashboard.py โ”‚ (GUI)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ”œโ”€โ”€โ–ถ dearpygui (UI framework)
         โ”œโ”€โ”€โ–ถ encode.py (background threads)
         โ”œโ”€โ”€โ–ถ decode_gif.py (background threads)
         โ””โ”€โ”€โ–ถ cat_utils.py (progress, sounds)

SECURITY MODULES (optional):
โ”œโ”€โ”€โ–ถ forward_secrecy.py (MEOW3)
โ”œโ”€โ”€โ–ถ pq_hybrid.py (MEOW5/MEOW4, primary PQ module โ€” PQXDH transcript binding)
โ”œโ”€โ”€โ–ถ pq_crypto_real.py (DEPRECATED โ€” use pq_hybrid.py)
โ”œโ”€โ”€โ–ถ ninja_cat_ultra.py (steganography)
โ”œโ”€โ”€โ–ถ prowling_mode.py (low-memory)
โ””โ”€โ”€โ–ถ resume_secured.py (resume support)

OS-LEVEL HARDENING (Phases 1โ€“4, 2026-02-22):
โ”œโ”€โ”€โ–ถ memory_guard.py (mlockall, RLIMIT_CORE=0, PR_SET_DUMPABLE, MADV_DONTDUMP)
โ”œโ”€โ”€โ–ถ constant_time.py (secure_zero_memory, SecureBuffer, mlock lifecycle)
โ”œโ”€โ”€โ–ถ forensic_cleanup.py (thumbnails, clipboard, shell history, temp files)
โ”œโ”€โ”€โ–ถ secure_temp.py (tmpfs enforcement, /dev/shm preferred)
โ”œโ”€โ”€โ–ถ timing_equalizer.py (constant wall-clock decode, CSPRNG jitter)
โ”œโ”€โ”€โ–ถ size_normalizer.py (fixed-size output padding, size classes)
โ”œโ”€โ”€โ–ถ expiry.py (timed self-destruct, manifest expiry field)
โ”œโ”€โ”€โ–ถ source_cleanup.py (secure source deletion, TRIM hints)
โ”œโ”€โ”€โ–ถ decorrelation.py (inter-file parameter randomization)
โ”œโ”€โ”€โ–ถ secure_input.py (keystroke timing normalization)
โ”œโ”€โ”€โ–ถ air_gap.py (network/WiFi/Bluetooth/DNS air-gap checks)
โ””โ”€โ”€โ–ถ crypto_core/src/secure_alloc.rs (Rust SecureBox: guard pages + mlock + DONTDUMP)

๐Ÿ”„ State Machine - Encoding

[IDLE]
  โ”‚
  โ”‚  encode.py --input file.pdf
  โ–ผ
[READING FILE]
  โ”‚
  โ”‚  Success
  โ–ผ
[COMPRESSING]
  โ”‚
  โ”‚  zlib compress
  โ–ผ
[ENCRYPTING]
  โ”‚
  โ”‚  AES-GCM encrypt
  โ–ผ
[FOUNTAIN ENCODING]
  โ”‚
  โ”‚  Generate Kร—1.5 droplets
  โ–ผ
[QR GENERATION]
  โ”‚
  โ”‚  Create QR for each droplet
  โ–ผ
[GIF CREATION]
  โ”‚
  โ”‚  Combine frames into GIF
  โ–ผ
[WRITING OUTPUT]
  โ”‚
  โ”‚  Save secret.gif
  โ–ผ
[COMPLETE] โœ…
  โ”‚
  โ”‚  (Optional: wipe source)
  โ–ผ
[DONE]

๐Ÿ”„ State Machine - Decoding

[IDLE]
  โ”‚
  โ”‚  decode_gif.py --input secret.gif
  โ–ผ
[READING GIF]
  โ”‚
  โ”‚  Parse frames
  โ–ผ
[QR DECODING]
  โ”‚
  โ”‚  Frame 0 โ†’ Manifest
  โ”‚  Frame 1+ โ†’ Droplets
  โ–ผ
[MANIFEST VALIDATION]
  โ”‚
  โ”‚  Verify HMAC
  โ–ผ
[FOUNTAIN DECODING]
  โ”‚
  โ”‚  Collect droplets
  โ”‚  Belief propagation
  โ–ผ
[CHECKING COMPLETION]
  โ”‚
  โ”œโ”€ All blocks solved? โ”€โ–ถ [DECRYPTING]
  โ”‚                           โ”‚
  โ””โ”€ Need more? โ”€โ–ถ [QR DECODING]
                    (retry/continue)

[DECRYPTING]
  โ”‚
  โ”‚  AES-GCM decrypt
  โ–ผ
[DECOMPRESSING]
  โ”‚
  โ”‚  zlib decompress
  โ–ผ
[VERIFYING]
  โ”‚
  โ”‚  Check SHA-256
  โ–ผ
[WRITING OUTPUT]
  โ”‚
  โ”‚  Save secret.pdf
  โ–ผ
[COMPLETE] โœ…

๐ŸŽฏ Trust Boundaries

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    TRUSTED ZONE                         โ”‚
โ”‚                                                         โ”‚
โ”‚  โ€ข User's computer (sender/receiver)                   โ”‚
โ”‚  โ€ข Python interpreter                                  โ”‚
โ”‚  โ€ข Meow Decoder code                                   โ”‚
โ”‚  โ€ข Cryptography libraries                              โ”‚
โ”‚  โ€ข User's memory/disk                                  โ”‚
โ”‚                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                         โ”‚  TRUST BOUNDARY
                         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   UNTRUSTED ZONE                        โ”‚
โ”‚                                                         โ”‚
โ”‚  โ€ข Optical channel (screen โ†’ camera)                   โ”‚
โ”‚  โ€ข Anyone who can see the screen                       โ”‚
โ”‚  โ€ข Recorded video/photos                               โ”‚
โ”‚  โ€ข GIF file in transit                                 โ”‚
โ”‚                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

KEY INSIGHT:
Even if attacker controls UNTRUSTED zone, they
cannot decrypt without password (cryptography).

๐Ÿ“ˆ Performance Characteristics

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              PERFORMANCE PROFILE                     โ”‚
โ”‚          (1 MB input file, typical setup)            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

ENCODING BREAKDOWN:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Phase          โ”‚ Time     โ”‚ % Total  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Read file      โ”‚  0.1s    โ”‚   1%     โ”‚
โ”‚ Compress       โ”‚  1.2s    โ”‚  14%     โ”‚
โ”‚ Encrypt        โ”‚  0.3s    โ”‚   4%     โ”‚
โ”‚ Fountain       โ”‚  2.1s    โ”‚  25%     โ”‚
โ”‚ QR generation  โ”‚  4.2s    โ”‚  49%     โ”‚ โ† Bottleneck!
โ”‚ GIF creation   โ”‚  0.7s    โ”‚   8%     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ TOTAL          โ”‚  8.6s    โ”‚ 100%     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

DECODING BREAKDOWN:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Phase          โ”‚ Time     โ”‚ % Total  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Read GIF       โ”‚  0.5s    โ”‚  12%     โ”‚
โ”‚ QR decode      โ”‚  2.1s    โ”‚  50%     โ”‚ โ† Bottleneck!
โ”‚ Fountain       โ”‚  0.8s    โ”‚  19%     โ”‚
โ”‚ Decrypt        โ”‚  0.3s    โ”‚   7%     โ”‚
โ”‚ Decompress     โ”‚  0.3s    โ”‚   7%     โ”‚
โ”‚ Verify SHA     โ”‚  0.2s    โ”‚   5%     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ TOTAL          โ”‚  4.2s    โ”‚ 100%     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

MEMORY USAGE:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Mode           โ”‚ Peak RAM   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Normal encode  โ”‚  ~200 MB   โ”‚
โ”‚ Normal decode  โ”‚  ~150 MB   โ”‚
โ”‚ Prowling mode  โ”‚   ~50 MB   โ”‚ โ† Low-memory!
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ” Attack Surface Analysis

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                ATTACK SURFACES                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

1. INPUT VALIDATION
   โ”œโ”€ File paths        [LOW RISK]
   โ”œโ”€ Password input    [MEDIUM RISK - weak passwords]
   โ”œโ”€ Keyfile format    [LOW RISK - validation in place]
   โ””โ”€ Config files      [LOW RISK - JSON parsing]

2. CRYPTOGRAPHIC
   โ”œโ”€ Key derivation    [LOW RISK - uses Argon2id]
   โ”œโ”€ Encryption        [LOW RISK - uses cryptography lib]
   โ”œโ”€ HMAC              [LOW RISK - constant-time compare]
   โ””โ”€ Random generation [LOW RISK - uses secrets module]

3. DATA PROCESSING
   โ”œโ”€ Compression       [LOW RISK - zlib is mature]
   โ”œโ”€ QR encoding       [LOW RISK - qrcode lib]
   โ”œโ”€ QR decoding       [MEDIUM RISK - pyzbar can crash on bad data]
   โ””โ”€ GIF handling      [MEDIUM RISK - Pillow has had vulns]

4. DEPENDENCIES
   โ”œโ”€ Python stdlib     [LOW RISK]
   โ”œโ”€ meow_crypto_rs    [LOW RISK - Rust crypto backend, constant-time]
   โ”œโ”€ Pillow            [MEDIUM RISK - monitor CVEs]
   โ”œโ”€ opencv-python     [MEDIUM RISK - C++ code]
   โ””โ”€ Third-party libs  [MEDIUM RISK - supply chain]

5. SIDE CHANNELS
   โ”œโ”€ Timing            [LOW RISK - Rust `subtle` crate, constant-time]
   โ”œโ”€ Power analysis    [HIGH RISK - no mitigation]
   โ”œโ”€ EM emissions      [HIGH RISK - no mitigation]
   โ””โ”€ Cache timing      [LOW RISK - Rust bitsliced AES]

6. OPERATIONAL
   โ”œโ”€ Password entry    [HIGH RISK - keyloggers]
   โ”œโ”€ Screen recording  [HIGH RISK - endpoint compromise]
   โ”œโ”€ Memory forensics  [MEDIUM RISK - key zeroing helps]
   โ””โ”€ Physical access   [HIGH RISK - rubber-hose]

OVERALL RISK: MEDIUM
(Depends heavily on endpoint security and password strength)

๐ŸŽจ Extension Points

Want to add new features? Here are the extension points:

1. New Manifest Version

# In crypto.py โ€” new manifest versions follow this pattern
# MEOW2 through MEOW5 are already implemented:
#   MODE_MEOW2 = 0x02 (password-only)
#   MODE_MEOW3 = 0x03 (X25519 forward secrecy)
#   MODE_MEOW4 = 0x04 (ML-KEM-1024 + X25519, paranoid)
#   MODE_MEOW5 = 0x05 (ML-KEM-768 + X25519, default PQ hybrid)
# Adding a new version requires updating pack_manifest/unpack_manifest

2. New Steganography Algorithm

# In ninja_cat_ultra.py
class SuperNinjaCat(NinjaCatUltra):
    """Even stealthier than ULTRA!"""

    def apply_quantum_stego(self, frame):
        # Your quantum stego code

3. New Cat Breed Preset

# In cat_utils.py
CAT_BREED_PRESETS[CatBreed.RAGDOLL] = {
    "stego_palette": "fluffy-cream",
    "success_message": "๐Ÿ˜ป Ragdoll says: So soft, so secure!",
    # Your preset
}

4. New GUI Tab

# In meow_dashboard.py
def _create_statistics_tab(self):
    """Add a statistics/analytics tab."""
    with dpg.tab(label="๐Ÿ“Š Statistics"):
        # Your tab UI

๐ŸŒ WASM Browser Architecture

The crypto core is also available as a WebAssembly module for browser-based encryption:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    BROWSER ENVIRONMENT                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   Main Thread โ”‚    โ”‚   Web Worker     โ”‚    โ”‚  Service    โ”‚ โ”‚
โ”‚  โ”‚  (UI)         โ”‚<โ”€โ”€>โ”‚  (crypto-worker) โ”‚    โ”‚  Worker     โ”‚ โ”‚
โ”‚  โ”‚               โ”‚    โ”‚                  โ”‚    โ”‚  (caching)  โ”‚ โ”‚
โ”‚  โ”‚ wasm_browser_ โ”‚    โ”‚ crypto_core.wasm โ”‚    โ”‚  sw.js      โ”‚ โ”‚
โ”‚  โ”‚ example.html  โ”‚    โ”‚ + JS bindings    โ”‚    โ”‚             โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚         โ”‚                      โ”‚                               โ”‚
โ”‚         โ–ผ                      โ–ผ                               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚                    WASM CRYPTO CORE                       โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚ โ”‚
โ”‚  โ”‚  โ”‚ AES-256-GCM โ”‚ โ”‚ Argon2id KDF โ”‚ โ”‚ X25519 / ML-KEM   โ”‚  โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  (AEAD)     โ”‚ โ”‚ (64-512 MiB) โ”‚ โ”‚ (hybrid PQ)       โ”‚  โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚ โ”‚
โ”‚  โ”‚  Rust โ†’ wasm-pack โ†’ crypto_core.wasm                      โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

WASM Feature Parity

Feature CLI (Python) WASM Browser Notes
AES-256-GCM โœ… โœ… Identical AEAD
Argon2id โœ… 512/20 โœ… Configurable Web: 4 security levels
X25519 โœ… โœ… Forward secrecy
ML-KEM-1024 โœ… โœ… Requires wasm-pq feature
Schrรถdinger Mode โœ… โœ… Dual-secret deniability
Fountain Codes โœ… โœ… Full support (Python CLI + JavaScript web demo)
Steganography โœ… Level 1-5 โš ๏ธ Level 1-2 Canvas limitations
Hardware Keys โœ… โŒ WebAuthn planned

Building WASM

# Standard build
make build-wasm

# With Post-Quantum ML-KEM-1024
wasm-pack build crypto_core --target web --release --features wasm-pq

๐Ÿพ Cat-Themed Architecture Fun Facts

  1. Hissing (encryption) happens in crypto.py ๐Ÿ”
  2. Purring (decryption) also in crypto.py ๐Ÿ˜ป
  3. Kibbles (droplets) are dispensed by fountain.py ๐Ÿ–
  4. Paw Prints (QR codes) made by qr_code.py ๐Ÿพ
  5. Yarn Balls (GIFs) created by gif_handler.py ๐Ÿงถ
  6. Nine Lives (forward secrecy) in forward_secrecy.py ๐Ÿฑ
  7. Quantum Nine Lives (post-quantum) in pq_hybrid.py ๐Ÿ”ฎ (pq_crypto_real.py is deprecated)
  8. Ninja Cat (steganography) in ninja_cat_ultra.py ๐Ÿฅท
  9. Prowling (low-memory) in prowling_mode.py ๐Ÿพ
  10. Collar Tags (manifests) in all the above! ๐Ÿท๏ธ

๐Ÿพ "The architecture is like a cat: elegant, mysterious, and always lands on its feet!" ๐Ÿ˜บ


๐Ÿ”ฌ Multi-Layer Steganography Audit Results

The multi-layer stego system (stego_multilayer.py) underwent a comprehensive 4-session audit (see docs/STEGO_AUDIT_REPORT.md for full details).

Metric Result Threshold
Artifacts tested 43/43 PASS โ€”
Unit tests 252/252 PASS โ€”
RS detection (max) 0.048 < 0.3
Chiยฒ detection (max) 0.000 < 0.3
SPA rate (max) 0.015 < 0.15
PSNR (min) 36.2 dB > 30 dB
SSIM (min) 0.9978 > 0.99
Bugs found & fixed 11 โ€”
STC algorithm Viterbi trellis (Rust), rate 1/4, ~1s encode โ€”

Key changes from audit:

  • Output format switched to APNG (lossless) โ€” GIF palette quantization destroys LSB data
  • STC algorithm replaced: Gaussian elimination โ†’ Viterbi trellis (50ร— faster, 100% reliable)
  • Round-trip decode fixed (sequential frame fill strategy)
  • SPA reimplemented (Dumitrescu-Wu-Wang method)

Last Updated: 2026-02-25 Version: 1.0.0 (INTERNAL REVIEW โ€” no external audit) Status: Production