I'eは、単純なRSAのPythonスクリプトを得た:PythonのPyCryptoとRSA問題
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には本当に新しいですそれが何を意味するのか分かりません。 私は何らかの助けに感謝します。
私は、PyCryptoのすべてがあまりにも少ないドキュメントからは分かりませんが、RSAImplementationは今後変更される可能性のある内部APIです。それが存在する唯一の理由は、SelfTestモジュールがfastmathコードとともに非fastmathコードをテストできるようにするためです。 通常のRSA.construct、RSA.generateなどのメソッドを使用できない場合は、https://bugs.launchpad.net/pycrypto/+bugsにバグを報告してください。 – dlitz