Cryptography Reference
In-Depth Information
Example 8.18 Let us present an example of Cramer-Shoup encryption and decryp-
tion. We will use the previously generated key pair pk / sk and the followingmessage,
which is given as an ordinary text string:
> ms := "This is a test of Cramer-Shoup encryption":
We will use the following seed for the encryption function:
> sd := "5d6c0ec0bb84b416a8431784052cd123":
We compute the ciphertext as follows; we must tell the encryption function that
the message being encrypted is given as an ordinary text string:
> ct := CSEncrypt(pk, ms, sd, messagetype = 'text');
"9c4734b35d0584e238e28a10bbd5507ad03f4c286e2cf2c63a785c3046a36b076b0636059f54cf1a9\
29177349e6cdfc43080423ab87f05cecd67440834b762774da4382f600bf91048baed0353775c3f2\
9591e86a41625807f7870e5ba8c717c72e3752691d13c080d3a8e7a3d6ecd7207c6c4280192a7540\
41ccc856137016487067d2471bef5946af06acb6e72845936fab1a4f1a56b9e0ed18404672e08d3c\
deb4d542109cb1a1145aba81696c5f43d27a5949827f187741923469f12c33da90a1d60127826b42\
2676a671125dfa3fc9928423bd14aaa748ba7797d9b8dad4d8ddc706ac2c7cdefd2ae5abd8400aea\
e5d114947749a2aeb4555e1739bc05f85e1fd12d9a1cf802e5fe7b1be2bd705388390fdf079be391\
e0538d91125eaad45b7fe26c7bd581b26ee75212e7290a46bc7697b8db3cc80c92a97c97ac6be3f7\
4bafbe3fc04703232e0353de4e16eaeba315dcb090b2a6e11c2b804bf3c4601ad5caa488a6db812e\
b94af6ddb8e23cacb4666e5d956f63f76bfea554f2b044f2947910282690f64f22b07390ef1df45e\
484e5a0f96f84b2c421d92ae53f88ac35da671bec6ec07bd5fc8e138ab1c316cf6f1361a4bc46454\
bb71a28577a230fca190eaa3c514bd2c0117306bea0c0fe28cca06559330c80f795680f3f67b0564\
edf2e873694eddbd5fdb24d82a287b10df711188050c443a0b9a198c94ff9e0"
Now, the message can be recovered by using the decryption function as follows:
> CSDecrypt(sk, ct, messagetype = 'text');
"This is a test of Cramer-Shoup encryption"
8.7 A Speed Comparison Among Implementations
of CCA Secure Schemes
We are going to examine the practical efficiency of the Maple implementations of
the CCA secure public-key encryption schemes we have studied. We will make a
speed comparison among these implementations but we warn that this comparison
has limited value because it depends on the specific details of these implementations
and, of course, different results may be obtained with other implementations and
other languages. However, this can give a rough approximation of the relative speed
of these schemes.
To carry out our experiment, we are going to use the following Maple function
that will also serve to test the correct behavior of the encryption and decryption
functions of these schemes. The first input parameter is scheme , which is used to
specify the name of the scheme to be tested among three possibilities: RSAOAEP ,
RabinSAEPPlus and CramerShoup . The next input parameter is key ,used
to specify a key (consisting of a public key plus the corresponding private key) in
the format used in our implementations. The remaining parameters are seed ,in
which a seed (given as a hexadecimal string of appropriate length) is to be specified,
iterations , for the number of encryption/decryption operations to be performed
and, finally, bytelength , for the byte length of the messages to be encrypted and
 
Search WWH ::




Custom Search