Class bob_elgamal
java.lang.Object
edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.socialist_millionaires
edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.bob
edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.bob_veugen
edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.bob_elgamal
- All Implemented Interfaces:
CipherConstants,bob_interface
Represents Bob's implementation of the multi-party protocols for secure computation with ElGamal cryptography.
This class extends the `bob_veugen` class and provides methods for performing
arithmetic operations and secure comparisons using the ElGamal encryption scheme.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionbob_elgamal(KeyPair a, KeyPair b, KeyPair c) Constructs a `bob_elgamal` instance with three key pairs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddition(boolean addition) Performs addition or subtraction to get the encrypted value of two blinded encrypted valuesvoiddivision(long divisor) Performs division on an encrypted value from alice by a given divisor by Bob.voidPerforms multiplication on blinded encrypted values from alice.booleanSee the papers "Improving the DGK comparison protocol" and Correction to ”Improving the DGK comparison protocol” by Thjis Veugen, You can find these in the papers directory! Sorts a list of encrypted numbers using Protocol 4 (see the Veugen papers).voidsort()See the papers "Improving the DGK comparison protocol" and Correction to ”Improving the DGK comparison protocol” by Thjis Veugen, You can find these in the papers directory! Sorts a list of encrypted numbers using Protocol 4 (see the Veugen papers).Methods inherited from class edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.bob
compute_delta_b, encrypt_bits, encrypted_equals, Protocol1, sendPublicKeys, set_socketMethods inherited from class edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.socialist_millionaires
get_bytes_sent, getDGKPublicKey, getElGamalPublicKey, getPaillierPublicKey, isDGK, readBoolean, readInt, readObject, setDGKMode, setDGKPublicKey, setElGamalPublicKey, setPaillierPublicKey, writeBoolean, writeInt, writeObject
-
Constructor Details
-
bob_elgamal
Constructs a `bob_elgamal` instance with three key pairs.- Parameters:
a- the first key pair (ElGamal or other encryption scheme).b- the second key pair (ElGamal or other encryption scheme).c- the third key pair (optional, e.g., ElGamal).- Throws:
IllegalArgumentException- if the provided key pairs are invalid or mismatched.
-
-
Method Details
-
addition
public void addition(boolean addition) throws IOException, ClassNotFoundException, IllegalArgumentException, HomomorphicException Performs addition or subtraction to get the encrypted value of two blinded encrypted values- Parameters:
addition-truefor addition,falsefor subtraction.- Throws:
IOException- if an I/O error occurs during communication.ClassNotFoundException- if a class cannot be found during deserialization.IllegalArgumentException- if invalid arguments are provided.HomomorphicException- if the ElGamal keys already support addition natively.
-
multiplication
public void multiplication() throws IOException, ClassNotFoundException, IllegalArgumentException, HomomorphicExceptionPerforms multiplication on blinded encrypted values from alice.- Specified by:
multiplicationin interfacebob_interface- Overrides:
multiplicationin classbob- Throws:
IOException- if an I/O error occurs during communication.ClassNotFoundException- if a class cannot be found during deserialization.IllegalArgumentException- if invalid arguments are provided.HomomorphicException- if the ElGamal keys do not support additive operations.
-
division
public void division(long divisor) throws ClassNotFoundException, IOException, IllegalArgumentException, HomomorphicException Performs division on an encrypted value from alice by a given divisor by Bob.- Specified by:
divisionin interfacebob_interface- Overrides:
divisionin classbob- Parameters:
divisor- the divisor to divide the encrypted value by.- Throws:
ClassNotFoundException- if a class cannot be found during deserialization.IOException- if an I/O error occurs during communication.IllegalArgumentException- if invalid arguments are provided.HomomorphicException- if the ElGamal keys do not support additive operations.
-
sort
public void sort() throws IOException, ClassNotFoundException, IllegalArgumentException, HomomorphicExceptionSee the papers "Improving the DGK comparison protocol" and Correction to ”Improving the DGK comparison protocol” by Thjis Veugen, You can find these in the papers directory! Sorts a list of encrypted numbers using Protocol 4 (see the Veugen papers). This method is used when Alice wants to sort encrypted numbers securely.- Specified by:
sortin interfacebob_interface- Overrides:
sortin classbob- Throws:
IOException- if an I/O error occurs during communication.ClassNotFoundException- if a class cannot be found during deserialization.IllegalArgumentException- if invalid arguments are provided.HomomorphicException- if an error occurs during the sorting process.
-
Protocol2
public boolean Protocol2() throws IOException, ClassNotFoundException, IllegalArgumentException, HomomorphicExceptionSee the papers "Improving the DGK comparison protocol" and Correction to ”Improving the DGK comparison protocol” by Thjis Veugen, You can find these in the papers directory! Sorts a list of encrypted numbers using Protocol 4 (see the Veugen papers). This method is used when Alice wants to sort encrypted numbers securely.- Specified by:
Protocol2in interfacebob_interface- Overrides:
Protocol2in classbob_veugen- Returns:
trueif the comparison result indicatesx >= y,falseotherwise.- Throws:
IOException- if an I/O error occurs during communication.ClassNotFoundException- if a class cannot be found during deserialization.IllegalArgumentException- if invalid arguments are provided.HomomorphicException- if the ElGamal keys do not support additive operations.
-