Using Blending to learn the concepts of Visual Encryption
This project implements a real-time visual cryptography system in TouchDesigner using GLSL. It encrypts a black-and-white image into two visually noisy shares:
- Share A (OTP): A one-time pad composed of random 2×2 pixel patterns
- Share B (Cipher): The encrypted output that uses the same or inverted pattern depending on the input image's pixel value
When perfectly overlaid, the two shares reveal the original image. Any misalignment results in pure noise, preserving the secrecy of the original content.
- Pixel-perfect 2×2 block encryption
- Supports white-on-black input images
- Noise-based randomization via
iTimeuniform - Dynamic regeneration of the OTP and Cipher every second
- Clean reveal using standard
Minimumblend mode in TouchDesigner
- Input a black-and-white image (mono, 8-bit fixed, no anti-aliasing).
- Feed it into the provided GLSL TOP.
- The output is a side-by-side image:
- Left half: OTP
- Right half: Cipher
- Use
Crop TOPto split the image into two shares. - Overlay the two using
Composite TOP → Operation: Minimum. - Align perfectly to reveal the hidden image.
iTime(float): Drives time-based pattern changes (e.g., updates every second).- Optional: Use a slider to manually shift shares — message only appears at exact alignment.
- TouchDesigner 2022.20000 or newer
- GLSL TOP (2D texture input)
8-bit fixed (Mono)pixel format recommended
MIT License — use freely with attribution.