[tahoe-dev] started on pycryptopp

zooko zooko at zooko.com
Tue Oct 30 23:16:44 UTC 2007


Folks:

If you do a darcs get from http://allmydata.org/source/pycryptopp  
you'll get a Python project.  If you use its setup.py, and if you  
already have Crypto++ [1] on the appropriate library and include  
paths, then you'll get a Python module named "pycryptopp".

So far, it only creates RSA-PSS-SHA256 signing keys -- it doesn't yet  
have the ability to use them for anything.  An interactive session  
follows -- there are docs therein to show the intended API.

Regards,

Zooko

[1] http://cryptopp.com/

wonwin-mcbrootles-computer:~/playground/pycryptopp$ PYTHONPATH=/usr/ 
local/stow/pycryptopp/lib/python2.5/site-packages/ python -i
Python 2.5.1 (release25-maint:58710M, Oct 29 2007, 22:01:25)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import pycryptopp
 >>> print pycryptopp.__doc__
pycryptopp - Python wrappers around Crypto++

To create a new RSA signing key from a seed, call generate_from_seed().
To create a new RSA signing key from the operating system's random  
number generator, call generate().
To deserialize an RSA signing key from a string, call  
create_signing_key_from_string().

To get an RSA verifying key from an RSA signing key, call  
get_verifying_key() on the signing key.
To deserialize an RSA verifying key from a string, call  
create_verifying_key_from_string().


 >>> signkey = pycryptopp.generate(1400)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
_pycryptopp.Error: Precondition violation: size in bits is required  
to be >= 1536, but it was 1400
 >>> signkey = pycryptopp.generate(1536)
WHEEE 1 !
 >>> signkey
<_pycryptopp.RSASigningKey object at 0x5480c0>
 >>> dir(signkey)
['__class__', '__delattr__', '__doc__', '__getattribute__',  
'__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__',  
'__repr__', '__setattr__', '__str__'





More information about the tahoe-dev mailing list