Skip to content

FEAT: Add runic/ogham (Leetspeak configs) + mirror/upside_down Encoding techniques - #4455

Open
Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:gap1-character-map
Open

Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:gap1-character-map

Conversation

@romanlutz

@romanlutz Roman Lutz (romanlutz) commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds four Unicode symbol-script / style Encoding techniques.

  • runic, ogham — implemented as LeetspeakConverter(custom_substitutions=…) configs (no dedicated class; glyph tables kept as _RUNIC_SUBSTITUTIONS / _OGHAM_SUBSTITUTIONS). Sources: Unicode Runic (U+16A0) and Ogham (U+1680) blocks.
  • mirror, upside_down — kept as dedicated converters on a shared CharacterMapConverter base, because they combine a case-specific glyph map with full-string reversal (a case-folded Leetspeak table can't express C→Ɔ, R→Я, or the reversal). Source: community symbol-script transforms (elder-plinius's P4RS3LT0NGV3).

gap-1 converter series: #4441 #4442 #4443 #4444 #4445 #4446 #4447 #4448 #4449 #4450 #4451 #4452 #4454 #4455 #4456 #4457 #4458

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The concrete CharacterMapConverter helper is automatically registered and exposed as a usable converter, but its empty mapping silently leaves prompts unchanged.

1 open issue
What changed in this PR

This PR adds four text-obfuscation converters to PyRIT, sharing character-mapping logic and integrating them into the Garak Encoding scenario.

Changes:

  • Adds Runic, Ogham, Mirror, and UpsideDown converters with lazy public exports.
  • Includes all four in exhaustive Encoding runs while preserving the curated default.
  • Adds converter unit tests, updates technique-selection assertions, and extends Python documentation examples.
File Description
tests/​unit/​scenario/​garak/​test_encoding.py Updates exhaustive technique membership and count.
tests/​unit/​converter/​test_upside_down_converter.py Tests rotation mappings, reversal, and input validation.
tests/​unit/​converter/​test_runic_converter.py Tests rune mappings, case handling, and passthrough.
tests/​unit/​converter/​test_ogham_converter.py Tests Ogham mappings, spacing, and passthrough.
tests/​unit/​converter/​test_mirror_converter.py Tests mirrored glyphs, reversal, and input validation.
pyrit/​scenario/​scenarios/​garak/​encoding.py Adds four selectable encoding techniques and converter variants.
pyrit/​converter/​upside_down_converter.py Defines rotated glyph mappings with reversed output.
pyrit/​converter/​runic_converter.py Defines case-insensitive Elder Futhark mappings.
pyrit/​converter/​ogham_converter.py Defines case-insensitive Ogham mappings.
pyrit/​converter/​mirror_converter.py Defines mirrored glyph mappings with reversed output.
pyrit/​converter/​_character_map.py Shares substitution, case handling, reversal, and validation.
pyrit/​converter/​__init__.py Exposes all four converters through lazy exports.
doc/​code/​converters/​1_text_to_text_converters.py Adds usage examples for the new converters.

Review effort: Balanced

from pyrit.models import PromptDataType


class CharacterMapConverter(Converter):
@romanlutz Roman Lutz (romanlutz) changed the title FEAT: Add Runic/Ogham/Mirror/UpsideDown on a shared CharacterMapConverter base FEAT: Add runic/ogham (Leetspeak configs) + mirror/upside_down Encoding techniques Nov 20, 2026
@romanlutz

Copy link
Copy Markdown
Contributor Author

Reworked per the reuse-before-adding guidance: runic and ogham are now LeetspeakConverter(custom_substitutions=…) configs (no dedicated class; the glyph tables are retained as _RUNIC_SUBSTITUTIONS / _OGHAM_SUBSTITUTIONS). Mirror and UpsideDown keep dedicated converters on a shared CharacterMapConverter base, because they combine a case-specific glyph map with full-string reversal — a case-folded Leetspeak table can't express the uppercase-specific glyphs (e.g. C→Ɔ, R→Я) or the reversal. Happy to revisit if you'd prefer a different split.

…cterMap) Encoding techniques

Per review (reuse and compose before adding): runic and ogham are implemented as LeetspeakConverter substitution tables (no dedicated class). Mirror and UpsideDown keep dedicated converters on a shared CharacterMapConverter base because they combine a case-specific glyph map with full-string reversal, which a case-folded Leetspeak table cannot express.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants