-
Notifications
You must be signed in to change notification settings - Fork 0
/
Password Manager v1.2000 ANIVERSIRY EDITION NEW UPDAT 2021 FREE ONLINE NO VIRUS.py
200 lines (177 loc) · 7.17 KB
/
Password Manager v1.2000 ANIVERSIRY EDITION NEW UPDAT 2021 FREE ONLINE NO VIRUS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#Passwork Manager.py
#23/02 2021
#Trisan Huynh
import os
import time
import random
import string
with open("Documents/school/Year 12/2DIP/Password Manager/secure/existing_users.txt", "r") as existing_users_txt:
existing_users = existing_users_txt.read()
existing_users = existing_users.split("=")
with open("Documents/school/Year 12/2DIP/Password Manager/secure/existing_users_passwords.txt", "r") as existing_users_passwords_txt:
existing_users_passwords = existing_users_passwords_txt.read()
existing_users_passwords = existing_users_passwords.split("=")
def cls():
os.system('cls')
def signin():
desired_function = input("Would you like to sign in to an existing (e) account or create a new (n) account? Please enter 'e' or 'n': ").strip().lower()
if desired_function == "e":
account_login()
elif desired_function == "n":
cls()
new_account()
elif desired_function != "e" or "n":
print("Please enter either 'e' or 'n'.")
time.sleep(1)
cls()
signin()
def account_login():
print("Welcome to the login portal.")
time.sleep(1)
entered_username = input("If at anytime you wish to exit, enter 'escape' as the username. Please enter your username: ").strip()
if entered_username in existing_users:
print("Welcome, {}.".format(entered_username))
while True:
entered_password = input("Please enter your password: ").strip()
if entered_password in existing_users_passwords:
print("Login successful.")
time.sleep(1)
cls()
menu()
elif entered_password == "escape":
cls()
signin()
else:
print("Incorrect password. Passwords are case sensitive.")
time.sleep(1)
print("If you have forgotten your password and wish to exit, type 'escape' as the password.")
time.sleep(2)
cls()
elif entered_username == "escape":
cls()
signin()
elif entered_username not in existing_users:
print("That username does not exist. Please try again.")
time.sleep(1)
cls()
account_login()
def intro():
print("Hello. This program is used to securely store and retreive passwords.")
time.sleep(1)
cls()
while True:
try:
age = float(input("What is your age?: "))
break
except ValueError:
print("Please enter a number.")
time.sleep(1)
if age <= 13:
cls()
print("You do not possess the necessary number of years in order to utilise this software.")
print("Please return when you are older than the age of 13.")
time.sleep(4)
exit()
cls()
signin()
def menu():
cls()
while True:
try:
mode = int(input("""Choose a mode by entering a number:
1: View passwords
2: Edit/add passwords
3: Sign out
4: Sign out and exit
Number : """))
break
except ValueError:
print("That is not a valid choice. Please try again.")
if mode == 1:
view_passwords()
elif mode == 2:
edit_passwords()
elif mode == 3:
print("You have been signed out.")
cls()
signin()
elif mode == 4:
print("Goodbye.")
time.sleep(1)
cls()
exit()
else:
print("That is not a valid choice. Please try again.")
cls()
menu()
def edit_passwords():
while True:
password_title = input("What is the use of this login (e.g. Google): ").strip().title()
password_username = input("What is the username/email for the login?: ").strip()
password_password = input("What is the password for the login?: ").strip()
cls()
login_set = "=" + "Site: {} - Username/email: {} - Password: {}".format(password_title, password_username, password_password)
with open ("Documents/school/Year 12/2DIP/Password Manager/secure/usernames_passwords.txt", "a") as usernames_passwords_txt:
usernames_passwords_txt.write(login_set)
continue_edit_passwords = input("Do you want to add another password (Y/N)?: ").strip().lower()
if continue_edit_passwords == "y":
cls()
edit_passwords()
elif continue_edit_passwords == "n":
cls()
menu()
else:
print("What does {} mean? Sending you to the main menu.".format(continue_edit_passwords))
time.sleep(1)
cls()
menu()
def view_passwords():
with open ("Documents/school/Year 12/2DIP/Password Manager/secure/usernames_passwords.txt", "r") as usernames_passwords_txt:
usernames_passwords_list = usernames_passwords_txt.read()
usernames_passwords_list = usernames_passwords_list.split("=")
for another_login in usernames_passwords_list:
print("• " + another_login)
idk_nothing_important = input("Press ENTER key to return to the menu.")
if idk_nothing_important != "8397219317293871238":
cls()
menu()
elif idk_nothing_important == "8397219317293871238":
print("Wow what a good guess!!")
time.sleep(2)
exit()
def new_account():
print("Please enter a username for your account.")
time.sleep(1)
new_user_username = input("It can contain letters, numbers and/or symbols: ").strip()
if new_user_username in existing_users:
print("Sorry, but the username {} is already taken. Try adding numbers or symbols.".format(new_user_username))
time.sleep(1)
cls()
new_account()
with open("Documents/school/Year 12/2DIP/Password Manager/secure/existing_users.txt", "a") as existing_users_txt:
existing_users_txt.write("=" + new_user_username)
existing_users.append(new_user_username)
cls()
print("Please enter a password for your account.")
time.sleep(1)
print("A strong password will contain a mixture of upper and lower case letters, numbers, and symbols, and should be something you can remember.")
time.sleep(1)
new_user_password_check_1 = input("Enter your password. Passwords are case sensitive. It must contain more than 8 characters: ").strip()
if len(new_user_password_check_1) <= 7:
print("Please enter a password that is at least 8 characters.")
time.sleep(2)
cls()
new_account()
new_user_password_check_2 = input("Please confirm your password: ").strip()
if new_user_password_check_2 != new_user_password_check_1:
print("Sorry, but the passwords did not match. Please try again.")
time.sleep(1)
new_account()
cls()
with open("Documents/school/Year 12/2DIP/Password Manager/secure/existing_users_passwords.txt", "a") as existing_users_passwords_txt:
existing_users_passwords_txt.write("=" + new_user_password_check_2)
existing_users_passwords.append(new_user_password_check_2)
cls()
account_login()
cls()
intro()