votingSystem
Class Encryption
java.lang.Object
votingSystem.Encryption
- public class Encryption
- extends java.lang.Object
This class handles the encryption process in the generalized Paillier
cryptosystem used in the voting system. This class is not used in the Voting system, as the Voter class contains
and optimized variant of the encryption algorithm.
- Author:
- Bent K. Onshus
Constructor Summary |
Encryption(int k,
int noOfVoters,
int s,
java.math.BigInteger n,
java.math.BigInteger g)
Constructs the Encryption object |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Encryption
public Encryption(int k,
int noOfVoters,
int s,
java.math.BigInteger n,
java.math.BigInteger g)
- Constructs the Encryption object
- Parameters:
k
- Security parameter (bitlength)noOfVoters
- Number of voterss
- The s in n^sn
- p*qg
- A generator of the group n^s
testEncryption
public void testEncryption()
preCompGenPailler
public java.math.BigInteger[] preCompGenPailler()
encryptGenPailler
public java.math.BigInteger encryptGenPailler(java.math.BigInteger r,
java.math.BigInteger i_,
int s)
- Encrypts a vote i_ with random number r
- Parameters:
r
- Random numberi_
- The votes
- The s in n^s
- Returns:
- the ciphertext
encryptGenPaillerSimple
public java.math.BigInteger encryptGenPaillerSimple(java.math.BigInteger r,
java.math.BigInteger i_,
int s)
encryptSmall
public java.math.BigInteger encryptSmall(java.math.BigInteger[] a,
java.math.BigInteger r)