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