Skip to content

Feature Request StegoMeow #2

@Capitali

Description

@Capitali

Feature Request: Cat-Image Passkeys (Steganographic QR Replacement)

Summary

Introduce an optional cat-image passkey feature: short-lived, server-signed authentication payloads invisibly embedded in cat images using robust steganography (QIM in DCT domain with ECC).
This would serve as a QR-code replacement for cross-device login while maintaining cryptographic assurances.
It aligns with MeowPassword’s branding and provides a novel, engaging UX.


Motivation

  • Current cross-device passkey flows often rely on QR codes. Functional, but visually uninspired.
  • Cat images are consistent with project branding and offer higher user delight.
  • Steganography allows us to keep images looking normal while still carrying an out-of-band (OOB) login payload.
  • This creates a differentiator: “scan the cat, not the QR.”

Proposed Methodology

Payload Structure

  • Server generates a short-lived signed object (JWT or CBOR):
    {
      "ver": 1,
      "rp": "example.com",
      "nonce": "base64url(16B)",
      "exp": 60,
      "webauthn": {
        "challenge": "base64url(32B)",
        "session": "opaque-session-id"
      },
      "sig": "Ed25519 or ECDSA signature"
    }
  • Size: ≤ 512 bytes compressed and base64url-encoded.
  • TTL: 60–120 seconds.
  • Signed by server, verified by client.

Embedding Algorithm

  • Convert RGB → YCbCr, operate on Y (luma) channel.
  • Tile into 8×8 blocks, compute 2D DCT.
  • Select mid-band coefficients (zig-zag positions ~10–20).
  • Scatter coefficients via PRNG seeded with a watermark key (wmKey).
  • Encode bits using dithered QIM (Quantization Index Modulation):
    @inline(__always)
    func qimEmbed(_ c: Float, bit: Int, step: Float) -> Float {
        let d = (bit == 0) ? -step/4 : step/4
        return step * roundf((c - d)/step) + d
    }
    
    @inline(__always)
    func qimExtract(_ c: Float, step: Float) -> Int {
        let d0 = -step/4, d1 = step/4
        let e0 = abs(c - (step * roundf((c - d0)/step) + d0))
        let e1 = abs(c - (step * roundf((c - d1)/step) + d1))
        return e1 < e0 ? 1 : 0
    }
  • Apply Reed–Solomon ECC and add a sync preamble (e.g., 64-bit Barker code).
  • Save as PNG or high-quality JPEG (Q ≥ 90).

Extraction

  • Reverse the pipeline:
    • YCbCr → DCT → extract coefficients per PRNG path.
    • QIM decode bits → sync align → ECC decode → verify CRC.
    • Decompress + base64url decode → verify server signature.
  • If valid and not expired, use payload for WebAuthn completion.

Software Architecture

New Swift Package Target: MeowStego

  • StegoEncoder / StegoDecoder
  • DCT8x8Provider with:
    • Accelerate/vDSP backend (Apple platforms)
    • Naive fallback or FFTW shim (Linux)
  • ECC module: Reed–Solomon RS(255,k)
  • PRNG: ChaCha20/AES-CTR seeded with wmKey

CLI Additions

# Embed payload into a cat
meowpass steg-embed --in cats/tabby.png --out cats/auth.png   --payload-file payload.jwt --wm-key hex:001122...

# Extract payload from a cat
meowpass steg-extract --in cats/auth.png --wm-key hex:001122... --raw

Acceptance Criteria

  • Encode/decode round trip with BER < 1% after JPEG Q=85, ±5% scale, ±5° rotation.
  • Screen→camera capture (1080p monitor → iPhone/Android) succeeds ≥95% within 2 seconds.
  • Payload verified with Ed25519/ECDSA signature and rejected if expired.
  • CLI subcommands steg-embed and steg-extract added with clear flags.
  • Graceful fallback to QR if extraction fails after N retries.
  • Unit tests:
    • Deterministic PRNG mapping
    • RS encode/decode
    • QIM property tests (bit-flip robustness)
    • End-to-end payload extraction

References

  • Chen & Wornell, Quantization Index Modulation: A Class of Provably Good Methods for Digital Watermarking and Information Embedding, IEEE TIT, 2001.
  • Robust DCT watermarking literature.
  • Existing QR-based WebAuthn out-of-band flows.

Requested Outcome

A new MeowStego library target and meowpass steg-* subcommands to generate and verify cat-image passkeys, enabling fun, branded, and secure OOB authentication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions