php rsa加密算法

时间:2021-03-26 07:58:19
【文件属性】:
文件名称:php rsa加密算法
文件大小:1KB
文件格式:PHP
更新时间:2021-03-26 07:58:19
php rsa PKCS#1 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

网友评论

  • 不错,能用。 兼容性还行。