Nodes/ComfyUI ARG Toolkit/Trifid (Cylinder) Cipher
ComfyUI Node

Trifid (Cylinder) Cipher

The three-dimensional Polybius cube, digitized

By AzelusLightvale·Created 12 months ago·Updated 5 days ago· 1
Trifid (Cylinder) Cipher
    • encrypted_txt
    textHello World!
    alphabetENGLISH
    modetrue
    keep_formattingtrue
    key13

    If your ARG audience has already met the Polybius square - the 5×5 grid where each letter becomes a row/column pair - the Trifid cipher is the natural sequel. Invented by French cryptographer Félix Delastelle in 1902, it takes the same idea and goes three-dimensional: letters live in a 3×3×3 cube and each one becomes a triple of coordinates. Then - and this is the clever part - it mixes those coordinates up before turning them back into letters. It's a fractionating cipher: it converts letters to numbers, transposes the numbers, and converts back.

    The pack's display name calls it the "Trifid (Cylinder) Cipher," which is a small mislabel - Trifid is a cube, not a cylinder - but the node is the genuine Delastelle cipher, powered by secretpy.

    How it works

    Inputs:

    • text - your message.
    • key - an integer, default 13. It controls the grouping/transposition period of the mixing step - the number of letters processed as a block. Different keys genuinely change the output, so it's the thing you keep secret.
    • mode - encrypt/decrypt toggle.
    • keep_formatting - on preserves spaces/punctuation/case, off strips to lowercase letters.
    • alphabet - default ENGLISH, custom alphabets accepted.

    Output: encrypted_txt (STRING).

    Under the hood: the 27-character alphabet (26 letters plus a filler) is laid into a 3×3×3 cube, each letter is written as a three-digit coordinate, the coordinate digits get read out in rows, and then the rows are converted back to letters in blocks of key characters. It's genuinely confusing to do by hand, which is exactly why a node exists for it - and why it reads as "real cryptography" to puzzle players who've never seen it.

    The inputs that matter

    text and key are the whole game, with key being the secret. Tell the solver "Trifid, key 13" and they have everything; withhold the key and they have a genuinely hard puzzle on their hands. For solving, keep_formatting on gives you spaces to work with; off gives the classic solid ciphertext block.

    Installing it

    Part of ComfyUI ARG Toolkit - ComfyUI Manager (search "ComfyUI ARG Toolkit") or:

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

    Restart ComfyUI. Runs on secretpy; no model files.

    Common issues

    • Decrypt garbage - wrong integer key. Unlike a substitution where a close key is half-right, Trifid with a wrong key is fully wrong.
    • Unexpected characters - the Trifid alphabet is usually 27 characters (letters + filler, commonly + or .). If your message has characters outside the alphabet, the cipher behaves oddly; keep messages in plain alphabet letters.
    • Cross-check odd results with an external Trifid tool (the README's own "related projects" - dCode.fr, Cryptii - have the standard implementation) since the pack's tests only claim to cover common cases.
    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.
    keyINT13Accepts any non-negative integer as the key to decrypt/encrypt.

    Outputs (1)

    NameTypeDescription
    encrypted_txtSTRING