pycrypto

problems with easy_install pycrypto

旧街凉风 提交于 2019-12-10 03:45:30
问题 I'm trying install pycrypto on osx with easy_install and I'm getting the following error: easy_install pycrypto Searching for pycrypto Reading http://pypi.python.org/simple/pycrypto/ Reading http://pycrypto.sourceforge.net Reading http://www.pycrypto.org/ Reading http://www.amk.ca/python/code/crypto Best match: pycrypto 2.3 Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.3.tar.gz Processing pycrypto-2.3.tar.gz Running pycrypto-2.3/setup.py -q bdist_egg --dist-dir /var

Pycrypto 2.6.1 for android smartphone

我的梦境 提交于 2019-12-08 13:11:22
问题 I am doing a project where I am required to do an encryption on Windows system and then I need to decrypt the message on an Android smartphone. I am using Python with pycrypto 2.6.1 module on Windows and qpython app on the smartphone. Qpython is not recognizing the the encryption code I am using on Windows and it is telling me that no module Crypto can be found. How do I implement pycrypto 2.6.1 module on smartphone? 回答1: https://drive.google.com/file/d/0B9cgr9L98QxzR0t3S0VoUWxQeTg/view?usp

Python encryption unicode error when converting from Python 2 to python 3

送分小仙女□ 提交于 2019-12-08 09:54:44
问题 I found some code which I want to incorporate into my Python encryption program. It should encrypt the files in the code's same directory, and I want it to target a directory. But, it's written in Python 2 and when I change around some code to fit Python 3, I get the following error: Traceback (most recent call last): File "/home/pi/Desktop/Projects/FyleCript/Dev Files/encryption.py", line 77, in <module> encrypt(SHA256.new(password).digest(), str(Tfiles)) File "/usr/lib/python3/dist-packages

Can't use 256-bits counter in AES.MODE_CTR cipher in python

眉间皱痕 提交于 2019-12-08 08:55:47
问题 guys. I use crypto library for AES encryption and decryption. AES-128 works perfect: ctr = Counter.new(128) key = os.urandom(16) obj = AES.new(key, AES.MODE_CTR, counter=ctr) But when I change 128 to 256, and 16 to 32 error occurs: ValueError: unsupported format character 'b' (0x62) at index 29 Could you help me, any suggestions? 回答1: The counter size is the same as the block size of the block cipher. The block size and key size of a cipher are not directly related. Now AES-256 has a key size

Unable to Install with easy_install or pip on mac

核能气质少年 提交于 2019-12-08 06:22:41
问题 I'm trying to install lxml and pycrypto modules using easy_install (and pip) but getting error messages like Running lxml-2.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kGsWMh/lxml-2.3.4/egg-dist-tmp-Gjqy3f Building lxml version 2.3.4. Building without Cython. Using build configuration of libxslt 1.1.24 In file included from /usr/include/limits.h:63, from /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.0.1/include/limits.h:10, from /Library/Frameworks/Python.framework

Trying to generate RSA signature with Python from working C# code

元气小坏坏 提交于 2019-12-08 05:37:40
I'm using someone else's code to generate an RSA signature used for verification in xbox 360 save files. The code reads the needed values from a files and correctly generates the signature. The code is: byte[] xHash=null; RSAParameters xParams = new RSAParameters(); br.BaseStream.Position = 0x1A8; xParams.D = br.ReadBytes(0x80); xParams.Exponent = br.ReadBytes(0x4); xParams.Modulus = br.ReadBytes(0x80); xParams.P = br.ReadBytes(0x40); xParams.Q = br.ReadBytes(0x40); xParams.DP = br.ReadBytes(0x40); xParams.DQ = br.ReadBytes(0x40); xParams.InverseQ = br.ReadBytes(0x40); br.close(); br=new

fatal error: 'string.h' file not found after upgrading to python 3.2 and installing certain modules from a virtualenv

你。 提交于 2019-12-08 05:31:54
问题 I'm on Mac OSX 10.8 (Mountain Lion) and have just installed Python 3.2.3. When installing pycrypto from a virtual environment using that version of python: $ virtualenv --no-site-packages -p /usr/local/bin/python3.2-32 venv $ source venv/bin/activate $ pip install pycrypto I get the error: gcc-4.2 not found, using clang instead building 'Crypto.Hash._MD2' extension warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. Compiling with an SDK that doesn't seem to exist

Trying to generate RSA signature with Python from working C# code

我们两清 提交于 2019-12-08 04:50:00
问题 I'm using someone else's code to generate an RSA signature used for verification in xbox 360 save files. The code reads the needed values from a files and correctly generates the signature. The code is: byte[] xHash=null; RSAParameters xParams = new RSAParameters(); br.BaseStream.Position = 0x1A8; xParams.D = br.ReadBytes(0x80); xParams.Exponent = br.ReadBytes(0x4); xParams.Modulus = br.ReadBytes(0x80); xParams.P = br.ReadBytes(0x40); xParams.Q = br.ReadBytes(0x40); xParams.DP = br.ReadBytes

Replace OpenSSL in oauth2client.crypt to work with PyCrypto

跟風遠走 提交于 2019-12-07 16:21:35
问题 Google App Engine supports PyCrypto, but does not support OpenSSL. I want to use the oauth2client SignedJwtAssertionCredentials, which internally calls OpenSSL . Is there is a way to get oauth2client to work with PyCrypto. I am assuming that it might be possible to create a local version of SignedJwtAssertionCredential equivalent by using PyCrypto instead ? Also is there a way I can make a request to Google App Engine to provide a version that support the functionality for certificate

AES_128_CTR encryption by openssl and PyCrypto

你。 提交于 2019-12-07 08:20:30
问题 Wondering the right way to convert a AES_128_CTR encryption by openssl to PyCrypto. First, I did an encryption by openssl as following: openssl enc -aes-128-ctr -in input.mp4 -out output.openssl.mp4 -K 7842f0a1ebc38f44e3e0c81943f68582 -iv d01f40dfc8ec8cd9 And then, I tried to do the same thing through PyCrypto: from Crypto.Cipher import AES from Crypto.Util import Counter key = '7842f0a1ebc38f44e3e0c81943f68582' iv = 'd01f40dfc8ec8cd9' ctr_e = Counter.new(128, initial_value=int(iv, 16))