Making script standalone capable.

This commit is contained in:
Cutieguwu
2024-04-11 11:50:58 -04:00
parent ff5e5ec0df
commit 828331f735
2 changed files with 12 additions and 7 deletions

View File

@@ -28,13 +28,17 @@ def decrypt(dataEncoded: str, keyDecrypt: str):
for c in dataEncoded:
is_found = False
while not is_found:
for k in keyDecrypt:
if c == k: # Character found in decryption key.
dataDecrypted = dataDecrypted + keyEnglish[keyDecrypt.index(k)]
is_found = True
if c != " ":
while not is_found:
for k in keyDecrypt:
if c == k: # Character found in decryption key.
dataDecrypted = dataDecrypted + keyEnglish[keyDecrypt.index(k)]
is_found = True
else:
dataDecrypted = dataDecrypted + c
return dataDecrypted
with open("dataEncoded.txt", "r") as f:
data = "".join(c for c in f.readlines() if c != "\n")
print(decrypt("asdafhedjwandseifhbjnwj", "qwertyuiopasdfghjklzxcvbnm"))
print(decrypt(data, "qwertyuiopasdfghjklzxcvbnm"))

1
dataEncoded.txt Normal file
View File

@@ -0,0 +1 @@
asdafhedjwandseifhbjnwj