ADFGVX Cipher
The WWI Cipher That Looks Exactly Like Secret-Agent Stuff
- encrypted_txt
When a puzzle needs to feel like a real code - the kind of thing a spy would have clipped to a coat lining - ADFGVX is what you want. Every encrypted message comes out as a jumble of just six letters, A D F G V X, which instantly reads as "genuine wartime cipher" even though it's sitting on top of ComfyUI. It was a real German field cipher in 1918, and it's genuinely clever: a 6×6 Polybius square maps letters and digits to two-letter coordinates, then a keyword-driven columnar transposition scrambles the pairs. That two-stage trick is why it survived cryptanalysis longer than most of its contemporaries.
In the ARG Toolkit, ADFGVX is one of the classical ciphers powered by secretpy, so it inherits the same clean, predictable interface every cipher node in the pack shares. Reach for it when you want a message that's obviously encrypted but still solvable by hand with a bit of effort - the classic ARG middle ground between "trivially breakable Caesar" and "modern AES you'll never crack."
The inputs that matter
The shared classical-cipher inputs are all here, and there are really only two you'll touch most sessions:
key- the keyword, any English text, used for the transposition step. Empty by default, but give it one; a keyword-less ADFGVX is barely a cipher at all.mode- toggle between encrypting and decrypting. On = encrypt.
The others are the pack's standard kit: text is your message, alphabet defaults to ENGLISH (leave it unless you know why you're changing it - the tooltip points out it can also take the alphabets secretpy defines), and keep_formatting decides whether spaces and punctuation survive the round trip or get stripped for a cleaner ciphertext. The single output, encrypted_txt, is a STRING you can pipe straight into a Text node, an image overlay, or a hint.
The gotcha most people hit
ADFGVX expects the key in the cipher's language, and it's case- and content-sensitive in ways that aren't obvious at first. Encrypt "Hello World" with key SECRET, then flip mode off, type the same key, and you should get your text back - but change a single character of the key and you get garbage, not an error. That's normal and correct behavior for a transposition cipher, so don't file it as a bug. If decrypting gives you nonsense, your key is wrong, not the node.
One more thing: ADFGVX is the 6×6, letters-plus-digits version. Its slightly older sibling ADFGX uses a 5×5 square (no digits, I/J merged) - if your ciphertext only contains five letters, you're looking at the wrong node.
Installing it
This is one node inside the ARG Toolkit pack, so you install the whole pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI, then look under ARG Toolkit → Cryptography → Classical. Or skip the terminal entirely: ComfyUI Manager → search "ComfyUI ARG Toolkit" → Install. The classical ciphers need the secretpy dependency, which Manager installs automatically (or pip install -r requirements.txt if you cloned by hand). No model downloads, no weights, nothing GPU-related - this pack's cipher nodes are pure Python.
Troubleshooting
- Decrypt output is garbage → wrong key, or
modestill on encrypt. - Ciphertext has only 5 distinct letters → you want the ADFGX node, not this one.
- Output doesn't match a reference tool → flip
keep_formatting; the pack strips or preserves spaces/punctuation depending on the toggle, and reference tools often do the opposite by default.
If you're coming from dCode.fr or CyberChef, this node is just those tools wearing a ComfyUI coat - same math, same results, and now it lives inside your graph.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Hello World! | — |
| alphabet | STRING | ENGLISH | Input 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. |
| mode | BOOLEAN | true | Toggle between encrypting or decrypting a message. |
| keep_formatting | BOOLEAN | true | Toggle between preserving the format of the message or remove all spaces, punctuations, and convert to lowercase. |
| key | STRING | Accepts any text in English as the key to decrypt/encrypt. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| encrypted_txt | STRING | — |