Thursday, May 6, 2010

Johny Mnemonic & the PKC


Weeks ago our security professor gave us a yet another assignment. The assignment was to implement the Johny Mnemonic[1] using public-private key cryptography. I got the idea wrong & tried to simulate the Johnny Mnemonic behavior in a computer program, while the assignment was to discuss the scenario, pitfalls, etc.
So here I'm putting it as a blog post so that i feel better about my wasted time ;). In this program I simply,

  • Generate a RSA key pair using the Java key generator library & save it in a two seperate files named public.key & private.key.
  • Encrypt a plain text file using the RSA cipher using the generated public key stored in the public.key file
  • Store the cipher data in a file named JohnnyMnemonic.brain
  • Decrypt the cipher data using the private key that was saved in the private.key file and present it to the user.
Even though this is pretty much simple as you see it , this is the very essence of public key infrastructure (PKI)[2].I have provided the Java code[3] that implements the above task. The code it self is self explanatory i guess.


[1] William Gibson, Johnny Mnemonic, Harper-Collins, 1996.
[2] http://en.wikipedia.org/wiki/Public_key_infrastructure
[3] Java code