English 中文(简体)
4. 甲型六氯环己烷和丙型六氯环己烷
原标题:Python PyCrypto and RSA problem

I e got brief RSA pythonscript:

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)

和在我试图管理时,我方能显示错误:

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

I m really new to Python and I don t know what it means. I would be thankful for any kind of help.

最佳回答

密码:PublicKey.RSA Implementation-class.html”rel=“nofollow” http://www.dlitz.net/software/pycodeo/apidoc/Crypto.PublicKey.RSA.RSA Implementation-class.html

我的以下作品(在32台视窗的27.1英里):

import Crypto.PublicKey.RSA
impl = Crypto.PublicKey.RSA.RSAImplementation()

请注意,若能提供快速数学,则按违约计算。 如果无法使用,则使用-fast_math就会造成时间错误。

问题回答

Hmmm,我有同样的错误——也许在docs和法典之间有一些错误?

我很少使用pyCrypto,我发现M2Crypto是整个更好的图书馆——你可能希望尝试这样做。

这意味着这种加密。 PublicKey。 RSA没有职能/可称为RSA执行”





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签