public interface EncryptionScheme
extends org.cryptimeleon.math.serialization.StandaloneRepresentable, org.cryptimeleon.math.serialization.annotations.RepresentationRestorer
EncryptionScheme has the ability to encrypt plaintexts
and decrypt the resulting ciphertext (using EncryptionKeys and DecryptionKeys).
The functional contract is that decrypt(encrypt(m, pk), sk).equals(m) for pk, sk that
"fit" together (depending on the concrete type of encryption scheme).
Sub-Interfaces define how you obtain encryption and decryption keys.
Cf. AsymmetricEncryptionScheme for a very simple example.
EncryptionSchemes are stand-alone representable. So once set up,
you can restore the same scheme with the same public parameters
using the Representation mechanism (i.e. call the class's constructor
with a Representation argument).
| Modifier and Type | Method and Description |
|---|---|
PlainText |
decrypt(CipherText cipherText,
DecryptionKey privateKey)
Decrypts the given cipher text using the given decryption key.
|
default PlainText |
decrypt(org.cryptimeleon.math.serialization.Representation cipherText,
org.cryptimeleon.math.serialization.Representation privateKey) |
CipherText |
encrypt(PlainText plainText,
EncryptionKey publicKey)
Encrypts the given plain text using the given encryption key.
|
default CipherText |
encrypt(org.cryptimeleon.math.serialization.Representation plainText,
org.cryptimeleon.math.serialization.Representation publicKey) |
CipherText |
restoreCipherText(org.cryptimeleon.math.serialization.Representation repr)
Restores the ciphertext corresponding to the given representation.
|
DecryptionKey |
restoreDecryptionKey(org.cryptimeleon.math.serialization.Representation repr)
Restores the decryption key corresponding to the given representation.
|
EncryptionKey |
restoreEncryptionKey(org.cryptimeleon.math.serialization.Representation repr)
Restores the encryption key corresponding to the given representation.
|
default java.lang.Object |
restoreFromRepresentation(java.lang.reflect.Type type,
org.cryptimeleon.math.serialization.Representation repr) |
PlainText |
restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
Restores the plaintext corresponding to the given representation.
|
CipherText encrypt(PlainText plainText, EncryptionKey publicKey)
plainText - the plaintext to encryptpublicKey - the key to use for encryptionPlainText decrypt(CipherText cipherText, DecryptionKey privateKey)
cipherText - the ciphertext to decryptprivateKey - the key to use for decryptionPlainText restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
repr - the representation to restore the plaintext fromCipherText restoreCipherText(org.cryptimeleon.math.serialization.Representation repr)
repr - the representation to restore the ciphertext fromEncryptionKey restoreEncryptionKey(org.cryptimeleon.math.serialization.Representation repr)
repr - the representation to restore the encryption key fromDecryptionKey restoreDecryptionKey(org.cryptimeleon.math.serialization.Representation repr)
repr - the representation to restore the decryption key fromdefault CipherText encrypt(org.cryptimeleon.math.serialization.Representation plainText, org.cryptimeleon.math.serialization.Representation publicKey)
default PlainText decrypt(org.cryptimeleon.math.serialization.Representation cipherText, org.cryptimeleon.math.serialization.Representation privateKey)
default java.lang.Object restoreFromRepresentation(java.lang.reflect.Type type,
org.cryptimeleon.math.serialization.Representation repr)
restoreFromRepresentation in interface org.cryptimeleon.math.serialization.annotations.RepresentationRestorer