摘要: # rsa 加密 def rsa_encrypt_bytes(bytes_str, n, e): if not isinstance(bytes_str, bytes): return None # 导入rsa库 import rsa.common pubkey = rsa.PublicKey(n, e) key_length = rs... 阅读全文
posted @ 2018-10-26 21:47 菩提树~今生 阅读(4342) 评论(1) 推荐(0) 编辑
摘要: # 分解模数n def rsa_moder(n): base = 2 while base < n: if n % base == 0: return base, n // base base += 1 # 求欧拉函数f(n) def rsa_get_euler(prime1, prime2): retu... 阅读全文
posted @ 2018-10-26 18:33 菩提树~今生 阅读(10435) 评论(0) 推荐(0) 编辑