Answer the question
In order to leave comments, you need to log in
How to encrypt a string using Python?
Hello.
I need to encrypt some number using both Python and PyCrypto library. Wrote the following test script:
import hashlib
from Crypto.Cipher import AES
password = "catch"
key = hashlib.sha256(password).digest()
iv = 16 * '\x00'
mode = AES.MODE_CBC
some = 38
encryptor = AES.new(key, mode, iv)
print(some)
some = encryptor.encrypt(str(some) * 16)
print(some)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question