Class DGKKeyPairGenerator
java.lang.Object
java.security.KeyPairGeneratorSpi
edu.fiu.adwise.homomorphic_encryption.dgk.DGKKeyPairGenerator
- All Implemented Interfaces:
CipherConstants
This class is responsible for generating DGK key pairs (public and private keys)
used in the DGK cryptosystem. It extends the
KeyPairGeneratorSpi class
and implements the CipherConstants interface.-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for DGKKeyPairGenerator.DGKKeyPairGenerator(int l, int t, int k) Initialize DGK Key pair generator and sets DGK parameters -
Method Summary
Modifier and TypeMethodDescriptionGenerates a DGK key pair.intgetK()Gets the key size in bits.intgetL()Gets the size of plaintext.intgetT()Gets the security parameter.voidinitialize(int k, SecureRandom random) Initializes the DGK key pair generator with the specified key size and random generator.static voidMain method to generate and save DGK key pairs.voidsetK(int k) Sets the key size in bits.voidsetL(int l) Sets the size of plaintext.voidsetT(int t) Sets the security parameter.toString()Returns a string representation of the DGKKeyPairGenerator.Methods inherited from class java.security.KeyPairGeneratorSpi
initialize
-
Constructor Details
-
DGKKeyPairGenerator
public DGKKeyPairGenerator()Default constructor for DGKKeyPairGenerator. Initializes the generator with default parameters. -
DGKKeyPairGenerator
Initialize DGK Key pair generator and sets DGK parameters- Parameters:
l- - sets size of plaintextt- - security parameterk- - number of bits of keys- Throws:
HomomorphicException- If invalid parameters are provided
-
-
Method Details
-
main
Main method to generate and save DGK key pairs.- Parameters:
args- Command-line arguments- Throws:
IOException- If an error occurs while writing keys to files
-
getL
public int getL()Gets the size of plaintext.- Returns:
- The size of plaintext
-
setL
Sets the size of plaintext.- Parameters:
l- The size of plaintext- Throws:
HomomorphicException- If invalid parameters are provided
-
getT
public int getT()Gets the security parameter.- Returns:
- The security parameter
-
setT
Sets the security parameter.- Parameters:
t- The security parameter- Throws:
HomomorphicException- If invalid parameters are provided
-
getK
public int getK()Gets the key size in bits.- Returns:
- The key size in bits
-
setK
Sets the key size in bits.- Parameters:
k- The key size in bits- Throws:
HomomorphicException- If invalid parameters are provided
-
initialize
Initializes the DGK key pair generator with the specified key size and random generator.- Specified by:
initializein classKeyPairGeneratorSpi- Parameters:
k- The key size in bitsrandom- The random generator
-
generateKeyPair
Generates a DGK key pair.- Specified by:
generateKeyPairin classKeyPairGeneratorSpi- Returns:
- The generated DGK key pair
-
toString
Returns a string representation of the DGKKeyPairGenerator.
-