Visual Encryptor



Download the Visual Encryptor program here: VisualEncryptor.exe

If you want to you may use these bitmaps to play around with in the program:

right-click on any image and select "Save Picture As..." to download

Source Code:

Visual Encryptor allows a user to create the shares for a visual cryptography scheme on any of the following access structures (with at most 9 participants): (2,2)-threshold VCS, (2,n)-threshold VCS, (n,n)-threshold VCS, (k,n)-threshold VCS, or a general access structure (defined by the minimal qualified sets of participants). Each of the algorithms used in implementing these schemes was derived from the articles on Visual Cryptography by Doug Stinson, posted on his website at http://www.cacr.math.uwaterloo.ca/~dstinson/visual.html. The secret image the user encrypts must be stored as a bitmap file. Here is a concise explanation of how to use Visual Encryptor:

How to Encrypt an Image Using Visual Encryptor

  1. Open the secret image .bmp file using either the "Open SI..." command under the "File" menu or using the Open button in the toolbar.
    This adds the selected file to the third combo box in the toolbar, which lists the files that have been opened or created
  2. Select the desired Visual Cryptography scheme from the first combo box in the toolbar. You will be prompted for any information necessary to define the access structure (such as the number of participants, the threshold, or qualified sets of participants). Details on each of the schemes are given below.
  3. Select the desired pixel expansion method from the second combo box in the toolbar. Detailed information about each pixel expansion method is given below.
  4. Encrypt the secret image (the image currently displayed will encrypted) either by selecting "Encrypt" from the "Encrypt" menu or by pressing the Encrypt button on the toolbar.
    The created shares are stored in the files "sharek.bmp" where k is the number of the participant corresponding to the share. The name of each share is then added to the third combo box. You can choose which file to display in the main window by selecting that file from the third combo box (though, only one file may be displayed at a time).
  5. You can 'overlay' any set of up to 9 images either by selecting the "Coalesce..." command from the "Coalesce shares..." menu or by pressing the Coalesce button on the toolbar.
    The overlaid image will be saved as "coalesce.bmp", added to the third combo box (of viewable files), and displayed as the current image in the main window.

Additional Points




Access Structure Schemes The following is a brief description of the access structures the user may choose from the first combo box in the toolbar when creating a VCS:
  1. (2,2)-threshold VCS:
    This is a simple threshold scheme that takes a secret image and encrypts it into two shares that reveal the secret image when they are overlaid. No additional information is required to create this kind of access structure.

  2. (2,n)-threshold VCS
    This scheme encrypts the secret image into n shares such that when any two (or more) of the shares are overlaid the secret image is revealed. The user will be prompted for n, the number of participants.

  3. (n,n)-threshold VCS
    This scheme encrypts the secret image into n shares such that only when all n of the shares are combined will the secret image be revealed. The user will be prompted for n, the number of participants.

  4. (k,n)-threshold VCS
    This scheme encrypts the secret image into n shares such that when any group of at least k shares are overlaid the secret image will be revealed. The user will be prompted for k, the threshold, and n, the number of participants.

  5. General Access Structure
    This scheme encypts the secret image into n shares such that the secret image is only revealed when a group of shares that is a superset to a minimal qualified set of participants are combined. A qualified set of participants is any group that reconstruct the secret image by overlaying their shares. A forbidden set of participants is any group that cannot reconstruct the secret image by overlaying their shares. Every set of participants is either a qualified set or a forbidden set. A minimal qualified set of participants is any set of participants that is qualified but has no qualified proper subset (i.e. if any participant is removed from the set, it becomes a forbidden set). For this scheme, the user will first be prompted for n, the number of participants, and will then be asked to select all of the minimal qualified sets of participants for the desired scheme from a list box.
Pixel Expansion Methods The following briefly describes each of the pixel expansion methods the user may select from the second combo box in the toolbar for creating a VCS. The names I selected are perhaps not ideally descriptive, but hopefully the explanations of each scheme will help to overcome this:
  1. Random basis column
    This method produces shares with dimensions identical to the secret image. This is how it works: for each pixel in the secret image it randomly selects one column from the appropriate basis matrix and encodes the pixel onto share i according to value of row i in the column it randomly selected. By eliminating the other columns not all data is retained and the secret image will not be as sharp when it is reconstructed. However, as long as the image is not too small and the scheme is not to complex, the secret image should still be easy to see when qualified sets of shares are combined.

  2. Pixel sampling
    This method produces shares with dimensions that are nearly identical to the secret image, though usually a little bit different. It works by making the subpixel expansion a square and selecting one pixel from each square of equal size to the subpixel expansion on the secret image and encoding just that pixel (and none others in the square) so that its subpixel expansion takes up the space of the square where that one pixel was selected from. I know this is not a clear description. It's easier for me to picture in my mind than to explain it in words. Anyways, the result is similar to that of the first scheme: there is a loss of detail when the secret image is reconstructed but as long as the picture is not too small and the scheme is not too complex this distribution method is still effective.

  3. Square subpixel expansion
    This method produces shares with the same height/width ratio as the secret image by copying the subpixel expansion, m, over m times for each SI pixel on each share, making the net subpixel expansion (essentially) a square. This scheme preserves the detail of the secret image when it is reconstructed, though there is always a loss of constrast. The only hitch is that the shares can get very large for complex VCS's.

  4. Smallest square expansion w/ filler
    This method turns the subpixel expansion into a square like method 3 did only instead of making it into a square of m2 subpixels, it makes it into a square of s subpixels, where s is the smallest perfect square greater than or equal to m. It fills in the extra s - m subpixels with random black or white subpixels. This scheme also preservces the detail of the secret image when it is reconstructed, but it has a worse loss of contrast than methods 3 and 5. However, the shares are usually smaller than the shares created by methods 3 and 5.

  5. Smallest square expansion w/o filler
    This is the distribution method that I prefer. It works similar to method 4 only the square of subpixels is of size q, where q is the smallest perfect square greater than or equal to m that is a multiple of m. Thus, it never has to fill in extra subpixels and there is no additional loss of contrast to the scheme. The shares it creates will be no larger than the ones method 3 creates but no smaller than the ones method 4 creates.

  6. Extended VCS: preserve size...
    This method creates an Extended VCS, which is a VCS where the shares have innocent images visible on them, but these images disappear when qualified sets are combined to reveal the secret image. When the user selects this method, they are prompted to select the bitmap file of the "innocent" image they want to appear on each share. They must select a bitmap for each share that will be created. Also, the dimensions of each "innocent" image they select must be identical to the dimensions of the secret image. Once the "innocent" images have been selected, this method creates the shares in the same manner as method 1.

  7. Extended VCS: preserve detail...
    This method creates an Extended VCS like method 6 does except the method they use to create the shares is different. When the user selects this method, they are prompted to select the bitmap file of the "innocent" image they want to appear on each share. They must select a bitmap for each share that will be created. Also, the dimensions of each "innocent" image they select must be identical to the dimensions of the secret image. Once the "innocent" images have been selected, this method creates the shares in the same manner as method 5.