Skip to content

Add MKV (Matroska/WebM) steganography engine#22

Open
niclashedam wants to merge 1 commit into
masterfrom
mkv
Open

Add MKV (Matroska/WebM) steganography engine#22
niclashedam wants to merge 1 commit into
masterfrom
mkv

Conversation

@niclashedam

Copy link
Copy Markdown
Owner

Adds a fourth engine, MkvEngine, giving Lupin Matroska (.mkv) and WebM support, detected via the EBML header magic. It hides the payload behind a Lupin\0 signature in an EBML Void element appended as the last child inside the Segment. Void is the spec's reserved/padding primitive that every conformant reader skips, so the media streams and playback are untouched.

The approach is safe on real files because Matroska seek indexes (SeekHead/Cues) are Segment-relative: appending after all existing children preserves every offset, so no re-indexing is needed. The Segment size field is rewritten for known-size Segments and left alone for unknown-size ones. Verified against a real ffmpeg-produced .mkv — embed/extract round-trips, the decoded video is bit-identical (same MD5), and full-frame decode reports no errors.

Registered in EngineRouter so the CLI and API pick it up automatically. Adds LupinError::MkvInvalidFormat / MkvNoHiddenData, 15 engine tests, examples/cat.mkv + examples/out.mkv samples, and docs. Capacity-only, consistent with the other engines; EmbedMode::Stealth returns StealthNotSupported.

@niclashedam niclashedam added the enhancement New feature or request label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant