Caesar (ROT) Cipher
The ROT node that starts every ARG
- encrypted_txt
The Caesar cipher is the "hello world" of cryptography, and the Caesar node is the pack's version of it: shift every letter in the alphabet by a fixed number and you've got a message. ROT13 (shift by 13) is the famous case because it's its own inverse - encrypt twice and you're back to plaintext. This is the node you reach for when a puzzle drops a string of letters that just feels one letter off, because the first thing you try on any single-alphabet ciphertext is "is it just shifted?" It's also the gentlest possible on-ramp to the whole classical-cipher section: every cipher node in that category shares the same input layout, so once you've run a Caesar you can operate all of them.
The defaults are thoughtfully chosen - key defaults to 13, mode to encrypt - which makes the first run instantly recognizable: type "Hello World!", hit run, and you get "Uryyb Jbeyq!". That's the moment it clicks.
How it works
The classical ciphers are all powered by the secretpy library, and this node is a thin wrapper around secretpy.Caesar. Text is preprocessed according to your settings: with keep_formatting on (the default), spaces and punctuation survive and letter case is preserved; with it off, everything is stripped to lowercase letters only. Then each letter is rotated through the alphabet by the integer key. Encryption adds, decryption subtracts, and the alphabet is where you get clever.
The alphabet field defaults to ENGLISH, but it's not just a dropdown - it's a text input that accepts either a named secretpy alphabet (ENGLISH, RUSSIAN, and friends) or any custom alphabet string in connected form like abcdefghijklmnopqrstuvwxyz. Want ROT on a custom character set? Type your own alphabet and shift within it. The tooltip spells out the rules, and it applies identically to every cipher in the pack.
The inputs that matter
text- the message. Has to match the alphabet's language.key- an integer shift. Default 13, accepts any non-negative value.alphabet-ENGLISHby default; leave it or type a custom alphabet.mode- the boolean toggle, labeledencrypt/decrypt. This is the one you'll flip constantly when testing.keep_formatting- preserve spaces/punctuation/case (on) or reduce to lowercase letters (off).
Output: a single encrypted_txt string.
Installing it
Ships in the ComfyUI ARG Toolkit pack. Install via ComfyUI Manager (search "ComfyUI ARG Toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI. The pack installs secretpy (which powers this whole category), cryptography, stegano, invisible-watermark, reedsolo, and heavy transitive deps like torch and opencv-python - the first install takes a bit. No model downloads, no API keys.
Gotchas
A few things that trip people up. First, ROT13 only works on the English alphabet by default - a custom alphabet changes the cipher, and if your alphabet doesn't match the text's language, output gets garbled. Second, flipping keep_formatting off changes both the input you should type and the output you get - no spaces, all lowercase. And the pack is an amateur project by the author's own admission: tests cover the common cases, not every edge, so if a weird alphabet gives you a surprising result, that's the nature of the beast rather than a broken install.
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 | INT | 13 | Accepts any non-negative integer as the key to decrypt/encrypt. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| encrypted_txt | STRING | — |