Skip to content

Commit 03e9c40

Browse files
update: Add support for Upper case encrypt and decrypt
updated the dictionary of encryption and changed the way the function takes in the string.
1 parent 0d73b20 commit 03e9c40

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

encrypter-decrypter-gui.py

+28-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ def __init__(self, parent):
3434
self.parent = parent
3535
# ========== Data Key ==========
3636
self.data_dic = {
37+
"A": "Q",
38+
"B": "W",
39+
"C": "E",
40+
"D": "R",
41+
"E": "T",
42+
"F": "Y",
43+
"G": "U",
44+
"H": "I",
45+
"I": "O",
46+
"J": "P",
47+
"K": "A",
48+
"L": "S",
49+
"M": "D",
50+
"N": "F",
51+
"O": "G",
52+
"P": "H",
53+
"Q": "J",
54+
"R": "K",
55+
"S": "L",
56+
"T": "Z",
57+
"U": "X",
58+
"V": "C",
59+
"W": "V",
60+
"X": "B",
61+
"Y": "N",
62+
"Z": "M",
3763
"a": "q",
3864
"b": "w",
3965
"c": "e",
@@ -199,7 +225,7 @@ def backend_work(self, todo, text_coming):
199225
try:
200226
text_coming = str(
201227
text_coming
202-
).lower() # <----- Lowering the letters as dic in lower letter
228+
) # <----- Lowering the letters as dic in lower letter
203229
for word in text_coming:
204230
for key, value in self.data_dic.items():
205231
if word == key:
@@ -212,7 +238,7 @@ def backend_work(self, todo, text_coming):
212238
return text_to_return
213239
elif todo == "Decrypt":
214240
try:
215-
text_coming = str(text_coming).lower()
241+
text_coming = str(text_coming)
216242
for word in text_coming:
217243
for key, value in self.data_dic.items():
218244
if word == value:

0 commit comments

Comments
 (0)