Pessoal estou tentando descriptografar AES, só que eu estou me deparando com esseo seguinte erro
Traceback (most recent call last): File "./teste2.py", line 190, in main() File "./teste2.py", line 186, in main decrypt(password) File "./teste2.py", line 172, in decrypt dec = base64.b64decode(crypt.decrypt(password)) File "/usr/lib/python2.7/base64.py", line 76, in b64decode raise TypeError(msg) TypeError: Incorrect padding
Código:
Traceback (most recent call last):
File "./teste2.py", line 190, in main()
File "./teste2.py", line 186, in main decrypt(password)
File "./teste2.py", line 172, in decrypt dec = base64.b64decode(crypt.decrypt(password))
File "/usr/lib/python2.7/base64.py", line 76, in b64decode raise TypeError(msg)
TypeError: Incorrect padding
def decrypt(password): iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16)) crypt = AES.new(password, AES.MODE_CBC, iv) dec = base64.b64decode(crypt.decrypt(password)) print "[+] ResultEste é o meu código: %s" % dec
def decrypt(password):
iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16))
crypt = AES.new(password, AES.MODE_CBC, iv)
dec = base64.b64decode(crypt.decrypt(password))
print "[+] Result: %s" % dec