Nodes/ComfyUI ARG Toolkit/Bazeries Cipher
ComfyUI Node

Bazeries Cipher

The Bifid's Big-Square Cousin With a Number for a Key

By AzelusLightvale·Created 12 months ago·Updated about 15 hours ago· 1
Bazeries Cipher
    • encrypted_txt
    textHello World!
    alphabetENGLISH
    modetrue
    keep_formattingtrue
    key32

    Bazeries is the obscure-but-legit classical cipher in the pack - the kind that makes a puzzle feel researched, because almost nobody reaches for it. Named after Étienne Bazeries, the French military cryptanalyst who famously broke a German transposition cipher in the 1890s, it's a fractionating cipher: it runs your plaintext through a Polybius square to get digit pairs, splits those digits into groups, then re-splits each group using a numeric key. The net effect is that the same letter encrypts differently depending on where it lands, and the whole thing is keyed by a plain integer rather than a word. That alone makes it stand out from the Vigenère-style word-key ciphers that dominate the menu.

    The numeric key is the signature detail. The node's key input is an INT (default 32), and the tooltip asks for any non-negative integer. That integer gets turned into a set of group sizes (the "Bazeries key" is usually given as a number like 32, which breaks into 3 and 2), and the digits of your message are then re-split and read through a second, transposed square. This is the bit that makes it a pain to hand-crack - the grouping is part of the key, so an analyst has to figure out both the square order and the number.

    The inputs that matter

    • key (INT) - the numeric key, default 32. Change it and the entire grouping changes. Write it down; decrypt needs the identical value.
    • mode - encrypt/decrypt toggle (on = encrypt).
    • text, alphabet, keep_formatting - the standard classical kit, alphabet defaulting to ENGLISH.

    Output is the usual single encrypted_txt STRING.

    Where people get burned

    The biggest surprise is the key type. If you're used to typing keywords, reaching for this node and finding an integer field throws you - but it's correct: Bazeries is numerically keyed. The second trap is the default. Leaving key at 32 (the default) and expecting "no key" behavior is a mistake; 32 is a key, just a very guessable one. A solver who assumes default parameters will crack it in seconds. For an ARG, set a less obvious number. Finally, because Bazeries is a fractionating cipher, output length doesn't map cleanly to input length and the ciphertext can look like a jumble of digits rendered as letters - don't mistake that for a broken node.

    One more genuine quirk: the pack's shared preprocessing lowercases and strips your input before encrypting. Bazeries is case-insensitive by design, but if you're cross-checking against an online reference, make sure both sides strip formatting the same way.

    Installing it

    Standard ARG Toolkit install:

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

    Restart ComfyUI and it's under ARG Toolkit → Cryptography → Classical (or ComfyUI Manager → search "ComfyUI ARG Toolkit"). Classical ciphers ride on secretpy, auto-installed by Manager (or pip install -r requirements.txt for manual clones). Pure Python, no models.

    Troubleshooting

    • Decrypt produces garbage → the integer key doesn't match the one used to encrypt. Exact value or nothing.
    • "No key field?" moment → there is one, it's an integer field. It's easy to miss because the family defaults to string keys.
    • Output doesn't match a reference → check keep_formatting and confirm the reference implements the same Bazeries variant.

    Bazeries is the cipher you pull out when the puzzle should feel like it came from a period piece - a real, historical, numeric-keyed construction that rewards solvers who know their cipher history. In a pack full of ADFGX and Vigenère, it's the deep cut.

    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.
    keyINT32Accepts any non-negative integer as the key to decrypt/encrypt.

    Outputs (1)

    NameTypeDescription
    encrypted_txtSTRING