pycrypto

Python pycrypto disables logging - google app engine

寵の児 提交于 2019-12-30 07:27:15
问题 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

Non-detached PKCS#7 SHA1+RSA signature without M2Crypto

这一生的挚爱 提交于 2019-12-28 04:26:06
问题 I'm trying to create a non-detached signature on python3. I currently have code that does this on python2 with m2crypto, but m2crypto isn't available for python3. I've been trying rsa, pycrypto and openssl, but haven't seen to find how. Here's the equivalent OpenSSL command: openssl smime -sign -signer $CRTFILE -inkey $KEYFILE -outformDER -nodetach It's the nodetach option that I can't imitate with either rsa, pyopenssl or pycrypto. Has anyone does this on python3? I'd like to avoid using

Skipping elif statement?

我的梦境 提交于 2019-12-25 16:23:31
问题 Am trying to create a simple encryption/decryption using pycryptodome but keeping getting the following error: ValueError: Error 3 while encrypting in CBC mode after some digging I saw that you get this error if there is not enough data to encrypt, as in there is no padding in effect. The thing is that I've added a padding function. After debugging it seems as if my code literally skips the padding part completely and causes this error. What am I doing wrong? import os, random from Crypto

Skipping elif statement?

早过忘川 提交于 2019-12-25 16:23:10
问题 Am trying to create a simple encryption/decryption using pycryptodome but keeping getting the following error: ValueError: Error 3 while encrypting in CBC mode after some digging I saw that you get this error if there is not enough data to encrypt, as in there is no padding in effect. The thing is that I've added a padding function. After debugging it seems as if my code literally skips the padding part completely and causes this error. What am I doing wrong? import os, random from Crypto

How to import PyCrypto inside App Engine development server (OS X)?

梦想与她 提交于 2019-12-25 14:07:45
问题 My app.yaml include this lines: libraries: - name: pycrypto version: "2.6" I have the correct version of PyCrypto: $ python >>> import Crypto >>> Crypto.__version__ '2.6' But when I try evaluate import Crypto in GAE Development SDK interactive console, I get this: Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py"

How to import PyCrypto inside App Engine development server (OS X)?

淺唱寂寞╮ 提交于 2019-12-25 14:07:22
问题 My app.yaml include this lines: libraries: - name: pycrypto version: "2.6" I have the correct version of PyCrypto: $ python >>> import Crypto >>> Crypto.__version__ '2.6' But when I try evaluate import Crypto in GAE Development SDK interactive console, I get this: Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py"

How to use a different version of PyCrypto in GAE Python

僤鯓⒐⒋嵵緔 提交于 2019-12-25 03:26:11
问题 I downloaded the experimental version of PyCrypto (pycrypto-2.7a1.tar.gz). I have copied the "Crypto" directory (extracted from pycrypto-2.7a1.tar.gz) to my project folder. In app.yaml file: libraries: - name: pycrypto version: 2.7 # latest I get error (at the time of deployment) if I try to give version as 2.7a1 or 2.7 for PyCrypto in app.yaml: appcfg.py: error: Error parsing C:\gaurav\coding\python\x\x\app.yaml: pycrypto version "2.7" is not supported, use one of: "2.3", "2.6" or "latest" (

Unable to build pycrypto recipe in python3 - toolchain

帅比萌擦擦* 提交于 2019-12-24 20:54:31
问题 I am trying to package a simple Kivy app in iOS using the instruction in the site: https://github.com/kivy/kivy-ios My app is very simple with 1 line: from firebase import firebase The app can be packaged successfully in android using linux. However, I am having problem packaging it to iOS. I need to build a recipe named pycrypto but it's giving me the below error. I tried both python2 and python3. I still ended up with the same error. It seems the url link is dead (https://ftp.dlitz.net/pub

Error executing the result of cx_freeze using pycrypto

ぐ巨炮叔叔 提交于 2019-12-24 15:40:54
问题 I am trying to freeze a Little python program using pycrypto library in Windows. Last version of everything including cx_freeze. After running >python setup.py build apparently everything goes nice. But running the exe file generated reports the following error : ImportError: cannot import name _AES The error is reported by AES.py file which is part of pycrypto lybrary. I have copied the pycrypto structure in the same directory where setup.py is and I played with the contents of setup.py

Decrypt AES-256-CTR payloads in Python when encrypted from Nodejs

时光怂恿深爱的人放手 提交于 2019-12-24 07:37:17
问题 I wrote an application in Nodejs that encrypts user passwords using AES-256-CTR : const crypto = require('crypto') const masterkey = 'azertyuiopazertyuiopazertyuiopaz' const cipher = crypto.createCipher('aes-256-ctr', masterkey) console.log(cipher.update('antoine', 'utf8', 'hex') + cipher.final('hex')) //=> 6415bc70ad76c6 It then gets persisted into a database and now I'm trying to decipher it from a Python script using PyCrypto like this : masterkey = 'azertyuiopazertyuiopazertyuiopaz'