【发布时间】:2021-11-18 02:11:12
【问题描述】:
[https://github.com/Simrantiwarii/RSA-ENCYRPTION/blob/1e88b32c9d1e133886f73115374d5018d946f5b8/Untitled6.ipynb] 有人可以查看此代码并告诉我为什么会出现此错误:
TypeError Traceback (most recent call last) <ipython-input-43-01ba3f5a9a3e> in <module> 88 89 if __name__ == '__main__': ---> 90 public_key,private_key = generate_keyPairs() 91 print("Public: ",public_key) 92 print("Private: ",private_key) <ipython-input-43-01ba3f5a9a3e> in generate_keyPairs() 53 E = generatenextPrime(E) 54 #print(type(F)) ---> 55 g = gcd(E,phi) 56 #print("E=",E,) 57 #print(type(E)) <ipython-input-43-01ba3f5a9a3e> in gcd(a, b) 11 def gcd(a, b): 12 while b != 0: ---> 13 a, b = b, a % b 14 return a 15 TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'
我正在尝试研究 RSA 中加密密钥组件“e”的性质。
【问题讨论】:
标签: python encryption jupyter-notebook rsa public-key-encryption