Visual Cryptography Project in Java

Introduced by Moni Naor and Adi Shamir at EUROCRYPT 1994, Visual cryptography is a cryptographic technique which allows visual information (pictures, text, etc.) to be encrypted in such a way that decryption becomes a mechanical operation that may or may not require a computer. It is used to encrypt written material (printed text, handwritten notes, pictures, etc) in a perfectly secure way. The decoding is done by the human visual system directly, without any computation cost.

Three OR – Visual Cryptography Techniques:

  • Divide image into two parts
  • Separately, they are random noise
  • Combination reveals an image

Some common mechanisms are explained below.

k out of n sharing problem:

For a set P of n participants,  a secret image S is encoded into n shadow images called shares (shadows), where each participant in P receives one share. The original message is visible if any k or more of them are stacked together, but totally invisible if fewer than k transparencies are stacked together.

k out of n example (k=3,n=4):


General k out of k Scheme:

In k out of k, the image is visible only if all the shares are stacked together. If any share in k is lost, and remaining shares are stacked together, it will not form the image. Thus, in k out of k, all the shares are important to constructing the image.

k out of k example (k=n,n=3):


The Model:

  1. Pixels are split


2. n shares per pixel


(Note: You will find more mechanisms in the project report)

Download this project

Future Use and Applications:

  1. Remote Electronic Voting
  2. Anti-Spam Bot Safeguard
  3. Banking Customer Identification
  4. Message Concealment
  5. Key Management


  1. Naor and Shamir, Visual Cryptography, in Advances in Cryptology – Eurocrypt ‘94

2 thoughts on “Visual Cryptography Project in Java

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s