#include <ElGamal.h>
Inheritance diagram for CODEX_Ciphers::ElGamalPublicKey:


Public Member Functions | |
| ElGamalPublicKey () | |
| Default constructor, for creating an object to be unmarshalled. | |
| ElGamalPublicKey (BIGNUM *p, BIGNUM *g, BIGNUM *y) | |
| Constructor taking components of the key as BIGNUM%s. | |
| ElGamalPublicKey (const CODEX_ASN1::BigNumber &p, const CODEX_ASN1::BigNumber &g, const CODEX_ASN1::BigNumber &y) | |
| Constructor taking components of the key as BigNumber%s. | |
| ElGamalPublicKey (const ElGamalPublicKey &aKey) | |
| Copy constructor. | |
| virtual | ~ElGamalPublicKey () |
| Destructor. | |
| void | operator= (const ElGamalPublicKey &aKey) |
| Assignment operator. | |
| const CODEX_ASN1::BigNumber & | p () const |
| Prime modulus of the public key. | |
| const CODEX_ASN1::BigNumber & | g () const |
| Generator of the multiplicative subgroup of Z_p. | |
| const CODEX_ASN1::BigNumber & | y () const |
| g^x for private key x | |
| const BIGNUM * | p1 () const |
| const BIGNUM * | q () const |
| ElGamalCipherText * | encrypt (const BIGNUM *message, BIGNUM *k=0) const |
| Encrypt a message. | |
| ElGamalSchnorrCipherText * | encryptS (const BIGNUM *message, const CODEX_ASN1::Base &id, const HashFunction &hashFunc, BIGNUM *k=0) const |
| Encrypt a message with a Schnorr signature attached. | |
| bool | verifySignature (const ElGamalSignature &signature, const BIGNUM *message) const |
| Verify the signature for a message. | |
| int | marshal (unsigned char **pp) const |
| Serialize the object. | |
| void * | unmarshal (void *bogus, unsigned char **pp, long length) |
| Unserialize the object. | |
| void | toFile (const char *fname) const |
| Writes the public key to a file. | |
| void * | fromFile (const char *fname) |
| Reads the public key from a file. | |
| bool | initialized () const |
Protected Member Functions | |
| void | encryptVals (const BIGNUM *message, BIGNUM *k, BIGNUM *c1, BIGNUM *c2) const |
| Helper function for computing encryptions. | |
Protected Attributes | |
| bool | m_initialized |
| Has this object been initialized yet, or is it still blank? | |
Definition at line 193 of file ElGamal.h.
|
||||||||||||
|
Encrypt a message. In general, the message should include some sort of padding to defend against attacks exploiting short messages. See, for example, "Why Textbook ElGamal and RSA Encryption are Insecure" by D. Boneh, A. Joux, and P.Q. Nguyen.
Definition at line 155 of file ElGamalPublicKey.cc. References encryptVals(). |
|
||||||||||||||||||||
|
Encrypt a message with a Schnorr signature attached. In general, the message should include some sort of padding to defend against attacks exploiting short messages. See, for example, "Why Textbook ElGamal and RSA Encryption are Insecure" by D. Boneh, A. Joux, and P.Q. Nguyen. The addition of a Schnorr signature is described in "Security of Signed ElGamal Encryption" by C.P. Schnorr and M. Jakobsson. That scheme defends against adaptive chosen ciphertext attacks. We extend this to an encrypter-aware scheme by adding a unique identifier for the principal that knows the plaintext.
Definition at line 198 of file ElGamalPublicKey.cc. References encryptVals(), CODEX_ASN1::BigNumber::marshal(), q(), and CODEX_ASN1::BigNumber::value(). Referenced by CODEX_Client::Client::readKey(), and CODEX_Client::Client::writeKey(). |
|
||||||||||||||||||||
|
Helper function for computing encryptions. All parameters must be allocated beforehand.
Definition at line 354 of file ElGamalPublicKey.cc. References CODEX_Ciphers::jacobi(), q(), and CODEX_ASN1::BigNumber::value(). Referenced by encrypt(), and encryptS(). |
|
|
Reads the public key from a file.
Definition at line 590 of file ElGamalPublicKey.cc. References p(), and unmarshal(). |
|
|
|
Definition at line 114 of file ElGamalPublicKey.cc. References CODEX_ASN1::BigNumber::value(). Referenced by CODEX_KeyService::ClientMessageSigner::handler(), and q(). |
|
|
Definition at line 134 of file ElGamalPublicKey.cc. References p1(). Referenced by CODEX_APSS::StateInfo::configure(), encryptS(), encryptVals(), and CODEX_Client::Client::readKey(). |
|
|
Writes the public key to a file.
Definition at line 568 of file ElGamalPublicKey.cc. |
|
||||||||||||
|
Verify the signature for a message.
Definition at line 428 of file ElGamalPublicKey.cc. References CODEX_ASN1::BigNumber::value(). |
1.4.1