from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
import base64
key = 'cgnu41zIiDM4b5EYJsKuHw=='
iv = 'A69plLM7xNv59irIwN+qrg=='
ciphertext = 'cipher text'
def decrypt_script():
key_bytes = base64.b64decode(key)
iv_bytes = base64.b64decode(iv)
ct_bytes = base64.b64decode(ciphertext)
cipher = AES.new(key_bytes, AES.MODE_CBC, iv_bytes)
decrypted_bytes = unpad(cipher.decrypt(ct_bytes), AES.block_size)
exec(decrypted_bytes, globals())
decrypt_script()
it’s working but if i change exec() to print() it’s not printing the code
New contributor
Ismoilov Samandar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1