cryptix.provider.elgamal
public final class ElGamalAlgorithm extends Object
References:
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
Since: Cryptix 2.2.2
Method Summary | |
---|---|
static BigInteger | decrypt(BigInteger a, BigInteger b, BigInteger p, BigInteger g, BigInteger x)
The decryption algorithm for ElGamal. |
static void | encrypt(BigInteger M, BigInteger[] ab, BigInteger p, BigInteger g, BigInteger y, Random rng)
The encryption algorithm for ElGamal. |
static void | sign(BigInteger M, BigInteger[] ab, BigInteger p, BigInteger g, BigInteger x, Random rng)
The signature algorithm for ElGamal. |
static boolean | verify(BigInteger M, BigInteger a, BigInteger b, BigInteger p, BigInteger g, BigInteger y)
The verification algorithm for ElGamal. |
Parameters: a the first part of the ciphertext. b the second part of the ciphertext. p the prime from the private key. g the generator from the private key. x the value of x from the private key.
Returns: the plaintext.
ab[0]
and
ab[1]
respectively.
Parameters: M the plaintext. ab a 2-element BigInteger array in which to store the ciphertext. p the prime from the public key. g the generator from the public key. y the value of y from the public key. rng a random number generator to be used for encryption.
ab[0]
and ab[1]
respectively.
Parameters: M the value to be signed. ab an array in which to store the result. p the prime from the private key. g the generator from the private key. x the value of x from the private key. rng a random number generator to be used for signing.
Returns: true iff the signature is valid.
Parameters: M the value that was signed. a the first part of the signature. b the second part of the signature. p the prime from the public key. g the generator from the public key. y the value of y from the public key.
Returns: true iff the signature is valid.