title: Implementing full RSA in Python
body: <p>I am currently working on a project using python to implement p2p communication between two (or more) computers.  Although I am pretty proficient with python, I am by no means an expert; programming and encryption are by no means my profession, simply a hobby.  However, in working on this project I have been attempting to learn more about encryption as well as network programming.</p>
  
  <p>As of right now I have written a pretty powerful class that communicates well over a network and I am trying to improve it by implementing RSA to encrypt the connections between peers on the network; this is where I've run into some difficulty.</p>
  
  <p>I have previously used pycrypto to do some basic encryption/decryption in python and am thus-far quite comfortable with all of the tools involved -- including the necessary public-key ciphers.  Moreover, I am also aware that pycrypto has some shortcomings, in the fact that it only implements the bare-bones, low level encryption/decryption algorithms needed to implement RSA and does not implement a full protocol for public-key encryption.  I also know that pycrypto contains some other useful tools such as an AllOrNothing transform which can be used for padding the communication, etc.  However, my question is: can anyone recommend any online articles, books, blog posts, projects, etc. which can help me in my quest to implement an effective RSA protocol?</p>
  
  <p>Lastly, I understand that this is a touchy subject with cryptologists in that amateur-implemented protocols usually mean less security in the program.  As I noted above, this project is a mere learning experience; if I was completing this project professionally I would surely use M2Crypto or some other professionally-implemented, secure protocol -- i.e. SSL/TLS.  Alas, I am merely trying to learn more about encryption by implementing my own model of a proven protocol to create a secure connection between two peers.</p>
  
  <p>Thanks,
  Kevin</p>