Rotor Machine Rotor
One scrambler wheel, wired by hand, notched by a letter
- previous_rotor
- rotor
A rotor is the only moving part of a rotor machine, and this node is one wheel: a substitution, a ring offset, a set of turn-over points, and a link to the wheel before it. Chain three or four of these and you've built the stack that Rotor Machine State assembles into a machine.
The default wiring is EKMFLGDQVZNTOWYHXUSPAIBRCJ - that's Enigma rotor I, letter for letter. The default notches is Q, its real turn-over point. If you just press the node down and use it, you're building a historically accurate Wehrmacht wheel, which is a nice default to land on by accident.
The inputs that matter
alphabet is what the wheel considers its symbol set. Default A–Z; you can technically use any set of unique characters, and whitespace is stripped.
wiring is the substitution, written as the mapped alphabet: the i-th character of wiring is what the i-th character of alphabet becomes going forward. It has to use every alphabet symbol exactly once - the node checks and throws Wiring must use each of the 26 alphabet symbols exactly once if you paste a half-finished string or duplicate a letter. This is the most common thing to get wrong when transcribing a real rotor's wiring from a table.
notches is a set of symbols in the alphabet that means "the wheel is at a turn-over position". Q for rotor I, Q and E for the wheels that have two (VI, VII, VIII). Multiple letters work - no separator needed.
ring is the Ringstellung, an integer offset that shifts the wiring relative to the letter ring. Here's a widget worth knowing: the slider allows 0–4096, but the node validates against the alphabet size and errors with Ring must be in [0, 25] for a 26-letter wheel. So the useful range is 0 to 25, and anything above is a guaranteed error rather than a creative choice. Under the hood, the offset is subtracted from the rotor's position before the table lookup and added back after, which is exactly how a real ring setting behaves - it rotates the cipher relative to the notch without moving the notch.
invert swaps the forward and inverse tables. Set it when you want the wheel's wiring written the other direction - which is what building a reflector-as-rotor needs, since a reflector has to be its own inverse. Mostly you leave it alone for path rotors.
Chaining, and why order is the whole game
previous_rotor is the only optional input, and it's how the stack is built: wire wheel B into wheel A's previous_rotor, then A's rotor output is the chain of two. Slot 0 is the leftmost rotor. On the encrypting side the signal enters at the rightmost wheel and works leftward, so the order you chain them is the reverse of the order they touch your text - which is why the assemble node flips the list when it builds the path.
The output rotor is a ROTORS chain, and it only makes sense plugged into Rotor Machine State (as rotors, or as auxilliary_rotors). It is not a permutation, even though it feels like one - that distinction matters, because a rotor has positions and a permutation doesn't, and the machine node checks for the right type.
One consequence of chaining: the whole chain is one frozen object. Change any wheel's ring or wiring upstream and the entire machine downstream becomes a different machine, quietly. There's no versioning and no name. If you're building a puzzle, write the wheel table down next to the workflow, or the settings become unrecoverable the moment you tune one widget to see what happens.
Installing it
Manager → ComfyUI ARG Toolkit → install → restart → refresh the browser. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
pip install -r requirements.txt
The rotor nodes are pure Python and need none of the pack's heavier dependencies - no models, no image libraries, definitely no torch. But the published requirements file pins torch==2.14.1 and torchaudio==2.11.0, so a straight pip install -r for the sake of encrypting a Caesar-with-extra-steps is a big hammer. If you're only here for the classical ciphers, use Manager, or install the pack directory without its requirements and see what actually breaks - for the rotor category, typically nothing.
A sanity check
Build one rotor, leave everything default, and run it through the machine with a plugboard and no reflector: you should get a monoalphabetic substitution with a stepping offset - predictable, and easy to hand-verify letter by letter on paper. If a single wheel with default settings disagrees with your paper check, your alphabet or wiring transcription is wrong, not the cipher. Get one wheel credible before you chain four.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| alphabet | STRING | ABCDEFGHIJKLMNOPQRSTUVWXYZ | — |
| wiring | STRING | EKMFLGDQVZNTOWYHXUSPAIBRCJ | — |
| notches | STRING | Q | — |
| ring | INT | 00–4096 | — |
| invert | BOOLEAN | false | — |
| previous_rotoropt | ROTORS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| rotor | ROTORS | — |