Skip to content

feat: add zero-width character plugin#117

Open
Lalatenduswain wants to merge 1 commit into
ReversecLabs:developfrom
Lalatenduswain:feat-zero-width-plugin
Open

feat: add zero-width character plugin#117
Lalatenduswain wants to merge 1 commit into
ReversecLabs:developfrom
Lalatenduswain:feat-zero-width-plugin

Conversation

@Lalatenduswain

Copy link
Copy Markdown

Summary

Adds a zero-width obfuscation plugin that interleaves invisible zero-width Unicode characters between the visible characters of the text.

To a human reader (and in most UIs) the text looks unchanged, but the underlying byte sequence no longer contains any contiguous ASCII substring — defeating naive keyword/regex filters, substring denylists, and byte-level matching. It is the interspersing counterpart to the recently-added homoglyph plugin:

  • ascii_smuggler replaces text with invisible Unicode tag characters (visible content disappears).
  • homoglyph substitutes Latin glyphs with look-alike confusables (every visible code point changes).
  • zero_width keeps the original visible glyphs intact and injects invisible separators between them.

Options

  • char — which zero-width character to insert: zwsp (U+200B, default), zwnj (U+200C), zwj (U+200D), wj (U+2060), zwnbsp/bom (U+FEFF).
  • ratio — fraction of inter-character gaps to fill, 0.0–1.0 (default 1.0, deterministic).
  • seed — optional integer seed for reproducible partial output when ratio < 1.0.

Changes

  • spikee/plugins/zero_width.py — new plugin (subclasses BasicPlugin, so exclude_patterns handling is inherited; tagged Encoding, Obfuscation). Style mirrors homoglyph.py.
  • tests/functional/test_spikee_list.py — assert zero_width is discoverable via spikee list plugins.
  • docs/02_builtin.md — add zero_width to the built-in plugins reference table.

Usage

spikee generate --plugins zero_width
spikee generate --plugins zero_width --plugin-options "zero_width:char=zwnj"
spikee generate --plugins zero_width --plugin-options "zero_width:ratio=0.5,seed=42"

Testing

  • Verified via the module loader: visible text is preserved (strips back to the original), no contiguous ASCII substring remains, char/ratio/seed behave, and exclude_patterns tokens are preserved verbatim.
  • spikee list plugins shows zero_width under Encoding, Obfuscation.
  • All functional tests pass locally on the develop base (116 passed: test_spikee_list, test_module_loading, full test_spikee_generate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant