[pycrypto] Public key algos usage
don at amberfisharts.com
Mon Nov 16 11:26:06 CST 2009
As far as I know the API remains the same whether the key is a private/public key pair
or only the public key. So this should work (However, I didn't test this code):
>>> message = "this is a secret"
>>> pub_key = key_pair.publickey()
>>> cipher_text = pub_key.encrypt(message, "")
I also think that the API-Reference  is fairly accurate.
I hope that helps. If not, maybe you show some code how you try to use it.
> I cannot find documentation on using PyCrypto's public keys algorithms.
> The main problem is that while I can easily create a private/public
> keypair and use it, I don't understand how to create an object given
> only a public key (encryption/verify only).
> The only documentation says to "look at the source code".
> What is the best thing to do at this time?
> Wait for a definitive API? Use a development version? Use the old
> undocumented API?
> Is there a code snipplet somewhere on using RSA or ElGamal with the current API?
> By the way I already use PyCrypto symmetric encryption in the
> application I'm writing and it works well and fast.
> Thank you for your time,
> Stefano Cavallari
> pycrypto mailing list
> pycrypto at lists.dlitz.net
More information about the pycrypto