├── ..spec ├── .vscode └── settings.json ├── Backend ├── Assets │ ├── I1.png │ ├── I10.png │ ├── I2.png │ ├── I3.png │ ├── I4.png │ ├── I5.png │ ├── I6.png │ ├── I7.png │ ├── I8.png │ └── I9.png ├── Decryption │ ├── ControllerDecryption.py │ ├── DHexaPrism.py │ ├── DOctaPrism.py │ ├── DOctahedron.py │ ├── DPentaPrism.py │ ├── DPentaPyramid.py │ ├── PrintMessage.py │ ├── Steganography_Decryption.py │ └── __pycache__ │ │ ├── ControllerDecryption.cpython-310.pyc │ │ ├── DHexaPrism.cpython-310.pyc │ │ ├── DOctaPrism.cpython-310.pyc │ │ ├── DOctahedron.cpython-310.pyc │ │ ├── DPentaPrism.cpython-310.pyc │ │ ├── DPentaPyramid.cpython-310.pyc │ │ ├── PrintMessage.cpython-310.pyc │ │ └── Steganography_Decryption.cpython-310.pyc ├── Encryption │ ├── ControllerEncryption.py │ ├── HexaPrism.py │ ├── OctaPrism.py │ ├── Octahedron.py │ ├── PentaPrism.py │ ├── PentaPyramid.py │ ├── Steganography_Encryption.py │ ├── __pycache__ │ │ ├── ControllerEncryption.cpython-310.pyc │ │ ├── HexaPrism.cpython-310.pyc │ │ ├── OctaPrism.cpython-310.pyc │ │ ├── Octahedron.cpython-310.pyc │ │ ├── PentaPrism.cpython-310.pyc │ │ ├── PentaPyramid.cpython-310.pyc │ │ ├── Steganography_Encryption.cpython-310.pyc │ │ └── progress.cpython-310.pyc │ └── progress.py ├── MainController.py └── __pycache__ │ └── MainController.cpython-310.pyc ├── Documents ├── Final Documents for Paper │ ├── Images and figures │ │ ├── Comparision of Histogram.PNG │ │ ├── Flowchart.jpg │ │ ├── Input and output image.png │ │ ├── Output Analysis Before Image.png │ │ └── Output Analysis after image.png │ ├── Reference papers │ │ ├── 1.pdf │ │ ├── 2.pdf │ │ ├── 3.pdf │ │ ├── 4.pdf │ │ └── 5.pdf │ ├── Rejected Journal Paper │ │ ├── ENIGMA - manuscript draft.doc │ │ └── Enigma - first journal paper (rejected).pdf │ └── reference for 3D Pythocrypt │ │ ├── 3-D Pythocrypt with AES and Chitra kavya.docx │ │ ├── 3-D Pythocrypt with AES and Chitra kavya.pdf │ │ └── enc and dec formulas.xlsx ├── Poster and Comics │ ├── Enigma - Comics.pdf │ └── Enigma poster.pdf ├── Project report │ ├── Content (Project).pdf │ └── Front Sheets (Project).pdf └── Published Research paper │ └── Research paper.pdf ├── Enigma.egg-info ├── PKG-INFO ├── SOURCES.txt ├── dependency_links.txt ├── entry_points.txt ├── requires.txt └── top_level.txt ├── Enigma.py ├── Enigma.spec ├── README.md ├── Screenshots ├── Downloading the Project.PNG ├── Launching the application.PNG ├── decrypt command.PNG ├── encrypt command.PNG ├── help command.PNG ├── info about previous operation.PNG └── not a stego image.PNG ├── __pycache__ ├── Enigma.cpython-310.pyc └── cli_functions.cpython-310.pyc ├── banner.txt ├── banner.txt.bak ├── cli_functions.py └── setup.py /..spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | block_cipher = None 5 | 6 | 7 | a = Analysis( 8 | ['.'], 9 | pathex=[], 10 | binaries=[], 11 | datas=[], 12 | hiddenimports=[], 13 | hookspath=[], 14 | hooksconfig={}, 15 | runtime_hooks=[], 16 | excludes=[], 17 | win_no_prefer_redirects=False, 18 | win_private_assemblies=False, 19 | cipher=block_cipher, 20 | noarchive=False, 21 | ) 22 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 23 | 24 | exe = EXE( 25 | pyz, 26 | a.scripts, 27 | [], 28 | exclude_binaries=True, 29 | name='.', 30 | debug=False, 31 | bootloader_ignore_signals=False, 32 | strip=False, 33 | upx=True, 34 | console=True, 35 | disable_windowed_traceback=False, 36 | argv_emulation=False, 37 | target_arch=None, 38 | codesign_identity=None, 39 | entitlements_file=None, 40 | ) 41 | coll = COLLECT( 42 | exe, 43 | a.binaries, 44 | a.zipfiles, 45 | a.datas, 46 | strip=False, 47 | upx=True, 48 | upx_exclude=[], 49 | name='.', 50 | ) 51 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.analysis.extraPaths": [ 3 | "./Backend/Decryption" 4 | ] 5 | } -------------------------------------------------------------------------------- /Backend/Assets/I1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I1.png -------------------------------------------------------------------------------- /Backend/Assets/I10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I10.png -------------------------------------------------------------------------------- /Backend/Assets/I2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I2.png -------------------------------------------------------------------------------- /Backend/Assets/I3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I3.png -------------------------------------------------------------------------------- /Backend/Assets/I4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I4.png -------------------------------------------------------------------------------- /Backend/Assets/I5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I5.png -------------------------------------------------------------------------------- /Backend/Assets/I6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I6.png -------------------------------------------------------------------------------- /Backend/Assets/I7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I7.png -------------------------------------------------------------------------------- /Backend/Assets/I8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I8.png -------------------------------------------------------------------------------- /Backend/Assets/I9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Assets/I9.png -------------------------------------------------------------------------------- /Backend/Decryption/ControllerDecryption.py: -------------------------------------------------------------------------------- 1 | from Backend.Decryption.DHexaPrism import HexaPrismDecryption 2 | from Backend.Decryption.DOctaPrism import OctaPrismDecryption 3 | from Backend.Decryption.DOctahedron import OctahedronDecryption 4 | from Backend.Decryption.DPentaPrism import PentaPrismDecryption 5 | from Backend.Decryption.DPentaPyramid import PentaPyramidDecryption 6 | from Backend.Decryption.Steganography_Decryption import StegoDecryption 7 | from Backend.Encryption.progress import progress_bar,remove_progress_bar 8 | from Backend.Decryption.PrintMessage import print_error_message 9 | import time 10 | 11 | 12 | class DController: 13 | def __init__(self): 14 | self.cipher = "" 15 | self.key = "" 16 | self.zero_flag = False 17 | self.ascii = [] 18 | 19 | def main(self,data): 20 | self.cipher = data[0][2:] 21 | self.key = data[1] 22 | self.zero_flag = data[2] 23 | self.algorithm = data[0][0] 24 | self.key_type = data[0][1] 25 | self.obj = None 26 | for i in range(35,45): 27 | time.sleep(.008) 28 | progress_bar(i) 29 | self.specific_algorithm_object() 30 | for i in range(45,60): 31 | time.sleep(.008) 32 | progress_bar(i) 33 | self.extracting_ascii() 34 | for i in range(60,80): 35 | time.sleep(.008) 36 | progress_bar(i) 37 | self.s1 = self.ascii[0] 38 | self.s2 = self.ascii[1] 39 | 40 | self.plain_text_extraction() 41 | for i in range(80,95): 42 | time.sleep(.008) 43 | progress_bar(i) 44 | return 45 | 46 | def specific_algorithm_object(self): 47 | if self.algorithm == "1": 48 | self.obj = OctahedronDecryption() 49 | elif self.algorithm == "2": 50 | self.obj = HexaPrismDecryption() 51 | elif self.algorithm == "3": 52 | self.obj = PentaPrismDecryption() 53 | elif self.algorithm == "4": 54 | self.obj = OctaPrismDecryption() 55 | else: 56 | self.obj = PentaPyramidDecryption() 57 | 58 | 59 | def extracting_ascii(self): 60 | if self.key_type == "1": 61 | self.ascii = self.obj.Adecry(self.cipher,self.key) 62 | elif self.key_type == "2": 63 | self.ascii = self.obj.A2decry(self.cipher,self.key) 64 | else: 65 | self.ascii = self.obj.Hdecry(self.cipher,self.key) 66 | 67 | 68 | def plain_text_extraction(self): 69 | if self.zero_flag: 70 | self.s2 = '0' + str(self.s2) 71 | 72 | self.equivalent_ascii = str(str(self.s1) + str(self.s2)) 73 | self.message = "" 74 | num = int(0) 75 | for i in range(0, len(self.equivalent_ascii)): 76 | num = num * 10 + (ord(self.equivalent_ascii[i]) - ord('0')) 77 | if num >= 32 and num <= 122: 78 | ch = chr(num) 79 | self.message += ch 80 | num = 0 81 | 82 | def Image_steganography(self,img): 83 | progress_bar(0) 84 | imgste = StegoDecryption() 85 | text = imgste.decode(img) 86 | if not text.isprintable(): 87 | remove_progress_bar() 88 | print_error_message("Given image is not a stego-Image(file)!","Error",0) 89 | exit() 90 | for i in range(1,25): 91 | time.sleep(.008) 92 | progress_bar(i) 93 | data = text.split('.') 94 | key = data[1] 95 | zero_flag = int(key[-1]) 96 | data.remove(data[1]) 97 | data.append(key[:-1]) 98 | data.append(bool(zero_flag)) 99 | for i in range(25,35): 100 | time.sleep(.008) 101 | progress_bar(i) 102 | self.main(data) 103 | return (1,len(text),int(self.algorithm),self.message) 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /Backend/Decryption/DHexaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | 4 | class HexaPrismDecryption: 5 | def Adecry(self,cipher, key): 6 | a = int(key) 7 | c = int(cipher) 8 | a_square = (a * a) 9 | numerator = Decimal(2 * c) 10 | d = Decimal(3) 11 | denominator = Decimal(3 * d.sqrt() * a_square) 12 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 13 | ascii = str(str(key) + str(h)) 14 | return [a,h] 15 | 16 | def A2decry(self,cipher,key): 17 | a_square = int(key) 18 | c = int(cipher) 19 | numerator = Decimal(2 * c) 20 | d = Decimal(3) 21 | denominator = Decimal(3 * d.sqrt() * a_square) 22 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 23 | d = Decimal(key) 24 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 25 | ascii = str(str(a) + str(h)) 26 | return [a,h] 27 | 28 | def Hdecry(self,cipher,key): 29 | h = int(key) 30 | c = int(cipher) 31 | numerator = Decimal(2 * c) 32 | d = Decimal(3) 33 | 34 | denominator = Decimal(3 * d.sqrt() * h) 35 | a_square = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 36 | d = Decimal(a_square) 37 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 38 | ascii = str(str(a) + str(h)) 39 | return [a,h] 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Backend/Decryption/DOctaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | 4 | class OctaPrismDecryption: 5 | def Adecry(self,cipher,key): 6 | a = int(key) 7 | c = int(cipher) 8 | a_square = (a * a) 9 | const = Decimal(2 * (1 + Decimal(2).sqrt())) 10 | denominator = Decimal(const * a_square) 11 | h = Decimal(Decimal(c) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 12 | ascii = str(str(a) + str(h)) 13 | return [a,h] 14 | 15 | def A2decry(self,cipher,key): 16 | a_square = int(key) 17 | c = int(cipher) 18 | const = Decimal(2 * (1 + Decimal(2).sqrt())) 19 | denominator = Decimal(const * a_square) 20 | h = Decimal(Decimal(c) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 21 | d = Decimal(a_square) 22 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 23 | ascii = str(str(a) + str(h)) 24 | return [a,h] 25 | 26 | def Hdecry(self,cipher,key): 27 | h = int(key) 28 | c = int(cipher) 29 | const = Decimal(2 * (1 + Decimal(2).sqrt())) 30 | denominator = Decimal(const * h) 31 | a_square = Decimal(Decimal(c) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 32 | d = Decimal(a_square) 33 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 34 | ascii = str(str(a) + str(h)) 35 | return [a,h] -------------------------------------------------------------------------------- /Backend/Decryption/DOctahedron.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | 4 | class OctahedronDecryption: 5 | def Adecry(self,cipher,key): 6 | m = int(key) 7 | cipher = int(cipher) 8 | b = int(m ** 2) 9 | h1 = int(int(3) * cipher) 10 | h2 = int(b * int(2)) 11 | h = Decimal(Decimal(h1) / Decimal(h2)).quantize(Decimal(1.00),ROUND_HALF_DOWN) 12 | ascii = str(Decimal(str(key)+ str(h)).quantize(Decimal(1.00),ROUND_HALF_DOWN)) 13 | #print("Ascii newly calculated is",ascii) 14 | return [key,h] 15 | 16 | def A2decry(self,cipher,key): 17 | c = int(cipher) 18 | a_square = int(key) 19 | numerator = int(int(3) * c) 20 | denominator = int(a_square * int(2)) 21 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 22 | d = Decimal(key) 23 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 24 | ascii = str(str(a) + str(h)) 25 | return [a,h] 26 | 27 | def Hdecry(self,cipher,key): 28 | c = int(cipher) 29 | h = int(key) 30 | numerator = int(int(3) * c) 31 | denominator = int(h * int(2)) 32 | a_square = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 33 | d = Decimal(a_square) 34 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 35 | ascii = str(str(a) + str(h)) 36 | return [a,h] 37 | 38 | 39 | -------------------------------------------------------------------------------- /Backend/Decryption/DPentaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | 4 | class PentaPrismDecryption: 5 | def Adecry(self,cipher,key): 6 | a = int(key) 7 | c = int(cipher) 8 | const = Decimal(sqrt(5 * (5 + (2 * sqrt(5))))) 9 | a_square = (a * a) 10 | numerator = Decimal(4 * c) 11 | denominator = Decimal(const * a_square) 12 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 13 | ascii = str(str(a) + str(h)) 14 | return [a,h] 15 | 16 | def A2decry(self,cipher,key): 17 | a_square = int(key) 18 | c = int(cipher) 19 | const = Decimal(sqrt(5 * (5 + (2 * sqrt(5))))) 20 | numerator = Decimal(4 * c) 21 | denominator = Decimal(const * a_square) 22 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 23 | d = Decimal(key) 24 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 25 | ascii = str(str(a) + str(h)) 26 | return [a,h] 27 | 28 | def Hdecry(self,cipher,key): 29 | h = int(key) 30 | c = int(cipher) 31 | const = Decimal(sqrt(5 * (5 + (2 * sqrt(5))))) 32 | numerator = Decimal(4 * c) 33 | denominator = Decimal(const * h) 34 | a_square = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 35 | d = Decimal(a_square) 36 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 37 | ascii = str(str(a) + str(h)) 38 | return [a,h] 39 | 40 | -------------------------------------------------------------------------------- /Backend/Decryption/DPentaPyramid.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | 4 | class PentaPyramidDecryption: 5 | def Adecry(self,cipher,key): 6 | a = int(key) 7 | c = int(cipher) 8 | a_square = (a * a) 9 | degree = radians(54) 10 | tangent = tan(degree) 11 | numerator = Decimal(12 * c) 12 | denominator = Decimal(Decimal(5) * Decimal(tangent) * Decimal(a_square)) 13 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 14 | ascii = str(str(a) + str(h)) 15 | return [a,h] 16 | 17 | def A2decry(self,cipher,key): 18 | a_square = int(key) 19 | c = int(cipher) 20 | degree = radians(54) 21 | tangent = tan(degree) 22 | numerator = Decimal(12 * c) 23 | denominator = Decimal(Decimal(5) * Decimal(tangent) * Decimal(a_square)) 24 | h = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 25 | d = Decimal(a_square) 26 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 27 | ascii = str(str(a) + str(h)) 28 | return [a,h] 29 | 30 | def Hdecry(self,cipher,key): 31 | h = int(key) 32 | c = int(cipher) 33 | degree = radians(54) 34 | tangent = tan(degree) 35 | numerator = Decimal(12 * c) 36 | denominator = Decimal(Decimal(5) * Decimal(tangent) * Decimal(h)) 37 | a_square = Decimal(Decimal(numerator) / Decimal(denominator)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 38 | d = Decimal(a_square) 39 | a = Decimal(d.sqrt()).quantize(Decimal(1.00), ROUND_HALF_DOWN) 40 | ascii = str(str(a) + str(h)) 41 | return [a,h] 42 | -------------------------------------------------------------------------------- /Backend/Decryption/PrintMessage.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | import time 3 | import colorama 4 | from colorama import Fore,Style 5 | 6 | 7 | def print_error_message(msg,msg_type,delay): 8 | colorama.init(autoreset = True) 9 | current_datetime = str(datetime.now()) 10 | print(f'[{Fore.RED}{msg_type}{Fore.RESET}] {Fore.RED}{current_datetime} {Fore.RED}{Style.BRIGHT}{msg}') 11 | time.sleep(delay) 12 | return 13 | 14 | -------------------------------------------------------------------------------- /Backend/Decryption/Steganography_Decryption.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | class StegoDecryption: 3 | def __init__(self): 4 | self.data = "" 5 | 6 | def decode(self,img): 7 | image = Image.open(img, 'r') 8 | imgdata = iter(image.getdata()) 9 | while (True): 10 | pixels = [value for value in imgdata.__next__()[:3] + 11 | imgdata.__next__()[:3] + 12 | imgdata.__next__()[:3]] 13 | 14 | binstr = '' 15 | 16 | # string of binary data 17 | for i in pixels[:8]: 18 | if (i % 2 == 0): 19 | binstr += '0' 20 | else: 21 | binstr += '1' 22 | 23 | self.data += chr(int(binstr, 2)) 24 | if (pixels[-1] % 2 != 0): 25 | return self.data -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/ControllerDecryption.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/ControllerDecryption.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/DHexaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/DHexaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/DOctaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/DOctaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/DOctahedron.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/DOctahedron.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/DPentaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/DPentaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/DPentaPyramid.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/DPentaPyramid.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/PrintMessage.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/PrintMessage.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Decryption/__pycache__/Steganography_Decryption.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Decryption/__pycache__/Steganography_Decryption.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/ControllerEncryption.py: -------------------------------------------------------------------------------- 1 | import random 2 | import time 3 | from Backend.Encryption.HexaPrism import HexaPrismEncryption 4 | from Backend.Encryption.OctaPrism import OctaPrismEncryption 5 | from Backend.Encryption.Octahedron import OctahedronEncryption 6 | from Backend.Encryption.PentaPrism import PentaPrismEncryption 7 | from Backend.Encryption.PentaPyramid import PentaPyramidEncryption 8 | from Backend.Encryption.Steganography_Encryption import StegoEncryption 9 | from Backend.Encryption.progress import progress_bar 10 | 11 | class Controller: 12 | def __init__(self): 13 | 14 | self.plain_text = "" 15 | self.zero_flag = False 16 | self.cipher = "" 17 | self.s1 = "" 18 | self.s2 = "" 19 | self.equivalent_ascii = "" 20 | self.key = "" 21 | 22 | def main(self,plain_text): 23 | self.plain_text = plain_text 24 | self.n = len(self.plain_text) 25 | progress_bar(0) 26 | for i in range(0, self.n): 27 | self.each = str(ord(self.plain_text[i])) 28 | self.equivalent_ascii += self.each 29 | for i in range(1,10): 30 | time.sleep(.008) 31 | progress_bar(i) 32 | self.len_of_ascii = len(self.equivalent_ascii) 33 | self.split = self.len_of_ascii / 2 34 | for i in range(self.len_of_ascii): 35 | if i < self.split: 36 | self.s1 += self.equivalent_ascii[i] 37 | elif i >= self.split and i < self.len_of_ascii: 38 | self.s2 += self.equivalent_ascii[i] 39 | for i in range(10,25): 40 | time.sleep(.008) 41 | progress_bar(i) 42 | if self.s2[0] == '0': 43 | self.zero_flag = True 44 | for i in range(25,34): 45 | progress_bar(i) 46 | self.identification_of_algorithm() 47 | 48 | for i in range(34,50): 49 | time.sleep(.008) 50 | progress_bar(i) 51 | self.identification_of_key() 52 | for i in range(50,60): 53 | time.sleep(.008) 54 | progress_bar(i) 55 | self.cipher = str(str(self.which_algorithm) + str(self.which_key) + str(self.cipher)) 56 | for i in range(60,70): 57 | time.sleep(0.007) 58 | progress_bar(i) 59 | return (1,len(self.cipher),self.which_algorithm,self.Image_Steganography()) 60 | 61 | def identification_of_algorithm(self): 62 | self.which_algorithm = random.randint(1,5) 63 | if self.which_algorithm == 1: 64 | octa = OctahedronEncryption() 65 | self.cipher = octa.encry(self.s1,self.s2) 66 | elif self.which_algorithm == 2: 67 | hexa = HexaPrismEncryption() 68 | self.cipher = hexa.encry(self.s1,self.s2) 69 | elif self.which_algorithm == 3: 70 | penta = PentaPrismEncryption() 71 | self.cipher = penta.encry(self.s1,self.s2) 72 | elif self.which_algorithm == 4: 73 | oprism = OctaPrismEncryption() 74 | self.cipher = oprism.encry(self.s1,self.s2) 75 | elif self.which_algorithm == 5: 76 | pprism = PentaPyramidEncryption() 77 | self.cipher = pprism.encry(self.s1,self.s2) 78 | 79 | 80 | def identification_of_key(self): 81 | self.which_key = random.randint(1,3) 82 | if self.which_key == 1: 83 | self.key = str(self.s1) 84 | elif self.which_key == 2: 85 | a_square = str(int(self.s1) * int(self.s1)) 86 | self.key = str(a_square) 87 | else: 88 | self.key = str(self.s2) 89 | 90 | def Image_Steganography(self): 91 | imgste = StegoEncryption() 92 | self.cipher_text = str(str(self.cipher)+'.'+str(self.key)+str(int(self.zero_flag))) 93 | 94 | num = random.randint(1,10) 95 | path = ".\\Backend\\Assets\\" 96 | img = path+"I"+str(num)+".png" 97 | encrypted_img = imgste.encode(img,self.cipher_text) 98 | #encrypted_img.save("D:\\Sumanth\\Final year Project\\Enigma - Implementation\\output_Images\\ENCRYPTED_"+"I"+str(num)+".png") 99 | #print("ENCRYPTED_I"+str(num)) 100 | #print("Image Saved Successfully!!!") 101 | for i in range(70,85): 102 | time.sleep(.008) 103 | progress_bar(i) 104 | return encrypted_img 105 | 106 | -------------------------------------------------------------------------------- /Backend/Encryption/HexaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import sqrt 3 | getcontext().prec = 100000 4 | getcontext().rounding = ROUND_HALF_DOWN 5 | 6 | #Volume 7 | class HexaPrismEncryption: 8 | def encry(self,s1,s2): 9 | a = int(s1) 10 | h = int(s2) 11 | asquare = (a * a) 12 | d = Decimal(3) 13 | numerator = Decimal(3 * d.sqrt() * asquare * h) 14 | cipher = Decimal(Decimal(numerator) / Decimal(2)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 15 | str_cipher = str(cipher) 16 | return str_cipher 17 | 18 | -------------------------------------------------------------------------------- /Backend/Encryption/OctaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | getcontext().prec = 100000 4 | getcontext().rounding = ROUND_HALF_DOWN 5 | 6 | #Volume 7 | class OctaPrismEncryption(): 8 | def encry(self,s1,s2): 9 | a = int(s1) 10 | h = int(s2) 11 | asquare = (a * a) 12 | 13 | const = Decimal(2 * (1 + Decimal(2).sqrt())) 14 | cipher = Decimal(const * asquare * h).quantize(Decimal(1.00), ROUND_HALF_DOWN) 15 | str_cipher = str(cipher) 16 | return str_cipher 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Backend/Encryption/Octahedron.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | getcontext().prec = 100000 3 | getcontext().rounding = ROUND_HALF_DOWN 4 | 5 | class OctahedronEncryption: 6 | def encry(self,s1,s2): 7 | b1 = int(s1) 8 | h1 = int(s2) 9 | b2 = (b1 * b1) 10 | numerator = (h1 * 2 * b2) 11 | cipher = (Decimal(numerator) / Decimal(3)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 12 | 13 | print() 14 | str_cipher = str(cipher) 15 | return str_cipher 16 | -------------------------------------------------------------------------------- /Backend/Encryption/PentaPrism.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import sqrt 3 | getcontext().prec = 100000 4 | getcontext().rounding = ROUND_HALF_DOWN 5 | 6 | #Volume 7 | class PentaPrismEncryption: 8 | def encry(self,s1 , s2): 9 | a = int(s1) 10 | h = int(s2) 11 | asquare = (a * a) 12 | const = Decimal(sqrt(5 * (5 + (2 * sqrt(5))))) 13 | numerator = Decimal(const * asquare * h) 14 | cipher = Decimal(Decimal(numerator) / Decimal(4)).quantize(Decimal(1.00), ROUND_HALF_DOWN) 15 | str_cipher = str(cipher) 16 | return str_cipher 17 | -------------------------------------------------------------------------------- /Backend/Encryption/PentaPyramid.py: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | from math import * 3 | getcontext().prec = 100000 4 | getcontext().rounding = ROUND_HALF_DOWN 5 | 6 | class PentaPyramidEncryption: 7 | def encry(self,s1,s2): 8 | a = int(s1) 9 | h = int(s2) 10 | asquare = (a * a) 11 | degree = radians(54) 12 | tangent = tan(degree) 13 | const = Decimal((Decimal(5) / Decimal(12)) * Decimal(tangent)) 14 | cipher = Decimal(const * asquare * h).quantize(Decimal(1.00), ROUND_HALF_DOWN) 15 | str_cipher = str(cipher) 16 | return str_cipher 17 | -------------------------------------------------------------------------------- /Backend/Encryption/Steganography_Encryption.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | import os 3 | class StegoEncryption: 4 | def __init__(self): 5 | self.data = "" 6 | 7 | def encode(self,img,data): 8 | self.data = data 9 | self.image = Image.open(img, 'r') 10 | self.newimg = self.image.copy() 11 | self.encode_enc() 12 | return self.newimg 13 | # new_img_name = input("Enter the name of new image(with extension) : ") 14 | # newimg.save(new_img_name, str(new_img_name.split(".")[1].upper())) 15 | # print("Image saved!") 16 | 17 | def encode_enc(self): 18 | w = self.newimg.size[0] # w is width 19 | (x, y) = (0, 0) 20 | for pixel in self.modPix(): 21 | # Putting modified pixels in the new image 22 | self.newimg.putpixel((x, y), pixel) 23 | if (x == w - 1): 24 | x = 0 25 | y += 1 26 | else: 27 | x += 1 28 | 29 | def modPix(self): 30 | datalist = self.genData() 31 | lendata = len(datalist) 32 | imdata = iter(self.newimg.getdata()) 33 | for i in range(lendata): 34 | # Extracting 3 pixels at a time 35 | pix = [value for value in imdata.__next__()[:3] + 36 | imdata.__next__()[:3] + 37 | imdata.__next__()[:3]] 38 | 39 | # Pixel value should be made 40 | # odd for 1 and even for 0 41 | for j in range(0, 8): 42 | if (datalist[i][j] == '0' and pix[j] % 2 != 0): 43 | pix[j] -= 1 44 | 45 | elif (datalist[i][j] == '1' and pix[j] % 2 == 0): 46 | if (pix[j] != 0): 47 | pix[j] -= 1 48 | else: 49 | pix[j] += 1 50 | # pix[j] -= 1 51 | # Eighth pixel of every set tells 52 | # whether to stop or read further. 53 | # 0 means keep reading; 1 means the 54 | # message is over. 55 | if (i == lendata - 1): 56 | if (pix[-1] % 2 == 0): 57 | if (pix[-1] != 0): 58 | pix[-1] -= 1 59 | else: 60 | pix[-1] += 1 61 | else: 62 | if (pix[-1] % 2 != 0): 63 | pix[-1] -= 1 64 | 65 | pix = tuple(pix) 66 | yield pix[0:3] 67 | yield pix[3:6] 68 | yield pix[6:9] 69 | 70 | 71 | # Convert encoding data into 8-bit binary 72 | # form using ASCII value of characters 73 | 74 | def genData(self): 75 | # list of binary codes 76 | # of given data 77 | newd = [] 78 | for i in self.data: 79 | newd.append(format(ord(i), '08b')) 80 | return newd 81 | -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/ControllerEncryption.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/ControllerEncryption.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/HexaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/HexaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/OctaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/OctaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/Octahedron.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/Octahedron.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/PentaPrism.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/PentaPrism.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/PentaPyramid.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/PentaPyramid.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/Steganography_Encryption.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/Steganography_Encryption.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/__pycache__/progress.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/Encryption/__pycache__/progress.cpython-310.pyc -------------------------------------------------------------------------------- /Backend/Encryption/progress.py: -------------------------------------------------------------------------------- 1 | import math 2 | import colorama,sys 3 | from matplotlib.colorbar import Colorbar 4 | 5 | def progress_bar(progress, color = colorama.Fore.YELLOW): 6 | percent = 100*(progress/float(100)) 7 | if progress == 0: 8 | color = colorama.Fore.RED 9 | bar = '▌' * int(percent) + '-' * (100 - int(percent)) 10 | print(color + f"\r |{bar}| {percent:.2f}%",end = "") 11 | 12 | if progress == 100: 13 | print(colorama.Fore.GREEN + f"\r |{bar}| {percent:.2f}%",end = "") 14 | print(colorama.Fore.RESET) 15 | def remove_progress_bar(): 16 | print("") 17 | print(colorama.Fore.RESET) 18 | return 19 | -------------------------------------------------------------------------------- /Backend/MainController.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from py import process 4 | from Backend.Decryption.ControllerDecryption import DController 5 | from Backend.Encryption import ControllerEncryption 6 | from Backend.Encryption.progress import progress_bar 7 | import os 8 | import time 9 | from time import process_time 10 | 11 | def encryption(plain_text): 12 | encry = ControllerEncryption.Controller() 13 | en_start = process_time() 14 | status,cipher_length,which_algorithm,image = encry.main(plain_text) 15 | en_stop = process_time() 16 | if status != 1: 17 | return ("fail",None,None,None) 18 | else: 19 | for i in range(85,101): 20 | time.sleep(.008) 21 | progress_bar(i) 22 | print() 23 | elapsed_time = en_stop - en_start 24 | return ("success",cipher_length,which_algorithm,image,elapsed_time) 25 | 26 | def decryption(path): 27 | decry = DController() 28 | de_start = process_time() 29 | status,cipher_length,which_algorithm,message = decry.Image_steganography(path) 30 | de_stop = process_time() 31 | elapsed_time = de_stop - de_start 32 | if status != 1: 33 | return("fail",None,None,None) 34 | else: 35 | for i in range(95,101): 36 | time.sleep(.008) 37 | progress_bar(i) 38 | print() 39 | return ("success",cipher_length,which_algorithm,message,elapsed_time) 40 | 41 | -------------------------------------------------------------------------------- /Backend/__pycache__/MainController.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Backend/__pycache__/MainController.cpython-310.pyc -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Images and figures/Comparision of Histogram.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Images and figures/Comparision of Histogram.PNG -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Images and figures/Flowchart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Images and figures/Flowchart.jpg -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Images and figures/Input and output image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Images and figures/Input and output image.png -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Images and figures/Output Analysis Before Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Images and figures/Output Analysis Before Image.png -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Images and figures/Output Analysis after image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Images and figures/Output Analysis after image.png -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Reference papers/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Reference papers/1.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Reference papers/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Reference papers/2.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Reference papers/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Reference papers/3.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Reference papers/4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Reference papers/4.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Reference papers/5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Reference papers/5.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Rejected Journal Paper/ENIGMA - manuscript draft.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Rejected Journal Paper/ENIGMA - manuscript draft.doc -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/Rejected Journal Paper/Enigma - first journal paper (rejected).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/Rejected Journal Paper/Enigma - first journal paper (rejected).pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/reference for 3D Pythocrypt/3-D Pythocrypt with AES and Chitra kavya.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/reference for 3D Pythocrypt/3-D Pythocrypt with AES and Chitra kavya.docx -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/reference for 3D Pythocrypt/3-D Pythocrypt with AES and Chitra kavya.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/reference for 3D Pythocrypt/3-D Pythocrypt with AES and Chitra kavya.pdf -------------------------------------------------------------------------------- /Documents/Final Documents for Paper/reference for 3D Pythocrypt/enc and dec formulas.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Final Documents for Paper/reference for 3D Pythocrypt/enc and dec formulas.xlsx -------------------------------------------------------------------------------- /Documents/Poster and Comics/Enigma - Comics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Poster and Comics/Enigma - Comics.pdf -------------------------------------------------------------------------------- /Documents/Poster and Comics/Enigma poster.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Poster and Comics/Enigma poster.pdf -------------------------------------------------------------------------------- /Documents/Project report/Content (Project).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Project report/Content (Project).pdf -------------------------------------------------------------------------------- /Documents/Project report/Front Sheets (Project).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Project report/Front Sheets (Project).pdf -------------------------------------------------------------------------------- /Documents/Published Research paper/Research paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Documents/Published Research paper/Research paper.pdf -------------------------------------------------------------------------------- /Enigma.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.1 2 | Name: Enigma 3 | Version: 0.1.0 4 | Summary: UNKNOWN 5 | Home-page: UNKNOWN 6 | License: UNKNOWN 7 | Platform: UNKNOWN 8 | 9 | UNKNOWN 10 | 11 | -------------------------------------------------------------------------------- /Enigma.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | setup.py 2 | Enigma.egg-info/PKG-INFO 3 | Enigma.egg-info/SOURCES.txt 4 | Enigma.egg-info/dependency_links.txt 5 | Enigma.egg-info/entry_points.txt 6 | Enigma.egg-info/requires.txt 7 | Enigma.egg-info/top_level.txt -------------------------------------------------------------------------------- /Enigma.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Enigma.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | 2 | [console_scripts] 3 | enigma=Enigma:Enigma 4 | -------------------------------------------------------------------------------- /Enigma.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | click 2 | pyInquirer 3 | pywin32 4 | rich == 12.4.4 5 | -------------------------------------------------------------------------------- /Enigma.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Enigma.py: -------------------------------------------------------------------------------- 1 | import click 2 | import os 3 | from colorama import Fore,Style 4 | import sys 5 | import time 6 | import os.path 7 | from os import close, listdir 8 | from datetime import datetime 9 | from os.path import isfile, join 10 | from cli_functions import * 11 | 12 | global prompt 13 | cli_cmd_list = [ ['set prompt', 'f_set_prompt' ], 14 | ['show files', 'f_show_files' ], 15 | ['show dirs', 'f_show_dirs' ], 16 | ['show date', 'f_show_date' ], 17 | ['encrypt', 'f_encrypt', ], 18 | ['--version', 'f_version' ], 19 | ['-V', 'f_version' ], 20 | ['enigma', 'f_version' ], 21 | ['decrypt', 'f_decrypt' ], 22 | ['--help', 'f_help' ], 23 | ['-h', 'f_help' ], 24 | ['--info', 'f_more_info' ] 25 | ] 26 | 27 | 28 | def opening_print(): 29 | ''' first function to be loaded and displayed''' 30 | colorama.init(autoreset = True) 31 | current_datetime = str(datetime.now()) 32 | print() 33 | print(f'[{Fore.BLUE}INFO{Fore.RESET}] {current_datetime}{Style.BRIGHT} Starting Enigma v0.1.0 2022..',end = '',flush=True) 34 | time.sleep(1) 35 | print('.', end = "",flush=True) 36 | time.sleep(1) 37 | print(".",end="",flush=True) 38 | time.sleep(1) 39 | print(".") 40 | 41 | 42 | @click.command() 43 | def Enigma(): 44 | ''' 45 | Entry point for the interface (main) function 46 | ''' 47 | opening_print() 48 | time.sleep(0.4) 49 | os.system('type banner.txt') 50 | os.system('echo.') 51 | 52 | beInLoop = True 53 | global prompt 54 | prompt = 'enigma' 55 | dollor_arrow = ' $>' 56 | while beInLoop: 57 | try: 58 | cli_input = input(prompt+dollor_arrow+' ') 59 | if cli_input == 'exit': 60 | print_message('Exiting....',"INFO", 0.4) 61 | sys.exit() 62 | 63 | isValid, func = isValidCmd(cli_input) 64 | 65 | if isValid: 66 | str_to_class(func)() 67 | else: 68 | os.system(cli_input) 69 | except KeyboardInterrupt: 70 | print() 71 | print_message("Exiting... ","INFO", 0.4) 72 | sys.exit() 73 | 74 | def isValidCmd(entered_cmd): 75 | ''' Check whether command is valid or not''' 76 | for c in cli_cmd_list: 77 | e_cmd = "".join(entered_cmd.split()) 78 | v_cmd = "".join(str(c[0]).split()) 79 | if e_cmd == v_cmd: 80 | return True, str(c[1]) 81 | return False, entered_cmd 82 | 83 | def str_to_class(classname): 84 | return getattr(sys.modules[__name__], classname) 85 | 86 | def f_set_prompt(): 87 | ''' 88 | Customize the prompt text, accepts 0 arguments 89 | ''' 90 | global prompt 91 | print_message('Prompting for new prompt.',"INFO", 0.5) 92 | prompt = input('Enter new prompt : ') 93 | 94 | -------------------------------------------------------------------------------- /Enigma.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | block_cipher = None 5 | 6 | 7 | a = Analysis( 8 | ['Enigma.py'], 9 | pathex=[], 10 | binaries=[], 11 | datas=[], 12 | hiddenimports=[], 13 | hookspath=[], 14 | hooksconfig={}, 15 | runtime_hooks=[], 16 | excludes=[], 17 | win_no_prefer_redirects=False, 18 | win_private_assemblies=False, 19 | cipher=block_cipher, 20 | noarchive=False, 21 | ) 22 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 23 | 24 | exe = EXE( 25 | pyz, 26 | a.scripts, 27 | [], 28 | exclude_binaries=True, 29 | name='Enigma', 30 | debug=False, 31 | bootloader_ignore_signals=False, 32 | strip=False, 33 | upx=True, 34 | console=True, 35 | disable_windowed_traceback=False, 36 | argv_emulation=False, 37 | target_arch=None, 38 | codesign_identity=None, 39 | entitlements_file=None, 40 | ) 41 | coll = COLLECT( 42 | exe, 43 | a.binaries, 44 | a.zipfiles, 45 | a.datas, 46 | strip=False, 47 | upx=True, 48 | upx_exclude=[], 49 | name='Enigma', 50 | ) 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Enigma - A Tool For Cybersecurity 3 | 4 | - This is a cryptography project. We designed and developed the new cryptographic algorithm called 3D Pythocypt algorithm. This is a young technique where key is used only at the decryption phase. 5 | - The ideology of 3D Pythocrypt is to encrypt the plain text using the properties of 3D geometric shapes. 6 | - We have considered volumetric formula of five different geometric shapes in this project. 7 | - To securely transmit the cipher text obtained from the 3D pythocrypt algorithm, the cipher text is hidden inside the pixels of the image using LSB algorithm in Image Steganography. 8 | 9 | 10 | 11 | ## Why Enigma? 12 | 13 | - Although there are many Symmetric and Asymmetric Cryptographic systems available, a new cryptgraphic system is necessary in this social world. 14 | - If we want to transmit huge amount of data from sender to receiver, then we can use Enigma as a stand alone application or as an api. 15 | - The estimated amount of data that the algorithm takes as an input at a given time is around 2^(2147483647) that is approximately 646456993 characters. 16 | - Subsequently, as we have used five different shapes, there are three possible key values for each shape. Hence, there are 15 possible combinations that can be achieved. This makes the algorithm more secure. 17 | - Eventhough the operations to be performed are more, the time complexity of the 3D Pythocrypt algorithm is efficient than most of the current cryptosystems. 18 | 19 | ## Tech Stack 20 | 21 | - Programming Language: 22 | - Python 23 | - Click 24 | - pyInquirer 25 | - rich 26 | - Colorama and other inbuilt python libraries 27 | 28 | 29 | ## Authors 30 | 31 | - [@Sumanth N](https://github.com/n-sumanth-bhat) 32 | - [@Shrinidhi Holla](https://github.com/Shrinidhi-Holla) 33 | - [@Prajwal VS](https://github.com/Prajwal-Shridhar) 34 | 35 | 36 | ## How to Execute? 37 | 38 | - Download the zip file to a directory and unzip the same or clone the repository 39 | - Walk through the folder structure till you find "Enigma.py" file 40 | - Open the directory in the command prompt 41 | - Give "enigma" command to launch the application. 42 | - If you face any error, then install the following packages 43 | - pip install click 44 | - pip install pyInquirer 45 | - pip install rich 46 | 47 | 48 | ## Features 49 | 50 | - CLI Interface 51 | - Custom Progress Bar 52 | - Implementing Custom Commands 53 | - Cross platform 54 | 55 | 56 | ## API Reference 57 | 58 | - [Click](https://click.palletsprojects.com/en/8.1.x/) 59 | - [Colorama](https://pypi.org/project/colorama/) 60 | - [Rich](https://rich.readthedocs.io/en/stable/introduction.html) 61 | 62 | ## Screenshots 63 | 64 | - Downloading the Project 65 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/Downloading%20the%20Project.PNG) 66 | 67 | - Launching the Application 68 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/Launching%20the%20application.PNG) 69 | 70 | - Help (--help) command 71 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/help%20command.PNG) 72 | 73 | - encrypt command 74 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/encrypt%20command.PNG) 75 | 76 | - decrypt command 77 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/decrypt%20command.PNG) 78 | 79 | - performance stats 80 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/info%20about%20previous%20operation.PNG) 81 | 82 | - Error 83 | ![App Screenshot](https://github.com/n-sumanth-bhat/Final-Year-Project/blob/main/Screenshots/not%20a%20stego%20image.PNG) 84 | 85 | 86 | ## Acknowledgements 87 | 88 | We would like to thank and dedicate this project to all the instructors who are in various platform guiding and helping the students to achieve their goal. 89 | 90 | 91 | 92 | ## Future Work 93 | 94 | - The present version takes the raw plaintext from the command line, an option can be provided for the user to input the plaintext from a .txt file 95 | - Furthermore, the application can be made robust which can encrypt any file formats such as .pdf, .doc, .xls etc. 96 | 97 | ## Feedback 98 | 99 | If you have any feedback or queries, please reach out to 100 | - [Sumanth N](mailto:nsumanthbhat@gmail.com) 101 | 102 | -------------------------------------------------------------------------------- /Screenshots/Downloading the Project.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/Downloading the Project.PNG -------------------------------------------------------------------------------- /Screenshots/Launching the application.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/Launching the application.PNG -------------------------------------------------------------------------------- /Screenshots/decrypt command.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/decrypt command.PNG -------------------------------------------------------------------------------- /Screenshots/encrypt command.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/encrypt command.PNG -------------------------------------------------------------------------------- /Screenshots/help command.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/help command.PNG -------------------------------------------------------------------------------- /Screenshots/info about previous operation.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/info about previous operation.PNG -------------------------------------------------------------------------------- /Screenshots/not a stego image.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/Screenshots/not a stego image.PNG -------------------------------------------------------------------------------- /__pycache__/Enigma.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/__pycache__/Enigma.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/cli_functions.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n-sumanth-bhat/Final-Year-Project/06ad433b314f85c67c4864f342bf25ee8604bc84/__pycache__/cli_functions.cpython-310.pyc -------------------------------------------------------------------------------- /banner.txt: -------------------------------------------------------------------------------- 1 | _______ _____ ___ __ _______ ___ ___ __ 2 | /" "| (\" \|" \ |" \ /" _ "| |" \ /" | /""\ 3 | (: ______) |.\\ \ | || | (: ( \___) \ \ // | / \ 4 | \/ | |: \. \\ | |: | \/ \ /\\ \/. | /' /\ \ 5 | // ___)_ |. \ \. | |. | // \ ___ |: \. | // __' \ 6 | (: "| | \ \ | /\ |\ (: _( _| |. \ /: | / / \\ \ 7 | \_______) \___|\____\) (__\_|_) \_______) |___|\__/|___|(___/ \___) 8 | 9 | -------------------------------------------------------------------------------- /banner.txt.bak: -------------------------------------------------------------------------------- 1 | _______ _____ ___ __ _______ ___ ___ __ 2 | /" "| (\" \|" \ |" \ /" _ "| |" \ /" | /""\ 3 | (: ______) |.\\ \ | || | (: ( \___) \ \ // | / \ 4 | \/ | |: \. \\ | |: | \/ \ /\\ \/. | /' /\ \ 5 | // ___)_ |. \ \. | |. | // \ ___ |: \. | // __' \ 6 | (: "| | \ \ | /\ |\ (: _( _| |. \ /: | / / \\ \ 7 | \_______) \___|\____\) (__\_|_) \_______) |___|\__/|___|(___/ \___) -------------------------------------------------------------------------------- /cli_functions.py: -------------------------------------------------------------------------------- 1 | import os 2 | from os import path 3 | import time 4 | from datetime import datetime 5 | from colorama import Fore,Style 6 | import colorama 7 | from numpy import double 8 | from Backend.MainController import encryption 9 | from Backend.MainController import decryption 10 | from rich.table import Table 11 | from rich.console import Console 12 | 13 | status = "" 14 | input_length = 0 15 | cipher_length = 0 16 | which_algo = -1 17 | process_type = "" 18 | elapsed_time = double(0.0) 19 | 20 | def f_help(): 21 | '''Displays the help message''' 22 | print(f""" 23 | {Fore.LIGHTMAGENTA_EX}-V, --version{Fore.RESET} {Style.DIM}print the current version 24 | {Fore.LIGHTMAGENTA_EX} encrypt{Fore.RESET} {Style.DIM}initiate the encryption phase 25 | {Fore.LIGHTMAGENTA_EX} decrypt{Fore.RESET} {Style.DIM}initiate the decryption phase 26 | {Fore.LIGHTMAGENTA_EX} set prompt{Fore.RESET} {Style.DIM}customize the prompt text 27 | {Fore.LIGHTMAGENTA_EX} show files{Fore.RESET} {Style.DIM}displays a list of files in PWD 28 | {Fore.LIGHTMAGENTA_EX} show dirs{Fore.RESET} {Style.DIM}displays a list of directories in PWD 29 | {Fore.LIGHTMAGENTA_EX} show date{Fore.RESET} {Style.DIM}displays Current date&time 30 | {Fore.LIGHTMAGENTA_EX} enigma{Fore.RESET} {Style.DIM}print the current version 31 | {Fore.LIGHTMAGENTA_EX}-h, --help{Fore.RESET} {Style.DIM}print this message. 32 | 33 | """) 34 | 35 | def print_message(msg, msg_type,delay): 36 | '''General function to print info, Warning and error messages''' 37 | colorama.init(autoreset = True) 38 | msg_type.upper() 39 | current_datetime = str(datetime.now()) 40 | 41 | if msg_type == "INFO": 42 | print(f'[{Fore.BLUE}{msg_type}{Fore.RESET}] {current_datetime} {Style.BRIGHT}{msg}') 43 | time.sleep(delay) 44 | elif msg_type == "WARNING": 45 | print(f'[{Fore.YELLOW}{msg_type}{Fore.RESET}] {Fore.YELLOW}{current_datetime} {Fore.YELLOW}{Style.BRIGHT}{msg}') 46 | time.sleep(delay) 47 | elif msg_type == "ERROR": 48 | print(f'[{Fore.RED}{msg_type}{Fore.RESET}] {Fore.RED}{current_datetime} {Fore.RED}{Style.BRIGHT}{msg}') 49 | time.sleep(delay) 50 | elif msg_type == "SUCCESS": 51 | msgtype = "INFO" 52 | print(f'[{Fore.BLUE}{msgtype}{Fore.RESET}]{Fore.RESET}--------------------------------------------------------------------------------------------------') 53 | print(f'[{Fore.BLUE}{msgtype}{Fore.RESET}] {Fore.GREEN}{current_datetime} {Fore.GREEN}{Style.BRIGHT}{msg}') 54 | print(f'[{Fore.BLUE}{msgtype}{Fore.RESET}]{Fore.RESET}--------------------------------------------------------------------------------------------------') 55 | 56 | time.sleep(delay) 57 | 58 | 59 | def f_show_dirs(): 60 | '''to show directories in pwd''' 61 | print_message('Showing only directories',"INFO", 0.5) 62 | os.system('dir /ad') 63 | 64 | def f_show_files(): 65 | '''To show files in pwd''' 66 | print_message('Showing only files',"INFO", 0.5) 67 | os.system('dir /b /a-d') 68 | 69 | def f_show_date(): 70 | '''Shows current date and time''' 71 | print_message('Showing current date and time',"INFO", 0.5) 72 | os.system('date /T') 73 | os.system('time /T') 74 | 75 | def f_version(): 76 | '''Prints the version''' 77 | print('v0.1.0') 78 | 79 | def f_encrypt(): 80 | '''Encrypt the given plain text, embed the cipher text inside the image and store it in a given location''' 81 | print_message("Preparing setup...","INFO",0.5) 82 | print_message("Press enter key to submit the input","INFO",0.5) 83 | global plain_text 84 | print("Your Plain text:") 85 | plain_text = str(input(f'{Fore.LIGHTCYAN_EX}')) 86 | if len(plain_text) == 0: 87 | print_message("Provide Valid Input..!","WARNING",0.5) 88 | return 89 | 90 | global input_length 91 | input_length = len(plain_text) 92 | global cipher_length 93 | global which_algo 94 | global process_type 95 | global elapsed_time 96 | global status 97 | process_type = "Encryption" 98 | print() 99 | status,cipher_length,which_algo,image,elapsed_time = encryption(plain_text) 100 | if status != "success": 101 | print_message("Unexpected error occurred!","ERROR",0) 102 | return 103 | print("Path to store the result:") 104 | res_path = str(input()) 105 | print() 106 | if path.exists(res_path): 107 | if not path.isfile(res_path): 108 | print("Do you want to change the default name?[y/n]") 109 | choice = str(input()) 110 | if choice == 'y' or choice == "Y" or choice == "Yes" or choice == "yes": 111 | print("Input the file name:") 112 | saveas = str(input()) 113 | isdone = save_image(image,res_path,saveas) 114 | if isdone[0] == 1: 115 | 116 | print_message(f"Image Successfully saved at {isdone[1]}!","SUCCESS",0.4) 117 | elif choice == 'n' or choice == 'N' or choice == 'No' or choice == 'no': 118 | saveas = 'enigma_' + str(datetime.now().strftime("%Y%m%d_%H%M%S")) 119 | isdone = save_image(image = image,path=res_path,filename=saveas) 120 | if isdone[0] == 1: 121 | print_message(f"Image Successfully saved at {isdone[1]}!","SUCCESS",0.4) 122 | else: 123 | print_message(f"Oops! Something went wrong, Please try again","ERROR",0.5) 124 | else: 125 | print_message("Invalid choice","ERROR",0) 126 | return 127 | else: 128 | print_message("Should be a directory, received file!","ERROR",0) 129 | return 130 | else: 131 | print_message("Location not found, please provide valid path!","ERROR",0) 132 | return 133 | 134 | 135 | def save_image(image,path,filename): 136 | 137 | console = Console() 138 | with console.status("[bold green]Saving...") as status: 139 | loc = path+"/"+filename+".png" 140 | image.save(loc) 141 | return [1,loc] 142 | 143 | 144 | def f_decrypt(): 145 | '''Decrypt the given imaage, and extract the plain text from the cipher text''' 146 | global status 147 | global cipher_length 148 | global which_algo 149 | global elapsed_time 150 | global process_type 151 | process_type = "Decryption" 152 | 153 | print_message("Preparing setup...","INFO",0.5) 154 | print("Input the path of the Image(stego-image):") 155 | inp_path = str(input()) 156 | print() 157 | if path.exists(inp_path): 158 | if path.isfile(inp_path): 159 | if not inp_path.lower().endswith('.png'): 160 | print_message("Please provide .png file only..!","ERROR",0) 161 | print_message("Other formats will be available soon..!","INFO",0.5) 162 | return 163 | else: 164 | status,cipher_length,which_algo,message,elapsed_time= decryption(inp_path) 165 | if status != "success": 166 | print_message("Unexpected error occurred!","ERROR",0) 167 | return 168 | print("Do you want to write plain text to a .txt file?[y/n]") 169 | choice = str(input()) 170 | if choice == 'y' or choice == "Y" or choice == "Yes" or choice == "yes": 171 | print("Where do yo want to store the file?") 172 | file_path = str(input()) 173 | if path.exists(file_path): 174 | if path.isfile(file_path): 175 | if not file_path.lower().endswith('.txt'): 176 | print_message("File format not satisfied, expected .txt format!","ERROR",0) 177 | return 178 | else: 179 | with open(file_path,'w') as f: 180 | f.write(message) 181 | print_message("Successfully copied plain text to the file!","SUCCESS",0.5) 182 | elif path.isdir(file_path): 183 | print("File name:") 184 | file_name = str(input()) 185 | f = open(file_path+"\\"+file_name+".txt", "w+") 186 | f.write(message) 187 | f.close() 188 | print_message("Successfully created and copied plain text to the file!","SUCCESS",0.5) 189 | else: 190 | print_message("Path is neither directory nor a file, expected any one!","ERROR",0) 191 | return 192 | else: 193 | print_message("Path not found!","ERROR",0) 194 | return 195 | elif choice == 'n' or choice == "N" or choice == "No" or choice == "no": 196 | print_message("Plain text retrieved Successfully!","SUCCESS",0.5) 197 | print("Original Message is:") 198 | print(f'{Fore.LIGHTMAGENTA_EX}{message}') 199 | print() 200 | else: 201 | print_message("Invalid choice","ERROR",0) 202 | return 203 | 204 | else: 205 | print_message("Should be a file, received directory!","ERROR",0.2) 206 | return 207 | 208 | else: 209 | print_message("Path not found, please provide valid path!","ERROR",0) 210 | return 211 | 212 | def f_more_info(): 213 | ''' Displays the performance aspects like elapsed time, plain_text length, cipher_text length etc.''' 214 | 215 | shape = "" 216 | global which_algo 217 | global status 218 | global cipher_length 219 | global input_length 220 | global elapsed_time 221 | global process_type 222 | console = Console() 223 | if which_algo == 1: 224 | shape = "Octahedron" 225 | elif which_algo == 2: 226 | shape = "Hexagonal prism" 227 | elif which_algo == 3: 228 | shape = "Pentagonal Prism" 229 | elif which_algo == 4: 230 | shape = "Octagonal Prism" 231 | elif which_algo == 5: 232 | shape = "Pentagonal Pyramid" 233 | if status != "": 234 | table = Table(show_header=True, header_style="bold blue") 235 | table.add_column("#", style="dim",width=6) 236 | table.add_column("Property",min_width=40) 237 | table.add_column("Value",min_width=30) 238 | 239 | if process_type == "Encryption": 240 | table.add_row("1","Process type",str(process_type)) 241 | table.add_row("2","Plain text length",str(input_length)) 242 | table.add_row("3","Cipher text length",str(cipher_length)) 243 | table.add_row("4","Shape used",str(shape)) 244 | table.add_row("5","Elapsed Time",str(str(elapsed_time)+' sec')) 245 | table.add_row("6","Status","Completed") 246 | elif process_type == "Decryption": 247 | table.add_row("1","Process type",str(process_type)) 248 | table.add_row("2","Cipher text length",str(cipher_length)) 249 | table.add_row("3","Shape used",str(shape)) 250 | table.add_row("4","Elapsed Time",str(str(elapsed_time)+' sec')) 251 | table.add_row("5","Status","Completed") 252 | else: 253 | table.add_row("-","No data to display","-") 254 | console.print(table) 255 | print_message("Status is invalid!","Warning",0) 256 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name = 'Enigma', 5 | version = '0.1.0', 6 | packages = find_packages(), 7 | install_requires = [ 8 | 'click', 9 | 'pyInquirer', 10 | 'pywin32', 11 | 'rich', 12 | 'colorama' 13 | ], 14 | entry_points = ''' 15 | [console_scripts] 16 | enigma=Enigma:Enigma 17 | ''' 18 | ) --------------------------------------------------------------------------------