pycrypto

app engine: ImportError: No module named Crypto.Hash

≯℡__Kan透↙ 提交于 2019-12-01 14:39:48
问题 I have a script that uses Crypto.Hash but import fails with error: ImportError: No module named Crypto.Hash in my sys.path if I print the sys.path list, there is this entry (among others): /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/pycrypto-2.6 If I open the path above, there is no pycrypto-2.6 directory. How can I get to load pycrypto 2.6? If I import Crypto.Hash running python from command line it works

How to use a service account with Google's python api and drive?

穿精又带淫゛_ 提交于 2019-12-01 12:23:20
I try to write python 2.7 script to upload a file into my personal google drive folder. After several problems I stuck know. This is my current error: NotImplementedError: PKCS12 format is not supported by the PyCrpto library. Try converting to a "PEM" (openssl pkcs12 -in xxxxx.p12 -nodes -nocerts > privatekey.pem) or using PyOpenSSL if native code is an option. I already tried to run this commands, as mentiod in this question and answer . openssl pkcs12 -in privatekey.p12 -nodes -nocerts > privatekey.pem openssl pkcs8 -nocrypt -in privatekey.pem -passin pass:notasecret -topk8 -out pk.pem my

How to use a service account with Google's python api and drive?

こ雲淡風輕ζ 提交于 2019-12-01 11:21:49
问题 I try to write python 2.7 script to upload a file into my personal google drive folder. After several problems I stuck know. This is my current error: NotImplementedError: PKCS12 format is not supported by the PyCrpto library. Try converting to a "PEM" (openssl pkcs12 -in xxxxx.p12 -nodes -nocerts > privatekey.pem) or using PyOpenSSL if native code is an option. I already tried to run this commands, as mentiod in this question and answer. openssl pkcs12 -in privatekey.p12 -nodes -nocerts >

Encrypt in python - decrypt in Javascript

我只是一个虾纸丫 提交于 2019-12-01 09:50:03
I have need to simply encrypt some text in python and being able to decrypt in JavaScrypt. So far I have in python: from Crypto import Random from Crypto.Cipher import AES import base64 BLOCK_SIZE = 16 key = "1234567890123456" # want to be 16 chars textToEncrypt = "This is text to encrypt" def encrypt(message, passphrase): # passphrase MUST be 16, 24 or 32 bytes long, how can I do that ? IV = Random.new().read(BLOCK_SIZE) aes = AES.new(passphrase, AES.MODE_CFB, IV) return base64.b64encode(aes.encrypt(message)) def decrypt(encrypted, passphrase): IV = Random.new().read(BLOCK_SIZE) aes = AES.new

Pyinstaller & Pycrypto

会有一股神秘感。 提交于 2019-12-01 06:07:50
We've recently added pycrypto to a project we've been working on and now I am unable to run the software after it is built with pyinstaller. I have had issues with new packages in pyinstaller, but I am unable to fix this one in particular. The errors I've gotten when trying to run the built software are as follows (sorry for the paraphrasing, it takes quite a while to build) At first it was something like: No package Crypto.Cipher So I added 'Crypto' to the hiddenimports in my .spec file. Then I got, No module named Cipher So I changed 'Crypto' to 'Crypto.Cipher' and then I got, Crypto.Cipher

Pyinstaller & Pycrypto

坚强是说给别人听的谎言 提交于 2019-12-01 03:26:22
问题 We've recently added pycrypto to a project we've been working on and now I am unable to run the software after it is built with pyinstaller. I have had issues with new packages in pyinstaller, but I am unable to fix this one in particular. The errors I've gotten when trying to run the built software are as follows (sorry for the paraphrasing, it takes quite a while to build) At first it was something like: No package Crypto.Cipher So I added 'Crypto' to the hiddenimports in my .spec file.

Python pycrypto disables logging - google app engine

久未见 提交于 2019-12-01 00:34:17
I am using python with google app engine. Working on Macbook air 2012 with python 2.7. The problem I have is: import logging logging.info("test") # this works before importing crypto import Crypto logging.info("test2") # this one does not after importing crypto How does crypto change logging and how can I fix it so that I can use logging normally again in my python app? Update1: It seems that some python errors are also not displayed in the logging from app engine, as well as correct python code also giving a '500 internal server error' which is only visible in a browser console when testing

Using a blinding factor for RSA in pycrypto

旧城冷巷雨未停 提交于 2019-11-30 19:02:56
问题 In python, I am trying to blind and unblind a message. When I unblind the message, I don't get the original message. Does anyone know what I might be doing wrong. The following is my code: s = 'Hello' loadedPublic = get_publickey() loadedPrivate = get_privatekey() pub = loadedPublic.blind(s,23L) pub2 = loadedPublic.unblind(pub,23L) return HttpResponse(pub2) 回答1: Blinding is a sort of encryption with a random element. It is usually used for Blind Signatures which would look like this: from

Different Results in Go and Pycrypto when using AES-CFB

∥☆過路亽.° 提交于 2019-11-30 12:56:28
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 Crypto.PublicKey.RSA from binascii import hexlify, unhexlify #encrypt payload = unhexlify("abababababababababababababababababababababababababababababababab") password = unhexlify("0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF") iv = unhexlify("00000000000000000000000000000000"

PyCrypto install error on Windows

强颜欢笑 提交于 2019-11-30 11:31:35
I am trying to install PyCrypto 2.6 Library on my computer. But I keep getting the following error D:\Software\Python\package\pycrypto-2.6>python setup.py build running build running build_py running build_ext warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Random.OSRNG.winrandom' extension error: Unable to find vcvarsall.bat My System has Windows 8 Pro 64-bit, Visual Studio Enterprise 2012 and Python 3.3 To fix the error I tried to set the Environment Variable VS90COMNTOOLS=%VS110COMNTOOLS% as advised by fmuecke in the post error: Unable to