Docsity

Python Script to Decrypt 'challenge.txt.aes' File - Prof. Lab, Lab Reports of Security Analysis

Toggle sidebar
bg1
Create file python to decryptFile Challenge bellow:
import os
import pyAesCrypt
import sys
target_file = "challenge.txt.aes"
# custom encryption/decryption buffer size ( default is 64KB)
bufferSize = 128 * 1024
# Read the passwords file
with open("xato-net-10-million-passwords-1000000.txt",'r')as fob:
lines_list = fob.readlines()
for line in lines_list:
pwd = line.strip("/n")
try:
#try to decypt
pyAesCrypt.decryptFile("challenge.txt.aes", "challenge.txt", pwd,
bufferSize)
# Print the correct password
print(pwd)
break
except ValueError as ve:
#print(ve)
continue
Result:
File challenge before not yet decode
pf2

Partial preview of the text

Download Python Script to Decrypt 'challenge.txt.aes' File - Prof. Lab and more Lab Reports Security Analysis in PDF only on Docsity!

Create file python to decryptFile Challenge bellow: import os import pyAesCrypt import sys target_file = "challenge.txt.aes"

custom encryption/decryption buffer size ( default is 64KB)

bufferSize = 128 * 1024

Read the passwords file

with open("xato-net- 10 - million-passwords-1000000.txt",'r')as fob: lines_list = fob.readlines() for line in lines_list: pwd = line.strip("/n") try: #try to decypt pyAesCrypt.decryptFile("challenge.txt.aes", "challenge.txt", pwd, bufferSize)

Print the correct password

print(pwd) break except ValueError as ve: #print(ve) continue Result: File challenge before not yet decode

File challenge after run program