From 03e9c40e54e1c5ef22910310461937f512ce680a Mon Sep 17 00:00:00 2001 From: Nitkarsh Chourasia Date: Mon, 8 Jan 2024 17:16:55 +0530 Subject: [PATCH] update: Add support for Upper case encrypt and decrypt updated the dictionary of encryption and changed the way the function takes in the string. --- encrypter-decrypter-gui.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/encrypter-decrypter-gui.py b/encrypter-decrypter-gui.py index ea46ea95bb9..75d10d37839 100644 --- a/encrypter-decrypter-gui.py +++ b/encrypter-decrypter-gui.py @@ -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", @@ -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: @@ -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: