ComfyUI Node

ADFGX Cipher

Five Letters, One Keyword

By AzelusLightvale·Created 12 months ago·Updated about 10 hours ago· 1
ADFGX Cipher
    • encrypted_txt
    textHello World!
    alphabetENGLISH
    modetrue
    keep_formattingtrue
    key

    ADFGX is the 1918 German field cipher that ADFGVX grew out of, and the difference is one letter and five characters of alphabet. Both encrypt to a stream of coordinate letters, but ADFGX uses a 5×5 Polybius square - no digits, and I/J get merged into one cell - so its ciphertext only ever contains five distinct letters: A, D, F, G, X. If you're solving an ARG and the encoded text is made of exactly those five letters, this is the node you want. If you see a sixth (V) anywhere, you've got ADFGVX instead.

    Mechanically it's the same two-stage recipe as its sibling: map each plaintext letter to a two-letter coordinate pair from the square, then run the whole string through a columnar transposition keyed by your keyword. That second step is what makes it a proper cipher rather than a glorified coordinate lookup. Like all the classical nodes in the ARG Toolkit, it's a thin wrapper over secretpy, so its behavior matches the reference implementations you'd find on dCode or cryptii.

    The inputs that matter

    The node's surface is identical to every other classical cipher in the pack:

    • key - any text in the alphabet's language; this drives the transposition. Empty by default, and empty means a trivially weak cipher, so type something.
    • mode - toggle between encrypting and decrypting. On = encrypt, off = decrypt.
    • text / alphabet / keep_formatting - your message, the character set (leave ENGLISH), and whether spaces/punctuation are preserved or stripped.

    Output is a single encrypted_txt STRING. Note the key tooltip here says "in the alphabet's language" whereas ADFGVX says "in English" - for a default ENGLISH alphabet they're the same thing, but if you swap the alphabet to another language the ADFGX key is expected to match it.

    Where people get burned

    The single most common mistake is mixing the two siblings. People encrypt with ADFGX, then try to decrypt with ADFGVX, or vice versa - the extra character in the square changes the whole coordinate mapping, so you'll get pure nonsense instead of an error. Pick one cipher and one node and stick with it for both directions.

    The other trap is the key. Transposition ciphers are all-or-nothing: one wrong character in the keyword and the decrypt output is garbage with no warning. If you're reusing a key from an online tool, watch for case sensitivity - the pack lowercases string keys in the shared cipher core, so a key that worked elsewhere might need the same treatment here.

    Installing it

    This node ships in the one-pack-fits-all ARG Toolkit. Either install via ComfyUI Manager (search "ComfyUI ARG Toolkit") or:

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

    Restart ComfyUI, and you'll find it under ARG Toolkit → Cryptography → Classical. Manager handles the secretpy dependency for the classical ciphers; manual clones need pip install -r requirements.txt. No models, no downloads, pure Python.

    Troubleshooting

    • Five distinct letters in the ciphertext, decryption fails → wrong key, or mode still set to encrypt.
    • Six distinct letters → you grabbed the ADFGVX node by mistake.
    • Want to double-check against an external tool → the README's "Related projects" list (CyberChef, dCode.fr, cryptii) is your cross-validation kit; if outputs disagree, flip keep_formatting first, since that toggle changes the exact string you're comparing.

    ADFGX is the more historically "authentic" of the two field ciphers and the one that shows up in a lot of older puzzle references. For a modern ARG you'd usually reach for ADFGVX (letters and digits make it much more flexible), but when the puzzle says ADFGX, this node speaks its language.

    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