Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 69 additions & 67 deletions doc/code/converters/0_converters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,73 +77,75 @@
"16 text binary_path WordDocConverter\n",
"17 text image_path AddImageTextConverter\n",
"18 text image_path QRCodeConverter\n",
"19 text text AnsiAttackConverter\n",
"20 text text ArabicPresentationFormConverter\n",
"21 text text ArabiziConverter\n",
"22 text text AsciiArtConverter\n",
"23 text text AsciiSmugglerConverter\n",
"24 text text AskToDecodeConverter\n",
"25 text text AtbashConverter\n",
"26 text text Base2048Converter\n",
"27 text text Base64Converter\n",
"28 text text BidiConverter\n",
"29 text text BinAsciiConverter\n",
"30 text text BinaryConverter\n",
"31 text text BrailleConverter\n",
"32 text text CaesarConverter\n",
"33 text text CharSwapConverter\n",
"34 text text CharacterSpaceConverter\n",
"35 text text CodeChameleonConverter\n",
"36 text text ColloquialWordswapConverter\n",
"37 text text DecompositionConverter\n",
"38 text text DenylistConverter\n",
"39 text text DiacriticConverter\n",
"40 text text EcojiConverter\n",
"41 text text EmojiConverter\n",
"42 text text FirstLetterConverter\n",
"43 text text FlipConverter\n",
"44 text text IPAConverter\n",
"45 text text ImagePromptStyleConverter\n",
"46 text text InsertPunctuationConverter\n",
"47 text text JsonStringConverter\n",
"48 text text LLMGenericTextConverter\n",
"49 text text LeetspeakConverter\n",
"50 text text MaliciousQuestionGeneratorConverter\n",
"51 text text MathObfuscationConverter\n",
"52 text text MathPromptConverter\n",
"53 text text MorseConverter\n",
"54 text text NatoConverter\n",
"55 text text NegationTrapConverter\n",
"56 text text NoiseConverter\n",
"57 text text PersuasionConverter\n",
"58 text text PolicyPuppetryConverter\n",
"59 text text ROT13Converter\n",
"60 text text RandomCapitalLettersConverter\n",
"61 text text RandomTranslationConverter\n",
"62 text text RepeatTokenConverter\n",
"63 text text ScientificTranslationConverter\n",
"64 text text SearchReplaceConverter\n",
"65 text text SelectiveTextConverter\n",
"66 text text SneakyBitsSmugglerConverter\n",
"67 text text StringJoinConverter\n",
"68 text text SuffixAppendConverter\n",
"69 text text SuperscriptConverter\n",
"70 text text TaskFramingConverter\n",
"71 text text TatweelConverter\n",
"72 text text TemplateSegmentConverter\n",
"73 text text TenseConverter\n",
"74 text text TextJailbreakConverter\n",
"75 text text ToneConverter\n",
"76 text text ToxicSentenceGeneratorConverter\n",
"77 text text TranslationConverter\n",
"78 text text UnicodeConfusableConverter\n",
"79 text text UnicodeReplacementConverter\n",
"80 text text UnicodeSubstitutionConverter\n",
"81 text text UrlConverter\n",
"82 text text VariationConverter\n",
"83 text text VariationSelectorSmugglerConverter\n",
"84 text text ZalgoConverter\n",
"85 text text ZeroWidthConverter\n"
"19 text text AcrosticConverter\n",
"20 text text AnsiAttackConverter\n",
"21 text text ArabicPresentationFormConverter\n",
"22 text text ArabiziConverter\n",
"23 text text AsciiArtConverter\n",
"24 text text AsciiSmugglerConverter\n",
"25 text text AskToDecodeConverter\n",
"26 text text AtbashConverter\n",
"27 text text Base2048Converter\n",
"28 text text Base64Converter\n",
"29 text text BidiConverter\n",
"30 text text BinAsciiConverter\n",
"31 text text BinaryConverter\n",
"32 text text BrailleConverter\n",
"33 text text CaesarConverter\n",
"34 text text CharSwapConverter\n",
"35 text text CharacterSpaceConverter\n",
"36 text text CodeChameleonConverter\n",
"37 text text ColloquialWordswapConverter\n",
"38 text text DecompositionConverter\n",
"39 text text DenylistConverter\n",
"40 text text DiacriticConverter\n",
"41 text text EcojiConverter\n",
"42 text text EmojiConverter\n",
"43 text text FirstLetterConverter\n",
"44 text text FlipConverter\n",
"45 text text IPAConverter\n",
"46 text text ImagePromptStyleConverter\n",
"47 text text InsertPunctuationConverter\n",
"48 text text JsonStringConverter\n",
"49 text text LLMGenericTextConverter\n",
"50 text text LeetspeakConverter\n",
"51 text text MaliciousQuestionGeneratorConverter\n",
"52 text text MathObfuscationConverter\n",
"53 text text MathPromptConverter\n",
"54 text text MorseConverter\n",
"55 text text NatoConverter\n",
"56 text text NegationTrapConverter\n",
"57 text text NoiseConverter\n",
"58 text text PersuasionConverter\n",
"59 text text PolicyPuppetryConverter\n",
"60 text text ROT13Converter\n",
"61 text text RandomCapitalLettersConverter\n",
"62 text text RandomTranslationConverter\n",
"63 text text RepeatTokenConverter\n",
"64 text text ScientificTranslationConverter\n",
"65 text text SearchReplaceConverter\n",
"66 text text SelectiveTextConverter\n",
"67 text text SneakyBitsSmugglerConverter\n",
"68 text text StringJoinConverter\n",
"69 text text SuffixAppendConverter\n",
"70 text text SuperscriptConverter\n",
"71 text text TaskFramingConverter\n",
"72 text text TatweelConverter\n",
"73 text text TemplateSegmentConverter\n",
"74 text text TenseConverter\n",
"75 text text TextJailbreakConverter\n",
"76 text text ToneConverter\n",
"77 text text ToxicSentenceGeneratorConverter\n",
"78 text text TranslationConverter\n",
"79 text text UnicodeConfusableConverter\n",
"80 text text UnicodeReplacementConverter\n",
"81 text text UnicodeSubstitutionConverter\n",
"82 text text UrlConverter\n",
"83 text text VariationConverter\n",
"84 text text VariationSelectorSmugglerConverter\n",
"85 text text VigenereConverter\n",
"86 text text ZalgoConverter\n",
"87 text text ZeroWidthConverter\n"
]
}
],
Expand Down
5 changes: 4 additions & 1 deletion doc/code/converters/1_text_to_text_converters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"Non-LLM converters use deterministic algorithms to transform text. These include:\n",
"- **Encoding**: Base64, Binary, Morse, NATO phonetic, etc.\n",
"- **Obfuscation**: Leetspeak, Unicode manipulation, character swapping, ANSI escape codes\n",
"- **Text manipulation**: ROT13, Caesar cipher, Atbash, etc."
"- **Text manipulation**: ROT13, Caesar cipher, Atbash, Vigenere cipher, etc."
]
},
{
Expand Down Expand Up @@ -76,6 +76,7 @@
"NATO: text: Tango Echo Lima Lima Mike Echo Hotel Oscar Whiskey Tango Oscar Charlie Uniform Tango Delta Oscar Whiskey November Alfa Tango Romeo Echo Echo\n",
"Caesar: text: whoo ph krz wr fxw grzq d wuhh\n",
"Atbash: text: gvoo nv sld gl xfg wldm z givv\n",
"Vigenere: text: dijv qc rsu ds aex byal k xpoi\n",
"Braille: text: ⠞⠑⠇⠇ ⠍⠑ ⠓⠕⠺ ⠞⠕ ⠉⠥⠞ ⠙⠕⠺⠝ ⠁ ⠞⠗⠑⠑\n",
"ASCII Art: text: # ## ## # # # # # \n",
" #### ### # # ## # ### #### ### # # #### ### ### # # #### #### ### # # # ## #### #### # ## ### ### \n",
Expand Down Expand Up @@ -110,6 +111,7 @@
" NatoConverter,\n",
" NegationTrapConverter,\n",
" ROT13Converter,\n",
" VigenereConverter,\n",
")\n",
"from pyrit.setup import IN_MEMORY, initialize_pyrit_async\n",
"\n",
Expand All @@ -126,6 +128,7 @@
"print(\"NATO:\", await NatoConverter().convert_async(prompt=prompt)) # type: ignore\n",
"print(\"Caesar:\", await CaesarConverter(caesar_offset=3).convert_async(prompt=prompt)) # type: ignore\n",
"print(\"Atbash:\", await AtbashConverter().convert_async(prompt=prompt)) # type: ignore\n",
"print(\"Vigenere:\", await VigenereConverter(key=\"key\").convert_async(prompt=prompt)) # type: ignore\n",
"print(\"Braille:\", await BrailleConverter().convert_async(prompt=prompt)) # type: ignore\n",
"print(\"ASCII Art:\", await AsciiArtConverter().convert_async(prompt=prompt)) # type: ignore\n",
"print(\"Ecoji:\", await EcojiConverter().convert_async(prompt=prompt)) # type: ignore\n",
Expand Down
4 changes: 3 additions & 1 deletion doc/code/converters/1_text_to_text_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Non-LLM converters use deterministic algorithms to transform text. These include:
# - **Encoding**: Base64, Binary, Morse, NATO phonetic, etc.
# - **Obfuscation**: Leetspeak, Unicode manipulation, character swapping, ANSI escape codes
# - **Text manipulation**: ROT13, Caesar cipher, Atbash, etc.
# - **Text manipulation**: ROT13, Caesar cipher, Atbash, Vigenere cipher, etc.

# %% [markdown]
# ### 1.1 Basic Encoding Converters
Expand All @@ -51,6 +51,7 @@
NatoConverter,
NegationTrapConverter,
ROT13Converter,
VigenereConverter,
)
from pyrit.setup import IN_MEMORY, initialize_pyrit_async

