[pycrypto] example

avo ga avogatro2007 at googlemail.com
Tue Aug 25 06:00:21 CST 2009

I checked GIT, installed the latest Version.
use the Crypto.random.new().read function
I HOPE this is a goog idea ^^

print "\n=====RSA 368 Demo====="
from Crypto.PublicKey import RSA
from Crypto import Random
rpool = Random.new()

privatekeyCMS = RSA.generate(368, rpool.read)

privatekeyClient = RSA.generate(368, rpool.read)
publickeyCMS = privatekeyCMS.publickey()
publickeyClient = privatekeyClient.publickey()

signed_PWD = privatekeyCMS.sign(PWD,"")
enc_PWD = publickeyClient.encrypt(PWD, "")

another question about os.fork:
there is some functions to summon a child process:
like popen[1-4]
or some threading class:
I don't use os.fork.
should I use Random.atfork() for every sub process?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dlitz.net/pipermail/pycrypto/attachments/20090825/8662dd5e/attachment.htm 

More information about the pycrypto mailing list