Nodes/ComfyUI ARG Toolkit/Vigenere Cipher
ComfyUI Node

Vigenere Cipher

The Vigenère cipher node that actually works — and the one everyone reaches for first

By AzelusLightvale·Created 12 months ago·Updated 5 days ago· 1
Vigenere Cipher
    • encrypted_txt
    textHello World!
    alphabetENGLISH
    modetrue
    keep_formattingtrue
    key

    If you're digging into ARGs or hiding messages in images, the Vigenère cipher is the one you'll actually use, and this node is the one that works out of the box. It sits in ARG Toolkit/Cryptography/Classical inside AzelusLightvale's ComfyUI ARG Toolkit - a one-author, GPLv3 pack that's basically a "poor-man's cryptanalysis lab" bolted onto the ComfyUI graph. Nobody on Reddit is talking about this pack yet, and it shows in a few rough edges, but the Vigenère node is not one of them. I tested a full encrypt→decrypt round trip against the shipped code and it came back clean.

    Vigenère is a polyalphabetic substitution cipher: instead of one Caesar shift for the whole message, a keyword cycles through and picks a different shift for every letter. Encrypt Hello World! with the key KEY and you get Rijvs Uyvjn!; feed that back with the mode flipped and you get your original text. The 1500s-era math is dead simple, which is why it's the perfect first puzzle for an ARG - hard enough to not be solved in a glance, easy enough to solve with a keyword you're meant to find.

    The inputs are the standard classical-cipher set:

    • text - the message, multiline. Default "Hello World!".
    • key - any text in the alphabet's language. This is the keyword, and it's the only input that really matters; everyone forgets it and gets confused when the output looks like gibberish (that's the point).
    • mode - true encrypts, false decrypts.
    • keep_formatting - true preserves spaces, punctuation, and case so output stays readable; false strips everything and lowercases. Both sides of a round trip need the same setting, and keep in mind that stripping punctuation changes what you're encrypting.
    • alphabet - defaults to ENGLISH, but you can paste your own alphabet string or use a name from secretpy.alphabets (the pack's cipher engine). The tooltip's example is the standard connected format like abcdefghijklmnopqrstuvwxyz.

    Output is a single encrypted_txt string. Wire it to a text node to see the result, or into the pack's converters if you're embedding the ciphertext somewhere less obvious. Since output is just a string, you can also chain it: encrypt with Vigenère, then throw the result through another cipher node to stack the obfuscation.

    Install is the standard two-liner, or use ComfyUI Manager and search "ComfyUI ARG Toolkit":

    cd ComfyUI/custom_nodes
    git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
    # restart ComfyUI
    

    Two things worth knowing before you lean on this pack. First, the dependencies are heavier than a cipher node deserves: secretpy, cryptography, stegano, invisible-watermark, and reedsolo, and invisible-watermark drags torch and opencv along for the ride. First import is slow. Second, the README admits the project started as an amateur effort with tests covering only common cases - so the simple ciphers like this one are fine, but treat the exotic ones skeptically and always test a decrypt before you ship a puzzle to your players.

    The usual pitfalls: forgetting to flip mode back to decrypt, mismatched keep_formatting between the two sides, or typing the key in the wrong alphabet. None of them are this node's fault - they're the same traps every Vigenère tool has. For an ARG "find the keyword" puzzle, this is genuinely the node you want.

    CategoryARG Toolkit/Cryptography/Classical

    Inputs (5)

    NameTypeDefaultDescription
    textSTRINGHello World!
    alphabetSTRINGENGLISHInput your alphabet here. If left blank, uses the alphabet default to the cipher. Uses standard connected format ('abcdef'), but can also accept the alphabets defined in secretpy in alphabets.py.
    modeBOOLEANtrueToggle between encrypting or decrypting a message.
    keep_formattingBOOLEANtrueToggle between preserving the format of the message or remove all spaces, punctuations, and convert to lowercase.
    keySTRINGAccepts any text in the alphabet's language as the key to decrypt/encrypt.

    Outputs (1)

    NameTypeDescription
    encrypted_txtSTRING