473,388 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Domain Keys in Python

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
Apr 20 '07 #1
1 1751
In article <ma***************************************@python. org>,
Andrew Veitch <an***********@yahoo.co.ukwrote:
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
Apr 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve Pinard | last post by:
(Got a comm error trying to post first time, sorry if this is a duplicate) New to Python, so please bear with me. >>> import sys >>> print sys.modules.keys() # works fine >>>...
8
by: Jan-Erik Meyer-Lütgens | last post by:
In the Python Language Reference, I found the following statements about using objects as dictionary keys: 1. "__hash__() should return a 32-bit integer." 2. "The only required property is...
5
by: Peter Murray | last post by:
Hi! I hope someone can assist me, I have been using Python for a year or two, but I am not a programmer and only use it occasionally for small issues or just for fun. So I perhaps do not have the...
8
by: Steven Bethard | last post by:
Sorry if this is a repost -- it didn't appear for me the first time. So I was looking at the Language Reference's discussion about emulating container types, and nowhere in it does it mention...
57
by: Egor Bolonev | last post by:
why functions created with lambda forms cannot contain statements? how to get unnamed function with statements?
90
by: Christoph Zwerschke | last post by:
Ok, the answer is easy: For historical reasons - built-in sets exist only since Python 2.4. Anyway, I was thinking about whether it would be possible and desirable to change the old behavior in...
14
by: vatamane | last post by:
This has been bothering me for a while. Just want to find out if it just me or perhaps others have thought of this too: Why shouldn't the keyset of a dictionary be represented as a set instead of a...
22
by: bearophileHUGS | last post by:
>From this interesting blog entry by Lawrence Oluyede: http://www.oluyede.org/blog/2006/07/05/europython-day-2/ and the Py3.0 PEPs, I think the people working on Py3.0 are doing a good job, I am...
11
by: John | last post by:
I am coding a radix sort in python and I think that Python's dictionary may be a choice for bucket. The only problem is that dictionary is a mapping without order. But I just found that if the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.