Last active
March 3, 2021 04:35
-
-
Save mchow01/049608736c7ae492219ee74580465fc1 to your computer and use it in GitHub Desktop.
A tally program for password cracking competition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob, os | |
passwords =[] | |
results = {} | |
student_totals = {} | |
password_totals = {} | |
for filename in os.listdir("."): | |
if filename.endswith(".html"): | |
results[filename] = {} | |
for password in passwords: | |
results[filename][password] = 0 | |
student_totals[filename] = 0 | |
for password in passwords: | |
password_totals[password] = 0 | |
submission = open(filename, "r") | |
for line in submission: | |
for password in passwords: | |
if line.find(password) != -1: | |
results[filename][password] = 1 | |
submission.close(); | |
for student in results: | |
for password in passwords: | |
student_totals[student] += results[student][password] | |
password_totals[password] += results[student][password] | |
for student in student_totals: | |
print(student + "\t" + str(student_totals[student])) | |
print("\n") | |
for password in password_totals: | |
print(password + "\t" + str(password_totals[password])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated for submissions made to Canvas