public class ElgamalKEM extends java.lang.Object implements AsymmetricKEM<SymmetricKey>
The FOT is a transformation to transform a CPA secure public key encryption scheme into a CCA secure encryption scheme in the RO model.
The main idea of FOT is to replace the randomness of ElGamal encryption with a commitment on a random Message. Then, after decaps/decrypt we can check the commitment by re-encrypt the decrypted message with the same commitment as randomness.
ElGamal:
Group \(\mathbb{G}\) of size \(q\), generator \(g\), public key \(h=g^a\), secret key \(a\)
Encrypt message \(R\):
Decrypt \(C\):
FOT Elgamal with KEM and \(H_1 : \mathbb{G} \times \{0,1\}^n \rightarrow \mathbb{Z}_q, H_2 : \mathbb{G} \rightarrow \{0,1\}^n\),
Encaps \(k\):
Decaps \(k\):
ElgamalEncryption| Modifier and Type | Class and Description |
|---|---|
class |
ElgamalKEM.KeyAndCiphertextAndNonce |
KeyEncapsulationMechanism.KeyAndCiphertext<T>| Constructor and Description |
|---|
ElgamalKEM(org.cryptimeleon.math.structures.groups.Group group,
org.cryptimeleon.math.hash.HashFunction md)
Setup Elgamal KEM for given group and message digest.
|
ElgamalKEM(org.cryptimeleon.math.serialization.Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
ByteArrayImplementation |
decaps(CipherText encapsulatedKey,
DecryptionKey sk)
Takes an encapsulated key that was created by
encaps() and decrypts it with sk. |
ElgamalKEM.KeyAndCiphertextAndNonce |
encaps_internal(EncryptionKey pk)
Generates a random symmetric key, encapsulates it, and returns it together with the nonce used and ciphertext.
|
KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> |
encaps(EncryptionKey pk)
Randomly chooses a key k and encrypts it using the given
pk. |
boolean |
equals(java.lang.Object obj) |
EncryptionKeyPair |
generateKeyPair() |
ElgamalEncryption |
getEncryptionScheme() |
org.cryptimeleon.math.hash.HashFunction |
getHashFunction() |
ByteArrayImplementation |
getKey(org.cryptimeleon.math.serialization.Representation repr) |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
ElgamalPrivateKey |
restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
ElgamalKEMCiphertext |
restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr) |
EncryptionKey |
restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
void |
setEncryptionScheme(ElgamalEncryption encryptionScheme) |
void |
setHashFunction(org.cryptimeleon.math.hash.HashFunction messageDigest) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitrestoreFromRepresentationpublic ElgamalKEM(org.cryptimeleon.math.structures.groups.Group group,
org.cryptimeleon.math.hash.HashFunction md)
Here, md is used to construct hash functions H1 and H2.
group - - group where scheme is definedmd - - message digest to construct hash functionspublic ElgamalKEM(org.cryptimeleon.math.serialization.Representation repr)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representablepublic KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> encaps(EncryptionKey pk)
KeyEncapsulationMechanismpk.
The result is (key, encapsulatedKey).encaps in interface KeyEncapsulationMechanism<SymmetricKey>pk - public key used for encrypting kpublic ElgamalKEM.KeyAndCiphertextAndNonce encaps_internal(EncryptionKey pk)
pk - the public key to use for encapsulationpublic ByteArrayImplementation decaps(CipherText encapsulatedKey, DecryptionKey sk)
KeyEncapsulationMechanismencaps() and decrypts it with sk.
That is, if (key, encapsulatedKey) = encaps(pk), then decrypt(encapsulatedKey, sk) == key.decaps in interface KeyEncapsulationMechanism<SymmetricKey>public EncryptionKeyPair generateKeyPair()
generateKeyPair in interface AsymmetricKEM<SymmetricKey>public ByteArrayImplementation getKey(org.cryptimeleon.math.serialization.Representation repr)
public ElgamalKEMCiphertext restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr)
restoreEncapsulatedKey in interface KeyEncapsulationMechanism<SymmetricKey>public EncryptionKey restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreEncapsulationKey in interface KeyEncapsulationMechanism<SymmetricKey>public ElgamalPrivateKey restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreDecapsulationKey in interface KeyEncapsulationMechanism<SymmetricKey>public ElgamalEncryption getEncryptionScheme()
public void setEncryptionScheme(ElgamalEncryption encryptionScheme)
public org.cryptimeleon.math.hash.HashFunction getHashFunction()
public void setHashFunction(org.cryptimeleon.math.hash.HashFunction messageDigest)