Python PyCrypto与RSA问题

2024-04-28 23:46:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个简单的RSA python脚本:

import Crypto.PublicKey.RSA
import rsakey
from Crypto.PublicKey import pubkey

# Some global stuff
impl = Crypto.PublicKey.RSA.RSAImplementation(use_fast_math = True)
RSAObj = impl.construct(rsakey.RSAKeys)

def decrypt(encrypted):
        return RSAObj.decrypt(encrypted)

当我尝试运行它时,我的CLI显示错误:

Traceback (most recent call last):
File "otrsa.py", line 6, in impl = Crypto.PublicKey.RSA.RSAImplementation(use_fast_math = True) AttributeError: 'module' object has no attribute 'RSAImplementation'

我对Python很陌生,我不知道它是什么意思。 我会感谢任何帮助。


Tags: import脚本trueusemathcryptorsaencrypted