Friday, 1 February 2013

RSA in/and Python

I'm writing a very basic application that uses the principles behind RSA encryption to send data. Code is here on Bitbucket. Obviously released under my favourite license, WTFPL.

I need to generalize it so that it can be used on different machines, randomly generate the public key instead of using hard coded numbers, accept the message as command line argument and so on. But I probably won't bother much with this, since my main goal was to experiment with the brilliant mathematics behind RSA encryption. Here's the Wikipedia section.

It took me quite some time to accept that RSA relies on some of the most basic number theoretic properties. This is its brilliancy. Here is an example. What you might also find brilliant is the way you can break this brilliant algorithm using a quantum computer. I may write some time about Shor's Algorithm on my Quantum Blog.

Oh, and the other cool thing about this application is Python. First, it's not Java. I had enough of it. Then, well it seems very friendly to mathematical code. And to pseudocode too. In fact, whenever I have to write pseudocode, I use Python syntax - or something very close to it. 

No comments:

Post a Comment