Decrypt XOR Text
Your Password-Coded Secret Text, Decrypted Back Into a Real Object
- decrypted_object
This node exists to close a loop with a button you've probably never noticed. The same pack that ships DecryptXORText also injects a little "Text Crypter" lock icon into your ComfyUI menu bar. You type text and a password into that modal, it hands you a long hex string, and this node is the other end: paste the hex in, supply the password, and out comes the actual Python object.
Honest take: this is the least useful of the three nodes in the pack, and the most fun to play with. It doesn't call any API, needs no key, no models, nothing - pure standard-library Python. If you just want to smuggle a {"seed": 42, "prompt": "..."} dict into a workflow without it sitting in plaintext on someone's monitor, this is your toy.
How it works
The crypto is simple enough to read in one sitting. The password is hashed once with SHA-256, then that hash is repeated over and over until it's as long as your data. Each byte of the ciphertext gets XOR'd with the matching key byte. Because XOR is symmetric, the exact same function both encrypts and decrypts - that's why the JS modal in your browser and this Python node interoperate without any shared secret beyond the password.
The decrypt path in the node is:
bytes.fromhex(encrypted_text)- turn the hex you pasted into raw bytes.- XOR with the derived key - undo the encryption.
- Decode the bytes as UTF-8.
json.loads- parse what's left into a Python object.
So whatever you typed into the modal comes back as a real value. Type a JSON object and you get a dict wired out of decrypted_object; type plain text and you get a string.
One warning before you build anything on it: this is obfuscation, not encryption. A single SHA-256 pass with no salt means a short password dies to a dictionary attack in minutes, and XOR streams are trivially weak against known plaintext. Fine for keeping a prompt from prying eyes at a glance. Not fine for anything you'd actually call secret.
Inputs and outputs
Only two inputs, both required:
encrypted_text- the hex string from the Text Crypter modal. It's a multiline field, so pasting a wrapped string is fine.password- must match the one you used to encrypt, character for character.
The single output is decrypted_object (ANY), so it wires into anything that takes a generic object - a text display node, or any downstream node that accepts *.
Installation
Grab the whole pack; the modal comes with it.
cd ComfyUI/custom_nodes
git clone https://github.com/iacoposk8/xor_pickle_nodes
Restart ComfyUI. ComfyUI Manager users can just search for "xor_pickle_nodes" or "XOR Text & Pickle" and install from there. There are no dependencies beyond the Python standard library - no requirements.txt, no model downloads, which is genuinely rare for a custom node pack.
Common issues
- Wrong password - the decrypted bytes won't parse as UTF-8 JSON, and the node raises "Errore durante la decifratura". You can't miss it. Re-check the password, it's exact.
- Pasting the hex with line breaks - harmless,
fromhexignores whitespace. - The modal button missing - the pack's JS catches old ComfyUI versions and quietly disables the new-style menu button. You can still hand-encrypt with the same algorithm yourself; the node doesn't care where the hex came from.
It's a small utility, and it knows it is one. Use it to test the pack's encryption before you trust the pickle nodes with anything you actually care about.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| encrypted_text | STRING | — | |
| password | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| decrypted_object | * | — |