Expand All @@ -67,6 +68,7 @@
print("NATO:", await NatoConverter().convert_async(prompt=prompt)) # type: ignore
print("Caesar:", await CaesarConverter(caesar_offset=3).convert_async(prompt=prompt)) # type: ignore
print("Atbash:", await AtbashConverter().convert_async(prompt=prompt)) # type: ignore
print("Vigenere:", await VigenereConverter(key="key").convert_async(prompt=prompt)) # type: ignore
print("Braille:", await BrailleConverter().convert_async(prompt=prompt)) # type: ignore
print("ASCII Art:", await AsciiArtConverter().convert_async(prompt=prompt)) # type: ignore
print("Ecoji:", await EcojiConverter().convert_async(prompt=prompt)) # type: ignore
Expand Down
2 changes: 2 additions & 0 deletions pyrit/converter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
from pyrit.converter.unicode_sub_converter import UnicodeSubstitutionConverter
from pyrit.converter.url_converter import UrlConverter
from pyrit.converter.variation_converter import VariationConverter
from pyrit.converter.vigenere_converter import VigenereConverter
from pyrit.converter.word_doc_converter import WordDocConverter
from pyrit.converter.zalgo_converter import ZalgoConverter
from pyrit.converter.zero_width_converter import ZeroWidthConverter
Expand Down Expand Up @@ -243,6 +244,7 @@ def __getattr__(name: str) -> object:
"UrlConverter",
"VariationConverter",
"VariationSelectorSmugglerConverter",
"VigenereConverter",
"WordDocConverter",
"WordIndexSelectionStrategy",
"WordKeywordSelectionStrategy",
Expand Down
Loading