pycrypto

Blinding a message with PyCrypto in Python 3+

Blinding a message with PyCrypto in Python 3+ Question: In Python 2, there were two methods called blind/unblind. Their docs recommend that you should now use pkcs1_15, however they only show how to sign/verify a message. Their sample code looks like this: from Crypto.Signature import pkcs1_15 from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA # …

Total answers: 1

How would i fix this error in creating a genesis block

How would i fix this error in creating a genesis block Question: Traceback (most recent call last): File "C:UsersRACcrypto…blockchain.py", line 178, in <module> blockchain = Blockchain() ^^^^^^^^^^^^ File "C:UsersRACcrypto…blockchain.py", line 49, in __init__ self.chain = [self.create_genesis_block(0)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Blockchain.create_genesis_block() takes 1 positional argument but 2 were given with code looking like this class Blockchain: def …

Total answers: 2

Why I cant decode AES-CTR in python

Why I cant decode AES-CTR in python Question: Im reversing a site to write an api for it, and there is an AES encryption. I figured out that this is AES CTR mode and that 8 byte nonce is prefix for ciphertext. However, when I try decoding with PyCrypto I get nonsence results. This is …

Total answers: 1

DES cipher with pyca/cryptography (PBEWithMD5AndDES)

DES cipher with pyca/cryptography (PBEWithMD5AndDES) Question: To support some legacy application I need to implement PBEWithMD5AndDES (RFC2898 Section 6.1) in python. I know this is insecure, deprecated and should not be used anymore. But this is sadly the requirement I have. I already have a working version that uses PyCrypto/PyCryptodome but I would need to …

Total answers: 2

Failed installing pycrypto with pip

Failed installing pycrypto with pip Question: I encountered a problem when I try to download a certain package: C:Python27Scripts>pip install pycrypto Collecting pycrypto Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz Installing collected packages: pycrypto Running setup.py install for pycrypto … error Complete output from command c:python27python.exe -u -c “import setuptools , tokenize;__file__=’c:\users\beheer~1\appdata\local\temp\pip-install-_luv op\pycrypto\setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read( ).replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))” …

Total answers: 8

Cant encrypt strings with special characters with pycrypto AES

Cant encrypt strings with special characters with pycrypto AES Question: Description I want to store people’s names in MySQL database. Because the data is sensitive information i want to encrypt it with AES. I am using PyCrypto AES module. The code that I am using is: class AESCipher(object): def __init__(self, key): self.bs = 64 self.key …

Total answers: 2

Pip error: Microsoft Visual C++ 14.0 is required

Pip error: Microsoft Visual C++ 14.0 is required Question: I just ran the following command: pip install -U steem and the installation worked well until it failed to install pycrypto. Afterwards I did the pip install cryptography command because I thought it was the missing package. So my question is, how I can install steem …

Total answers: 13

AES get different results by using the same key and iv to encrypt the same plaintext repeatedly

AES get different results by using the same key and iv to encrypt the same plaintext repeatedly Question: Here is my code: from Crypto.Cipher import AES import binascii def encrypt(secret_key, sign, raw): key = md5(secret_key).hexdigest()[::-2] iv = md5(sign).hexdigest()[::-2] raw += (16 – len(raw) % 16) * ” generator = AES.new(key, AES.MODE_CBC, IV=iv) #*********************************************** #Problems occur …

Total answers: 1

ImportError: No module named 'Crypto'

ImportError: No module named 'Crypto' Question: I am working with pycrypto. It works fine on my local windows machine, but when I move it to my python box I get an error with importing the module: from Crypto.Cipher import ARC4 ImportError: No module named ‘Crypto’ The output of python3.3 -c “from Crypto.Cipher import ARC4” Traceback …

Total answers: 3