Class EVCS

java.lang.Object
  extended byEVCS

public class EVCS
extends java.lang.Object

Implements a 2 out of 2 threshold Extended Visual Cryptography Scheme


Constructor Summary
EVCS(java.lang.String si, java.lang.String im1, java.lang.String im2)
          Constructor method throws a NotComplianSizeException if the input images don't have the same size.
 
Method Summary
 int color2index(java.awt.Color c, java.awt.Color c1, java.awt.Color c2)
          Let 3 colors generate the index for matrix by this law: let 1=black, 0=white index = c1*4+c2*2+c*1 that is as a binary number.
 void encode(int i, int j, java.awt.Color c, java.awt.Color c1, java.awt.Color c2)
          Generate the share pixels and save them in the appropriated images
 int[] getPermutation()
          Evalueate a vector of length m with a random permutation of {1...m}.
 java.awt.image.BufferedImage[] getShares()
           
 void populateBasisMatrices()
          Load basis matrices for the 2 out of 2 threshold EVCS The collection C(c,c1,c2) are obtained by permutating the columns of the respective matrix S(c,c1,c2).
 void process()
          Encode every pixel of innocent images to generate the share images.
 void save(java.io.File f1, java.io.File f2)
          Write the share images into the file f1, f2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EVCS

public EVCS(java.lang.String si,
            java.lang.String im1,
            java.lang.String im2)
     throws NotCompliantSizeException
Constructor method throws a NotComplianSizeException if the input images don't have the same size.

Parameters:
si - the secret image file name
im1 - user 1's innocent image
im2 - user 2's innocent image
Method Detail

process

public void process()
Encode every pixel of innocent images to generate the share images. Property: after the original innocent looking images are encoded, they are still meaningful.


encode

public void encode(int i,
                   int j,
                   java.awt.Color c,
                   java.awt.Color c1,
                   java.awt.Color c2)
Generate the share pixels and save them in the appropriated images

Parameters:
i - y-coordinate
j - x-coordinate
c - pixel color in the secret image
c1 - pixel color in the first image
c2 - pixel color in the second image

getPermutation

public int[] getPermutation()
Evalueate a vector of length m with a random permutation of {1...m}. Let it be {i1, i2, ... , im}

Returns:
the m-vector with the permutation

color2index

public int color2index(java.awt.Color c,
                       java.awt.Color c1,
                       java.awt.Color c2)
Let 3 colors generate the index for matrix by this law: let 1=black, 0=white index = c1*4+c2*2+c*1 that is as a binary number.

Returns:
the index

populateBasisMatrices

public void populateBasisMatrices()
Load basis matrices for the 2 out of 2 threshold EVCS The collection C(c,c1,c2) are obtained by permutating the columns of the respective matrix S(c,c1,c2).


save

public void save(java.io.File f1,
                 java.io.File f2)
Write the share images into the file f1, f2

Parameters:
f1 - file in wich save the 1st share image
f2 - file in wich save the 2nd share image

getShares

public java.awt.image.BufferedImage[] getShares()
Returns:
an array with the share images