EncryptMaster — Stego Extract Text (AES-GCM)
Pulling the hidden message back out of a PNG
- image
- text
This is the read half of the EncryptMaster stego pair. Where Stego Embed Text hides an encrypted message in an image's least-significant bits, Stego Extract Text digs it back out: feed it the carrier image and your passphrase, and it returns the original message in plaintext. No carrier image, no passphrase, no message.
It's a small node with a simple job, but it's the one that makes the whole "hide text in an image" workflow feel like a superpower - anyone can see the carrier image, and only you can pull the secret out of it.
How it works
Stego Embed Text wrote a 40-byte header (magic bytes EMSTEG1, bit depth, salt, nonce, payload length) followed by AES-GCM ciphertext into the lowest bits of the RGB channels. Extract Text reverses that:
- Reads the first bits of the image to find the header - and it's smart about bit depth, trying 1 bit per channel first, then 2, so you don't need to remember which setting the embedder used.
- Pulls out the full header plus ciphertext.
- Re-derives the key from your passphrase with scrypt, then decrypts and authenticates with GCM.
Because GCM authenticates the data, a wrong passphrase, mismatched associated_data, or a tampered image fails cleanly instead of spitting out garbage.
Inputs and outputs that matter
Only three inputs:
image(IMAGE) - the carrier PNG/TIFF with the message inside.passphrase(STRING, masked) - must match exactly what was used at embed time.associated_data(STRING, optional) - the authenticated tag from the embed. If you set one then, set the same one now, or decryption fails.
Output is a single text STRING. One thing to know: errors come back as [Stego ERROR] ... strings, not exceptions. A failed extraction reads like a message - check what it actually says before assuming the payload was empty.
Installing it
Part of the ComfyUI EncryptMaster pack - install the pack once, get all nine nodes. Try ComfyUI Manager (search "ComfyUI EncryptMaster"), or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Comfyui_EncryptMaster
Then install the real dependencies (the repo ships no requirements.txt; this is what actually installs):
pip install cryptography pillow numpy
Restart ComfyUI, and it's under "EncryptMaster". No models, no GPU.
Where people get burned
- You embedded with 2 bpc but the image looks "off." Doesn't matter - the header stores the bit depth and the extractor auto-detects it. This is the one part of the stego pair you can stop worrying about.
[Stego ERROR] Invalid magic headermeans the image never contained an EncryptMaster payload, or it's been re-encoded. A JPEG re-save or a social platform's recompression wipes the LSBs and the magic is gone. If you got this error, the message is unrecoverable - no passphrase will save you.- Wrong passphrase or
associated_datasurfaces as an authentication failure from the GCM decrypt. That's the crypto doing its job, not a bug.
The workflow to remember: Stego Embed Text → save PNG → (later) load that exact PNG → Stego Extract Text → read your message. If you used the pack's own Text Cipher before embedding - the README's recommended pipeline - the extracted output will be an armored aesgcm-scrypt.v1$... string, and you'll run Text Cipher in decrypt mode to get the final plaintext.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| passphrase | STRING | — | |
| associated_dataopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |