RSA with PyCrypto

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Wed Dec 11 19:43:34 EST 2002


Tommy Lindgren <tomyltomyl at linuxlinux.nu> writes:
> I am writing a P2P instant messenger and I would to like to encrypt
> the messages using a symmetric crypto (DES3) and encrypt the DES3-key with
> an asymmetric crypto (RSA). PyCrypto seems nice for this task, but I don't
> understand how the RSA instances are supposed to exchange public keys.

You may be better off just running an unencrypted protocol through an
SSH or SSL tunnel.  Getting cryptographic protocols correct is
extremely hard even if you know what you're doing.  SSL3 exists
because SSL2 had security bugs even though both were designed by
experts.  SSL2 in turn existed because SSL1, also designed by experts,
also had bugs.

Nonetheless, here's docs for something I wrote a while back that might
be of interest:

http://www.nightsong.com/phr/python/crypto.txt



More information about the Python-list mailing list