Domain Keys in Python

A

Andrew Veitch

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?

Thanks in advance

Andrew
 
N

Nikita the Spider

Andrew Veitch said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top