Nodes/ComfyUI EncryptMaster/EncryptMaster — Stego Extract Text (AES-GCM)
ComfyUI Node

EncryptMaster — Stego Extract Text (AES-GCM)

Pulling the hidden message back out of a PNG

By orion4d·Created 12 months ago·Updated 12 months ago· 5
EncryptMaster — Stego Extract Text (AES-GCM)
  • image
  • text
passphrase
associated_data

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:

  1. 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.
  2. Pulls out the full header plus ciphertext.
  3. 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 header means 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_data surfaces 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.

CategoryEncryptMaster

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
passphraseSTRING
associated_dataoptSTRING

Outputs (1)

NameTypeDescription
textSTRING