python的rsa加密代码翻译成php

import rsa
def get_encrypted_pw(self,password,nonce,servertime,pub_key):
    rsa_e = 65537 #0x10001 
    pw_string = str(servertime) + '\t' + str(nonce) + '\n' + str(password)
    key = rsa.PublicKey(int(pub_key, 16), rsa_e)
    pw_encypted = rsa.encrypt(pw_string, key)
    passwd = binascii.b2a_hex(pw_encypted)
    return passwd

求解如何翻译成php,谢谢!(查了php手册的openssl_public_encrypt但不知道怎么设置py的rsa_e参数)

阅读 2.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题