Skip to content

Commit

Permalink
update: Add support for Upper case encrypt and decrypt
Browse files Browse the repository at this point in the history
updated the dictionary of encryption and changed the way the function takes in the string.
  • Loading branch information
NitkarshChourasia committed Jan 8, 2024
1 parent 0d73b20 commit 03e9c40
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions encrypter-decrypter-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ def __init__(self, parent):
self.parent = parent
# ========== Data Key ==========
self.data_dic = {
"A": "Q",
"B": "W",
"C": "E",
"D": "R",
"E": "T",
"F": "Y",
"G": "U",
"H": "I",
"I": "O",
"J": "P",
"K": "A",
"L": "S",
"M": "D",
"N": "F",
"O": "G",
"P": "H",
"Q": "J",
"R": "K",
"S": "L",
"T": "Z",
"U": "X",
"V": "C",
"W": "V",
"X": "B",
"Y": "N",
"Z": "M",
"a": "q",
"b": "w",
"c": "e",
Expand Down Expand Up @@ -199,7 +225,7 @@ def backend_work(self, todo, text_coming):
try:
text_coming = str(
text_coming
).lower() # <----- Lowering the letters as dic in lower letter
) # <----- Lowering the letters as dic in lower letter
for word in text_coming:
for key, value in self.data_dic.items():
if word == key:
Expand All @@ -212,7 +238,7 @@ def backend_work(self, todo, text_coming):
return text_to_return
elif todo == "Decrypt":
try:
text_coming = str(text_coming).lower()
text_coming = str(text_coming)
for word in text_coming:
for key, value in self.data_dic.items():
if word == value:
Expand Down

0 comments on commit 03e9c40

Please sign in to comment.