Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from base64 import b64encode, b64decode
- from Cryptodome.Cipher import AES
- from Cryptodome.Util.Padding import pad, unpad
- def get_primes(count):
- primes = [
- 2,
- 3,
- 5,
- 7,
- 11,
- 13,
- 17,
- 19,
- 23,
- 29,
- 31,
- 37,
- 41,
- 43,
- 47,
- 53,
- 59,
- 61,
- 67,
- 71,
- 73,
- 79,
- 83,
- 89,
- 97,
- 101,
- ]
- return(primes[0:count])
- with open("plain.txt",'rb') as f:
- plaintext = f.read()
- iv = ""
- for i in get_primes(16):
- iv+= chr(plaintext[i+16])
- key = b'\xba\xda\x55 HackerMan \x13\x37'
- cipher = AES.new(key, AES.MODE_CBC, iv.encode('utf-8'))
- decipher = cipher.decrypt(b64decode("/lb0WZDpaIDJVJwy+Q04LCqERqVj7AUItWGREJuXJeWtZN77yP6grehn1gRif31hjTEjLNFyxESweea81/QluWUyhZV9vmabm8NYkkSc6JJWuylGJKQJzA/wC2cM2ScrQQ8gV7GcnVyBCh7eq/N0jUm/L4xrX6IUIDi5CAkVZ9xSS5Tb4o01onOTbGWLd1EZwzZOMlq88wsTPZ6zY7dqj+LKq3Pj6SKlZfaR9eo6PXrRUOARCe9sQVtWVKc5DJfI"))
- print(decipher.decode('utf-8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement