pycrypto

No module named 'winrandom' when using pycrypto

No module named 'winrandom' when using pycrypto Question: I already spent 2 days trying to install pyCrypto for Paramiko module. So, first issue I had faced was this: >>> import paramiko Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “C:Program FilesPythonlibsite-packagesparamiko__init__.py”, line 31 , in <module> from paramiko.transport import SecurityOptions, Transport …

Total answers: 2

Different Results in Go and Pycrypto when using AES-CFB

Different Results in Go and Pycrypto when using AES-CFB Question: I am adding a go application to an already existing python codebase. I’ve been having trouble dealing with encryption between the languages. This is using go 1.2.1 and Python 2.7.x / PyCrypto 2.7a1. Here is the Python sample: import Crypto.Cipher import Crypto.Hash.HMAC import Crypto.Hash.SHA256 import …

Total answers: 6

Python's pycrypto library for random number generation vs os.urandom

Python's pycrypto library for random number generation vs os.urandom Question: I was trying to understand and figure out if I should use os.urandom() or Crypto.Random.new() for cryptographically secure pseudo-random numbers. The following website seems to suggest to use os.urandom(): https://github.com/mozilla/PyHawk/pull/13 but I don’t really see why and the other websites I found online don’t really …

Total answers: 4

ImportError: No module named Crypto.Cipher

ImportError: No module named Crypto.Cipher Question: When I try to run app.py (Python 3.3, PyCrypto 2.6) my virtualenv keeps returning the error listed above. My import statement is just from Crypto.Cipher import AES. I looked for duplicates and you might say that there are some, but I tried the solutions (although most are not even …

Total answers: 33

How to decrypt OpenSSL AES-encrypted files in Python?

How to decrypt OpenSSL AES-encrypted files in Python? Question: OpenSSL provides a popular (but insecure – see below!) command line interface for AES encryption: openssl aes-256-cbc -salt -in filename -out filename.enc Python has support for AES in the shape of the PyCrypto package, but it only provides the tools. How to use Python/PyCrypto to decrypt …

Total answers: 7

Pycrypto install fatal error: gmp.h file not found

Pycrypto install fatal error: gmp.h file not found Question: It seems like there are a number of people who have had a similar problem, however, after much searching I haven’t been able to find a solution that works with my particular architecture. I’m trying to install Pycrypto (as a subsidiary of Fabric) to no avail. …

Total answers: 5

Encrypt & Decrypt using PyCrypto AES 256

Encrypt and decrypt using PyCrypto AES-256 Question: I’m trying to build two functions using PyCrypto that accept two parameters: the message and the key, and then encrypt/decrypt the message. I found several links on the web to help me out, but each one of them has flaws: This one at codekoala uses os.urandom, which is …

Total answers: 15

Installing PyCrypto on Ubuntu – fatal error on build

Installing PyCrypto on Ubuntu – fatal error on build Question: Having looked at other similar threads, I still can’t get pycrypto running. I’m trying to get it working on my Ubuntu laptop – but I couldn’t manage it on my Windows PC either. I downloaded pycrypto-2.6, extracted it, and ran python setup.py build but then …

Total answers: 4

How do I install PyCrypto on Windows?

How do I install PyCrypto on Windows? Question: I’ve read every other google source and SO thread, with nothing working. Python 2.7.3 32bit installed on Windows 7 64bit. Download, extracting, and then trying to install PyCrypto results in “Unable to find vcvarsall.bat”. So I install MinGW and tack that on the install line as the …

Total answers: 20

How to read a RSA public key in PEM + PKCS#1 format

How to read a RSA public key in PEM + PKCS#1 format Question: I have a RSA public key in PEM format + PKCS#1(I guess): —–BEGIN RSA PUBLIC KEY—– MIGJAoGBAJNrHWRFgWLqgzSmLBq2G89exgi/Jk1NWhbFB9gHc9MLORmP3BOCJS9k onzT/+Dk1hdZf00JGgZeuJGoXK9PX3CIKQKRQRHpi5e1vmOCrmHN5VMOxGO4d+zn JDEbNHODZR4HzsSdpQ9SGMSx7raJJedEIbr0IP6DgnWgiA7R1mUdAgMBAAE= —–END RSA PUBLIC KEY—– I want to get the SHA1 digest of its ASN1 encoded version in Python. The first step should be …

Total answers: 1