Nodes/ComfyUI ARG Toolkit/Three Square Cipher
ComfyUI Node

Three Square Cipher

Delastelle's oddball, three keys and a pair of blanks

By AzelusLightvale·Created 12 months ago·Updated about 10 hours ago· 1
Three Square Cipher
    • encrypted_txt
    textHello World!
    alphabetENGLISH
    modetrue
    keep_formattingtrue
    key_1
    key_2
    key_3

    The Three-Square cipher is the neglected middle child of Félix Delastelle's square-family - everyone knows the Two-Square (Double Playfair) and the Four-Square, but Three-Square is the one that encrypts digraphs using three 5×5 squares instead of two, and it never quite caught on the way its siblings did. That obscurity is precisely what makes it interesting for an ARG: it's the "nobody's heard of this one" cipher that reads as genuinely exotic, even though it's a 120-year-old paper-and-pencil scheme.

    It's also a rarity in the tooling world - most online cipher suites don't even include it, which is why having it inside ComfyUI is a small flex. The pack gets it from secretpy, the only mainstream Python library that carries the full Delastelle family.

    How it works

    Inputs:

    • text - the message.
    • key_1, key_2, key_3 - three keyword strings, one per square. Three secrets, three stages to any solve.
    • mode - encrypt/decrypt toggle.
    • keep_formatting - on preserves formatting, off strips to lowercase letters.
    • alphabet - default ENGLISH.

    Output: encrypted_txt (STRING).

    The mechanism is the Playfair family's: plaintext is split into letter pairs, filler x inserted where needed, and each pair is transformed by looking up positions across the three keyed squares. Because three squares are involved, the mapping is noticeably less regular than Two-Square, which is the point - harder to crack, but also easier to trip over in practice.

    The inputs that matter

    text plus all three keys. Every key is a secret, and every key must be non-empty. If you're designing a puzzle, the three-key structure writes the narrative for you: three keys, three clues, one message. For solving, keep_formatting on keeps spaces intact for frequency work; off gives the classic solid 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

    • Empty keys - all three need real keywords; an empty one collapses the square and mangles the output.
    • Filler x - stray x characters in decrypt output are normal Playfair-family behavior, not corruption.
    • External verification is hard - because Three-Square is rare in other tools, if your result looks off, sanity-check with secretpy directly in Python or a dCode.fr page rather than assuming the node is wrong; the pack's testing claims only cover common cases.
    CategoryARG Toolkit/Cryptography/Classical

    Inputs (7)

    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.
    key_1STRINGAccepts any text (or alphabet) in the alphabet's language as the first key to decrypt/encrypt.
    key_2STRINGAccepts any text (or alphabet) in the alphabet's language as the first key to decrypt/encrypt.
    key_3STRINGAccepts any text (or alphabet) in the alphabet's language as the first key to decrypt/encrypt.

    Outputs (1)

    NameTypeDescription
    encrypted_txtSTRING