By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,931 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,931 IT Pros & Developers. It's quick & easy.

Re: SHA1withRSA in python

P: n/a
Ok thanks,

for the records here is the python code to be compatible with java
sha1withrsa:

import M2Crypto

md=M2Crypto.EVP.MessageDigest('sha1')
md.update(clearpass)
p=md.digest()
key=M2Crypto.RSA.load_key(pathtokey)
enc=key.sign(p)

regards
Nicola

Il giorno mer, 12/11/2008 alle 17.45 +1100, Python Nutter ha scritto:
For simple hashing algorithms, then use the aformentioned built in
hashlib in Python.

However for the rest you need M2Crypto to get a wrapper around OpenSSL:

M2Crypto is the most complete Python wrapper for OpenSSL featuring
RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including
AES); SSL functionality to implement clients and servers; HTTPS
extensions to Python's httplib, urllib, and xmlrpclib; unforgeable
HMAC'ing AuthCookies for web session management; FTP/TLS client and
server; S/MIME; ZServerSSL: A HTTPS server for Zope and ZSmime: An
S/MIME messenger for Zope. M2Crypto can also be used to provide SSL
for Twisted.

http://chandlerproject.org/Projects/MeTooCrypto
Cheers,
PN

2008/11/12 Mailing List SVR <li***@svrinformatica.it>:
Hi all,

in java there are several libraries for sha1withrsa, there is something
similar in python?

thanks
Nicola

--
http://mail.python.org/mailman/listinfo/python-list
Nov 18 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.