Class ElGamalSignature

java.lang.Object
edu.fiu.adwise.homomorphic_encryption.elgamal.ElGamalSignature
All Implemented Interfaces:
CipherConstants

public class ElGamalSignature extends Object implements CipherConstants
This class provides methods for signing and verifying messages using the ElGamal signature scheme.

The ElGamal signature scheme is a cryptographic algorithm used for digital signatures. For more details, see ElGamal Signature Scheme.

  • Constructor Details

    • ElGamalSignature

      public ElGamalSignature()
  • Method Details

    • sign

      public static ElGamal_Ciphertext sign(BigInteger message, ElGamalPrivateKey private_key)
      Signs a message using the ElGamal private key.

      This method generates a digital signature for the given message using the private key.

      Parameters:
      message - The plaintext message to be signed.
      private_key - The ElGamal private key used for signing.
      Returns:
      An ElGamal_Ciphertext object containing the signature (r, s).
    • verify

      public static boolean verify(BigInteger message, ElGamal_Ciphertext signature, ElGamalPublicKey public_key)
      Verifies a signed message using the ElGamal public key.

      This method checks the integrity and authenticity of the signed message.

      Parameters:
      message - The plaintext message to verify.
      signature - The signed message to verify, represented as an ElGamal_Ciphertext.
      public_key - The ElGamal public key used for verification.
      Returns:
      true if the signature is valid, false otherwise.