10

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.

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.

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?

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.

Thanks, Kevin

1

3 Answers 3

7

Take a look at Raymond Hettinger recipe: Public Key Encryption (RSA)

Sign up to request clarification or add additional context in comments.

3 Comments

Ah that's great, thank you for the help. I will start going through this and adapting it to my needs!
Seems to infinite loop in both python2 and python3.
Why not take a look at my pure-Python RSA library? It may be just what you need: stuvel.eu/rsa
4

Why not take a look at my pure-Python RSA library? It may be just what you need: http://stuvel.eu/rsa

Comments

0

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.

The current version PyCrypto (2.6) does support all major RSA protocols for signature and encryption namely those specified in PKCS#1 (v1.5, PSS, OAEP).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.