Completed checkpoint 4 and added a dictionary txt

This commit is contained in:
Cory 2024-05-07 13:50:26 -04:00
parent f5f3335453
commit 6ce564f821
2 changed files with 370126 additions and 1 deletions

View File

@ -41,4 +41,24 @@ def decrypt(numeric_message):
for item in numeric_message:
to_decrypt.append((item + (256 - secret_number)) % 256)
return to_decrypt
print(decrypt(encrypt(numerify('abc'))))
print(decrypt(encrypt(numerify('abc'))))
# Checkpoint 4
def wordify(decrypted_message):
word = []
for items in decrypted_message:
word.append(chr(items))
return ''.join(word)
print(wordify(decrypt(encrypt(numerify('abc')))))
secret_number = 78
message = open('xfile.txt','r').read().replace('[','').replace(']','').split(',')
# Is this how I was supposed to get the list from the file?
message_copy = []
for item in message:
message_copy.append(int(item))
message_copy=wordify(decrypt(message_copy))
print(message_copy)

370105
words_370k.txt Normal file

File diff suppressed because it is too large Load Diff