8 Visual cryptography
The visual cryptography is suitable for encryption and distribution of secret information that is available as a black and white pixel image. It splits the information into several transparent foils, that have to be overlayed to retrive the information. Different versions with k out of n foils are possible, which means the k of the n foils are needed to regain the information.
Therefore every single pixel ist split into subpixels, lying so close together, that the human eye can only see them as one pixel. The information is stored in a m x n Matrix S=[sij], where sij=1 means, that subpixel j in foil i is black, otherwise is sij=0. The overlay of the foils corresponds with a OR combination of the m vectors of the matrix.
The subpixel matrix for one black or white pixel is randomly select during encryption form a set of possible matrices C0 for white pixels and C1 for black pixels. The sets C0 and C1 contain all matrices build by permutation of the columns of one start matrix for black resp. white pixels. The start matrix depends on the the number of foils needed to regain the information (k) and the number of foils at all (n). The matrix for the white pixels has to be choosen in a way, that any OR combination results in a gray value, that the human eye can easily distinguish from black. The matrix for black pixels must meet two conditions. At first any combination of k or more foils must result in black and second every combination of less then k foils has to result in a gray value, that does not differ from that of the white pixels. This means that any combination of less than k foils, does not reveal any information.
The following example implements a 2 out of 2 method.
|
The 2 out of 2 method uses: |
The following matrices would be suitable for this method:
C0 = all column permutaions of
C1 = all column permutaions of
But this means only two subpixels per pixel, which would result in a
distorted image. To compensate that, the following matrices with 4 subpixels
are used:
C0 = all column permutaions of
C1 = all column permutaions of
Applet visual cryptography
You can move the right immage over the left one with the mouse.
Source code:
vc.java