From 43b0dd264e9dfe263d20e03fdc0181a29de7e031 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:22:44 +0000 Subject: [PATCH 1/8] Update app.py Added some comments --- Codes/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Codes/app.py b/Codes/app.py index 6c320bd..d86934d 100644 --- a/Codes/app.py +++ b/Codes/app.py @@ -1,7 +1,8 @@ # Author - Mmabiaa # app.py -import getpass +import getpass +# import other module associated to this file. from password_manager import * # Function to print in green From 20cb700924c61b00b541421e157bf158345c2ebc Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:28:42 +0000 Subject: [PATCH 2/8] Update green.py --- Codes/green.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 Codes/green.py diff --git a/Codes/green.py b/Codes/green.py new file mode 100644 index 0000000..626a09c --- /dev/null +++ b/Codes/green.py @@ -0,0 +1 @@ +# a module for green output color \ No newline at end of file From 5ca5e5150e0a019271cd6cb9e3b01cbc1107bcc8 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:29:15 +0000 Subject: [PATCH 3/8] Update app.py --- Codes/app.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Codes/app.py b/Codes/app.py index d86934d..e7a0c2f 100644 --- a/Codes/app.py +++ b/Codes/app.py @@ -5,9 +5,6 @@ # import other module associated to this file. from password_manager import * -# Function to print in green -def print_green(text): - print("\033[32m" + text + "\033[0m") def check_user_choice(choice): if choice == '1': From ad368e8492755a1ebfc5b48eda815ee38b98447e Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:29:54 +0000 Subject: [PATCH 4/8] Update green.py --- Codes/green.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Codes/green.py b/Codes/green.py index 626a09c..58d36c5 100644 --- a/Codes/green.py +++ b/Codes/green.py @@ -1 +1,5 @@ -# a module for green output color \ No newline at end of file +# a module for green output color + +# Function to print in green +def print_green(text): + print("\033[32m" + text + "\033[0m") \ No newline at end of file From fb0cf55aeb1f48564ce6a646dbc8c146c39e7312 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:30:40 +0000 Subject: [PATCH 5/8] Update app.py --- Codes/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Codes/app.py b/Codes/app.py index e7a0c2f..2f22a52 100644 --- a/Codes/app.py +++ b/Codes/app.py @@ -1,6 +1,6 @@ # Author - Mmabiaa # app.py - +from green import print_green import getpass # import other module associated to this file. from password_manager import * From ed34b875bd5002dc9056a1e6d98629a0696efc08 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:31:05 +0000 Subject: [PATCH 6/8] Update password_manager.py --- Codes/password_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Codes/password_manager.py b/Codes/password_manager.py index 74b5a0a..ea3ed82 100644 --- a/Codes/password_manager.py +++ b/Codes/password_manager.py @@ -11,7 +11,8 @@ import base64 import os import secrets -import string +import string +from green import print_green def hash_password(password): From 5f31f5f23e28cb67db10edd69165b38e565ad204 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:33:44 +0000 Subject: [PATCH 7/8] Update password_manager.py Applied green output colors --- Codes/password_manager.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Codes/password_manager.py b/Codes/password_manager.py index ea3ed82..8818822 100644 --- a/Codes/password_manager.py +++ b/Codes/password_manager.py @@ -28,7 +28,7 @@ def register(): with open('user_data.json', 'w') as file: json.dump({'username': username, 'master_password': master_password_hash}, file) - print('\n[+] Registration Completed!!\n') + print_green('\n[+] Registration Completed!!\n') def login(username, entered_password): @@ -42,16 +42,16 @@ def login(username, entered_password): entered_password_hash = hash_password(entered_password) if entered_password_hash == stored_password and username == user_data.get('username'): - print('\n[+] Login Successful...\n') + print_green('\n[+] Login Successful...\n') return True else: - print('\n[+] Invalid Login Credentials... Login Failed!!\n') - print('\n[+] Use the registered credentials to login') + print_green('\n[+] Invalid Login Credentials... Login Failed!!\n') + print_green('\n[+] Use the registered credentials to login') sys.exit() except Exception: - print('\n[+] You must register to begin...!!!\n') + print_green('\n[+] You must register to begin...!!!\n') sys.exit() def generate_key(master_password): @@ -99,20 +99,20 @@ def save_password(website, username, password, key): with open('password.json', 'w') as file: json.dump(passwords, file) - print(f'\n[+] Password saved for {website}...\n') + print_green(f'\n[+] Password saved for {website}...\n') def view_saved_websites(key): """View saved websites and their passwords.""" try: with open('password.json', 'r') as file: passwords = json.load(file) - print("Websites you saved...") + print_green("Websites you saved...") for website, data in passwords.items(): encrypted_password = data['password'].encode() decrypted_password = decrypt_password(encrypted_password, key) - print(f"Website: {website}") - print(f"Username: {data['username']}") - print(f"Password: {decrypted_password}\n") + print_green(f"Website: {website}") + print_green(f"Username: {data['username']}") + print_green(f"Password: {decrypted_password}\n") except FileNotFoundError: - print('\n[+] No passwords saved yet...\n') + print_green('\n[+] No passwords saved yet...\n') From 2f37380d1b3cfad37f44950c94aca82b921c0387 Mon Sep 17 00:00:00 2001 From: Boateng Prince Agyenim <163312213+Mmabiaa@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:42:17 +0000 Subject: [PATCH 8/8] Update green.py --- Codes/green.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Codes/green.py b/Codes/green.py index 58d36c5..a830688 100644 --- a/Codes/green.py +++ b/Codes/green.py @@ -1,5 +1,3 @@ -# a module for green output color - # Function to print in green def print_green(text): - print("\033[32m" + text + "\033[0m") \ No newline at end of file + print("\033[32m" + text + "\033[0m")