Provides encryption and decryption operations. More...
Static Public Member Functions | |
static void | initialize (String paramfile) |
Initializes the cipher with parameters in a given file. | |
static void | initialize (InputStream is) |
Initializes the cipher with parameters in a stream. | |
static BigInteger | encrypt (BigInteger x) |
Encrypts an integer x to E(x) . | |
static BigInteger | decrypt (BigInteger c) |
Decrypts an encrypted value to the original integer value. | |
static BigInteger | decrypt (BigInteger c, int degree) |
Decrypts an encrypted value of a specified degree of b to the original integer value. |
Provides encryption and decryption operations.
The used encryption scheme is
The decryption is done by
If an encrypted value is known to contain b
of a degree k
greater than 1, the decryption is instead done by
Before using, the Cipher object needs to be initialized with either a parameters file (see initialize(String)) or a stream (see initialize(InputStream)) containing the parameters.
static BigInteger common.Cipher.decrypt | ( | BigInteger | c | ) | [inline, static] |
Decrypts an encrypted value to the original integer value.
c | encrypted value. |
static BigInteger common.Cipher.decrypt | ( | BigInteger | c, |
int | degree | ||
) | [inline, static] |
Decrypts an encrypted value of a specified degree of b
to the original integer value.
c | encrypted value. |
degree | known degree of b in the encrypted value. |
static BigInteger common.Cipher.encrypt | ( | BigInteger | x | ) | [inline, static] |
Encrypts an integer x
to E(x)
.
x | integer to be encrypted. |
static void common.Cipher.initialize | ( | String | paramfile | ) | [inline, static] |
Initializes the cipher with parameters in a given file.
paramfile | parameters filename. |
static void common.Cipher.initialize | ( | InputStream | is | ) | [inline, static] |
Initializes the cipher with parameters in a stream.
is | stream containing the parameters. |