Class PaillierSignature

java.lang.Object
edu.fiu.adwise.homomorphic_encryption.paillier.PaillierSignature

public class PaillierSignature extends Object
This class provides methods for signing and verifying messages using the Paillier cryptosystem. The Paillier cryptosystem is a probabilistic asymmetric algorithm for public key cryptography. It supports homomorphic encryption and is based on composite degree residuosity classes.
  • Constructor Details

    • PaillierSignature

      public PaillierSignature()
  • Method Details

    • sign

      public static List<BigInteger> sign(BigInteger message, PaillierPrivateKey private_key)
      Signs a message using the provided Paillier private key. The signature consists of two components: sigma\_one and sigma\_two. Please refer to "Public-Key Cryptosystems Based on Composite Degree Residuosity Classes"
      Parameters:
      message - The message to be signed, represented as a BigInteger.
      private_key - The PaillierPrivateKey used to sign the message.
      Returns:
      A List of BigInteger containing the two components of the signature. The first element is sigma\_one, and the second element is sigma\_two.
    • verify

      public static boolean verify(BigInteger message, List<BigInteger> signed_message, PaillierPublicKey public_key)
      Verifies a signed message using the provided Paillier public key. This method checks the validity of the signature by comparing the computed values with the original message.
      Parameters:
      message - The original plaintext message, represented as a BigInteger.
      signed_message - A List of BigInteger containing the signature components. The first element is sigma\_one, and the second element is sigma\_two.
      public_key - The PaillierPublicKey used to verify the signature.
      Returns:
      true if the signature is valid, false otherwise.
      Throws:
      AssertionError - If the signed\_message does not contain exactly two components.
    • verify

      public static boolean verify(BigInteger message, BigInteger sigma_one, BigInteger sigma_two, PaillierPublicKey public_key)
      Verifies a Paillier signature using its individual components. This method computes the expected values of the signature components and compares them with the provided message.
      Parameters:
      message - The original plaintext message, represented as a BigInteger.
      sigma_one - The first component of the signature.
      sigma_two - The second component of the signature.
      public_key - The PaillierPublicKey used to verify the signature.
      Returns:
      true if the signature is valid, false otherwise.