>>>(bob_pub, bob_priv) = rsa.newkeys(512)
>>>message = 'hello Bob!'
>>>crypto = rsa.encrypt(message, bob_pub)
>>>message = rsa.decrypt(crypto, bob_priv)
>>>print message
hello Bob!
文档地址:http://stuvel.eu/files/python-rsa-doc/usage.html#generating-keys
如果未解决请继续追问
你可以使用rsa这个python库:>>>(bob_pub, bob_priv) = rsa.newkeys(512)
>>>message = 'hello Bob!'
>>>crypto = rsa.encrypt(message, bob_pub)
>>>message = rsa.decrypt(crypto, bob_priv)
>>>print message
hello Bob!
希望能帮到你。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)