Skip to content

Commit f02f5e6

Browse files
committed
added features
1 parent 9454ea5 commit f02f5e6

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

caesar_cipher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Caeser Cipher Encryption and Decryption Tool
22

3+
from colorama.ansi import Fore
34
from extras import decor
45
import time
56
from option_validator import options
67
from redo import redo
8+
from colours import print_with_color
79

10+
time.sleep(1)
811
@decor
912
def display():
10-
print(" CAESAR CIPHER ALGORITHM")
13+
print_with_color(" CAESAR CIPHER ALGORITHM", color=Fore.BLUE)
1114

1215
display()
1316

caesar_decryption.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Decryption algorithm
2+
from colorama.ansi import Fore
3+
from colours import print_with_color
24
import time
35
from extras import decor
46

57
@decor
68
def intro():
79
time.sleep(1)
8-
print(" Welcome To Caesar Cipher Decryptor")
10+
print_with_color(" Welcome To Caesar Cipher Decryptor", color=Fore.GREEN)
911

1012
def note():
1113
print()
12-
print("NOTE: YOU ALWAYS NEED TO HAVE THE SAME KEY USED TO ENCRYPT THE TEXT!")
14+
print_with_color("NOTE: YOU ALWAYS NEED TO HAVE THE SAME KEY USED TO ENCRYPT THE TEXT!", color=Fore.RED)
1315

1416
def caesar_decryption(ciphertext, key):
1517
decrypted_str = ""

caesar_encryption.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Encryption algorithm
2+
from colorama.ansi import Fore
3+
from colours import print_with_color
24
import time
35
from extras import decor
46

57
@decor
68
def intro():
79
time.sleep(1)
8-
print(" Welcome To Caesar Cipher Encryptor")
10+
print_with_color(" Welcome To Caesar Cipher Encryptor", color=Fore.GREEN)
911

1012
def note():
1113
print()
12-
print("NOTE: ALWAYS REMEMBER TO KEEP THE KEY SECURE! YOU NEED THE SAME KEY TO DECRYPT THE TEXT!")
14+
print_with_color("NOTE: ALWAYS REMEMBER TO KEEP THE KEY SECURE! YOU NEED THE SAME KEY TO DECRYPT THE TEXT!", color=Fore.RED)
1315

1416
def caesar_encryption(plaintext, key):
1517
encrypted_str = ""

extras.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
from colorama.ansi import Fore
2+
from colours import print_with_color
13
import sys
24
import time
35
from os import system, name
46

57
def decor(func):
68
def wrap():
7-
print("[=======================================]")
9+
print_with_color("[=======================================]", color=Fore.CYAN)
810
func()
9-
print("[=======================================]")
11+
print_with_color("[=======================================]", color=Fore.CYAN)
1012
return wrap
1113

1214
def load_a():

redo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
from colorama.ansi import Fore, Style
2+
from colours import print_with_color
13
import time
24
from option_validator import options
35
from extras import clear
46

57
def redo():
68
clear()
7-
print('*******************************')
9+
print_with_color('*******************************', color=Fore.BLUE, brightness=Style.BRIGHT)
810
print('What would you like to do next?')
911
time.sleep(1)
1012
print('\n1. Encrypt another')

0 commit comments

Comments
 (0)