Domain Keys in Python
Nikita the Spider
NikitaTheSpider at gmail.com
Fri Apr 20 11:51:30 EDT 2007
In article <mailman.6767.1177059715.32031.python-list at python.org>,
Andrew Veitch <andrew.veitch at yahoo.co.uk> wrote:
> I am trying to implement Domain Keys
> (http://domainkeys.sourceforge.net/) in Python.
>
> In Perl I would just use Crypt:RSA which has a sign
> method with an armour option which generates exactly
> what I want but I can't find a way of doing this in
> Python.
>
> I tried this:
>
> from M2Crypto import RSA
> key = RSA.load_key('rsa.private')
> msg='Hello world'
> print key.sign(msg)
>
> But the output isn't quite right because there isn't
> an armour option - I verified this by reading the
> source.
>
> I'm not even sure if M2Crypto is the right library to
> be using or is it just that I need to use something
> else for the final step?
Hi Andrew,
There's also pycrypto for doing RSA encryption:
http://www.amk.ca/python/code/crypto
I messed around with this for a little while but decided I didn't need
it. ISTR figuring out that it does not implement any padding; is this
perhaps the armour option you're talking about? I'm not a cryptographer
and I don't even play one on TV, so the accuracy of this is probably
even less reliable than an average Usenet posting...
Good luck
--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
More information about the Python-list
mailing list