【发布时间】:2015-10-18 03:35:23
【问题描述】:
我正在尝试学习如何在服务器(Python gae)和客户端(jquery)之间传递加密数据
以下代码片段草图在服务器上工作:
random_generator = Random.new().read
key = RSA.generate(1024,random_generator)
publicKey = key.publickey()
clearText = "this is a test message"
b64Text = base64.b64encode(clearText)
ecryptedText = publicKey.encrypt(b64Text,32)
b64DecryptedText = key.decrypt(encryptedText)
clearText = base64.b64decode(b64DecryptedText)
我不明白将什么作为公钥传递给客户端,客户端可以使用该公钥进行加密 (使用http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js)
【问题讨论】:
-
谢谢你,Artjom。将继续学习 JSBN。
标签: javascript python encryption rsa pycrypto