How add/change password for RSA priv key using PyCrypto

K

k2

Hi, maybe somebody be able to help me.
I'm using PyCrypto to generate a pair of RSA keys. The public key and
private key.
I try to add a password to the private key, and I do not know how to
do it.

This is a piece of my code.

#encoding:utf-8
from Crypto.PublicKey import RSA

pass_alice='ala'
private_alice_key = RSA.generate(1024)
public_alice_key = private_alice_key.publickey()

str_priv = private_alice_key.exportKey()
str_pub = public_alice_key.exportKey()

print str_priv
print str_pub

# HOW ADD OR CHANGE PASSWORD FOR private_alice_key
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top