def RSA_encrypt(public_key, message):
rsakey = rsa.PublicKey.load_pkcs1_openssl_pem(public_key)
encrypted = rsa.encrypt(message.encode('utf-8'), rsakey)
return base64.encodestring(encrypted).decode('utf-8').replace('\n', '')
评论列表
文章目录