10.07.2015 Views

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Electronic Journal of Ma<strong>the</strong>matics and Technology, Volume 6, Number 1, ISSN 1933-2823(%i23) teacher_public;(%o23) [429881, 2294543](%i24) teacher_private;(%o24) [872729, 2294543]With <strong>the</strong>se data, <strong>the</strong> following function rsa encrypt group signs <strong>the</strong> message <strong>with</strong> <strong>the</strong> teacher’ssignature, encrypts <strong>the</strong> signature <strong>with</strong> <strong>the</strong> teacher’s private key, <strong>the</strong> whole message <strong>with</strong> each stu<strong>de</strong>nt’spublic key and generates a file <strong>with</strong> <strong>the</strong> name of <strong>the</strong> stu<strong>de</strong>nt containing <strong>the</strong> encrypted message, storedin a path given by <strong>the</strong> user (in <strong>the</strong> example, /root/messages/). Note also <strong>the</strong> k value for <strong>the</strong> textchunks (k = 3 in <strong>the</strong> example).(load(numericalio));Beginning of co<strong>de</strong>rsa_encrypt_group(s,k,t,u,r,Q,q):=block([stu<strong>de</strong>nts,publickeys,name,path],stu<strong>de</strong>nts:read_list(t),publickeys:read_nested_list(u,comma),for j:1 thru length(stu<strong>de</strong>nts) do(name:stu<strong>de</strong>nts[j],path:simplo<strong>de</strong>([r,string(name),".txt"]),rsa_encrypt_ds(s,k,publickeys[j],Q,q,path)));End of co<strong>de</strong>(%i25) rsa_encrypt_group("/root/KingLear.txt",3,"/root/stu<strong>de</strong>nts.txt","/root/public-keys.txt","/root/messages/",teacher_private,"/root/digsig.txt");(%o25) doneNow, we have seven files in /root/messages/. These are: Cor<strong>de</strong>lia.txt, Curan.txt,Edmund.txt, Fool.txt, Goneril.txt, Lear.txt, and Regan.txt. Suppose that <strong>the</strong>teacher sends each one to its corresponding recipient. When Fool receives his message, he can <strong>de</strong>cryptit using <strong>the</strong> function rsa <strong>de</strong>crypt ds of <strong>the</strong> preceding section, as he knows <strong>the</strong> teacher’s publickey (to <strong>de</strong>cipher <strong>the</strong> signature) and his own private key (to <strong>de</strong>cipher <strong>the</strong> message):(%i26) rsa_<strong>de</strong>crypt_ds("/root/messages/Fool.txt",3,teacher_public,[734395,3038941]);52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!