Extensions/ComfyUI-Image-Encryption
ComfyUI Extension

ComfyUI-Image-Encryption

Two ComfyUI custom nodes providing image encryption and decryption with password-derived SHA-256 keying, block permutation, and pixel diffusion.

By Zhuozhuo-219·Created 2 months ago·Updated 2 months ago· 1
Zhuozhuo-219/ComfyUI-Image-Encryption
Nodes
On cloudLocal install
Stars1
Updated2 months ago
Readme

ComfyUI-Image-Encryption

Two ComfyUI custom nodes are provided:

  • ImageEncrypt/Image Encryption
  • ImageEncrypt/Image Decryption

The encryption pipeline follows the design in .personal-worklog/node design.md:

  • password-derived SHA-256 keying
  • block permutation with Hilbert, Morton, or Random
  • inner-block permutation
  • pixel diffusion with XOR, Chaotic XOR, or AES-CTR
  • chained diffusion for reversibility

The encryption node outputs:

  • encrypted IMAGE
  • encryption metadata as JSON
  • security_report as JSON

The security report contains:

  • entropy
  • horizontal_corr
  • vertical_corr
  • diagonal_corr
  • npcr
  • uaci

For batched inputs, the metadata and security_report JSON outputs become per-image lists.

Metric conventions:

  • entropy is computed over all encrypted RGB byte values as one scalar.
  • correlation metrics are computed on the encrypted grayscale image.
  • npcr and uaci are computed between the padded plaintext image and the encrypted image so the compared arrays have identical shape.

In the same workflow, the encryption node also attaches metadata to the image tensor and to extra_pnginfo, so a downstream standard SaveImage node will persist the parameters into the PNG metadata.

When decrypting an image that was reloaded from disk, connect the saved metadata JSON explicitly if your loader path does not preserve the tensor-attached metadata in memory.