Fernet Key Generator
The One-Button Way to Mint a Fernet Key (And Why It Looks Like Garbage)
- key
A Fernet key is the one piece of the ARG Toolkit's symmetric-encryption story that you are absolutely not allowed to hand-type. It's 32 bytes of raw cryptography, which on a terminal looks like dGhpcyBpcyBhIHNlY3JldCBtZXNzYWdl-adjacent noise, and it has to be exactly right or every encrypt/decrypt round-trip silently fails. FernetKeygenSimple is the pack's answer: zero inputs, one output, click and it hands you a fresh key. That's the whole job, and honestly it's the right way to do it.
This node lives in the "Modern" section of the ARG Toolkit, and it's the natural start of a Fernet workflow. You generate a key here, wire it into the pack's Fernet symmetric-encryption node, encrypt your message, and the token that comes out is something you can paste into a Discord hint or bury in an image's EXIF. The key itself is generated by Python's cryptography library (fernet.Fernet.generate_key()), which is already the crypto engine the rest of the pack leans on - no extra installs, no model files, nothing.
What's on the node
The input panel is empty. That's not a glitch - a key generator has nothing to configure. The single output is:
key(BYTESLIKE) - the fresh 32-byte Fernet key, ready to plug into the pack's Fernet encryption node.
One thing to know before you wire it up: the ARG Toolkit's modern nodes route everything through a BYTESLIKE datatype, not plain strings. So if you want to eyeball the key, save it, or paste it somewhere, run it through the pack's ByteslikeDecode node (Base64 or Hexadecimal output) rather than expecting to read it off the wire.
A quirk worth knowing
The version of the source I checked (2.2.1) returns the generated key in a slightly cursed way - the function hands back key.decode rather than key.decode() - which can make the key's actual bytes not land where the next node expects them. If your Fernet node errors out with something about an invalid key right after you connect this one, that's likely why. The pragmatic workaround is to stop trusting the generator and build your key yourself: run any random-looking string through the pack's ByteslikeEncode node (Base64 is the easiest), and feed that into Fernet. The key is just 32 bytes; the point of this node is convenience, not magic.
Installing it
The ARG Toolkit is one pack, so you get this node by installing the whole thing. In ComfyUI Manager search "ComfyUI ARG Toolkit" and hit Install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Then restart ComfyUI. If you cloned manually, also run pip install -r requirements.txt from inside the folder - Manager does that for you; it pulls in cryptography, secretpy, stegano, and friends. The classic ciphers need secretpy, but the modern ones ride on cryptography, which is usually already in your ComfyUI Python environment.
Troubleshooting
If the key won't accept being plugged into the Fernet node, see the quirk above - that's the number one failure, and the fix is one ByteslikeEncode away. Past that, this node has almost nothing to go wrong: no key length to mistype (it's fixed at 32 bytes), no salt, no passphrase. It's the rare custom node where "it just works" is the realistic outcome, assuming you treat the key as the secret it is and don't paste it into your public workflow JSON.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| key | BYTESLIKE | — |