Cryptography Reference
In-Depth Information
else
i:=1
end if;
g := (ciphertext[i+1][1]+2*r) mod n;
b := ciphertext[i+1][2]*numtheory:-jacobi(g, n);
ifb=1then
0
else
1
end if
end proc:
Exercise 10.6 Modify the functions CocksIBEEncrypt and CocksIBE
Decrypt above so that they are able to encrypt and decrypt messages of arbitrary
length instead of just one-bit messages.
Example 10.4 In this example, we use the parameters and the user private key con-
structed in Examples 10.2 and 10.3 to encrypt and decrypt a one-bit message. Let us
encrypt, for example, the '1' bit:
> cr1 := CocksIBEEncrypt(mpk, u, "gomez.pardo@nonexisting.com", 1);
[[1930658716856724486929122958773519623025569893479945602172840247222224773528629\
552219458791624037566248187426312800572898039130371529965807172240071785691920801\
618373962614689022758740671904033976630206909243806860982475771902621712524447388\
289599039688907090612743850359341295707954097051786493112208710253146004716359362\
838452795264532710176212061370354730329377353877022355296138847387060644299109782\
948165621104095760031856195465419724064738712317223759650370598765250407353288207\
619671357304279270498016589376285057523010886622691262188235826085576913107800845\
7180021562153351139570120140250714669891057970174114, -1],
[2153541003718210725827616981246679645483685135605930969606934225171005709744585\
301717958291437779302712994435447699121057797200928709216877777708402949408782738\
686060932755679381370799872924632111768447520453738448360225636036013190326471599\
992709687683601261053906288955246941083944565905252636688710927349830356927674119\
647484531895191719790259857108903652081492240984886883459329816831695333320708571\
624191147317296371499823141152504226720325508454964795748904998010883171747229347\
772598493545679787090666702873532855993417953821699264397099339317340939006371046\
7669538969460060226198624380406134182167886955457447, 1]]
Now, we decrypt the ciphertext we have just generated:
> CocksIBEDecrypt(mpk, usk,"gomez.pardo@nonexisting.com", cr1);
1
We see that the plaintext is correctly recovered.
Exercise 10.7 Write a Maple function that tests the behavior of the Cocks IBE
encryption and decryption functions. The function should pseudo-randomly gener-
ate a specified number of one-bit messages, encrypt each one of them, decrypt the
corresponding ciphertext, and compare it with the original message. If some encryp-
tion/decryption operation fails the function should print an informative message,
otherwise the function should print a message stating that the test was successfully
completed.
Search WWH ::




Custom Search