V2.8 Update

This commit is contained in:
SowinskiBraeden committed 2020-09-30 14:55:34 -07:00
1 parent 5b840786d1
commit 68cf821312
7 files changed
+185 -118

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
Password Saver Updates and Versions
******************************
v1.0-Alpha release: demo
v1.1-Account add: demo
v1.2-Account Simple security: demo
v1.3-Password Save: demo
v1.4-Savable Data: first full demo
v1.5-Unknown bug fix x1: demo
v1.6-Code Rewrite: demo
v1.7-Unkiwn Bug fix x3: demo
v1.8-Release Notes [Impliment]: demo
v1.9-Release Notes Rewrite: demo
v2.0- Beta Release: Full
v2.1-Unknown Bug Fix x1: full
v2.2-Security Update: Full
v2.3-Bug fix[Password Reset]: Full
v2.4-No same Username [Impliment]: Full
v2.5-Change Save Pass[Impliment]: Full
v2.5.2-Debugging[Quit Bug, Cancel Bug] + Minor Code Rewrites
v2.6 Data rewrite (allows multiple save passwords)
v2.7 You can now add additional save passwords into your account [impliment]
v2.8 Minor Code rewrites, Few bug fixes
In Dev:
******
nothing
Proposed Updates
***************
User Self Delete
Admin Delete user
v3.0-Rewrite + GUI
+7
View File
@@ -2,6 +2,10 @@ Password Saver notes:
Patch Notes: Patch Notes:
-V(2.8) Minor Code Changes,
Debuggin:
-Missing Save Password bug
-V(2.6) Data Rewrite -V(2.6) Data Rewrite
-V(2.5) Minor Code Rewrites, -V(2.5) Minor Code Rewrites,
@@ -12,6 +16,9 @@ Password Saver notes:
Updates: Updates:
-V(2.8) Unable to login when no accounts are created.
A few options have been disabled.
-V(2.7) You can now add more save Password into your -V(2.7) You can now add more save Password into your
account. account.
@@ -1,3 +1,4 @@
#Import all libraries
from base64 import urlsafe_b64encode as b64e, urlsafe_b64decode as b64d from base64 import urlsafe_b64encode as b64e, urlsafe_b64decode as b64d
from cryptography.fernet import Fernet from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
@@ -8,9 +9,8 @@ import secrets
import sys import sys
import time import time
print() print('\nPassword Saver')
print('Password Saver') print('Version - [2.8]')
print('Version - [2.7]')
# pylint: disable=unused-variable # pylint: disable=unused-variable
# pylint: enable=too-many-lines # pylint: enable=too-many-lines
@@ -125,8 +125,8 @@ def register():
b = ('Creating Account' + "." * a) b = ('Creating Account' + "." * a)
sys.stdout.write('\r' + b) sys.stdout.write('\r' + b)
time.sleep(0.5) time.sleep(0.5)
append_file1.write('\n')
append_file1.write(userName + ":" + str(hashlib.md5(userPass.encode()).hexdigest())) append_file1.write(userName + ":" + str(hashlib.md5(userPass.encode()).hexdigest()))
append_file1.write('\n')
append_file1.close() append_file1.close()
time.sleep(1) time.sleep(1)
print() print()
@@ -141,10 +141,10 @@ def register():
savePassLoop = True savePassLoop = True
elif len(savePass) > 0: elif len(savePass) > 0:
wfor = input(' What is this password for > ') wfor = input(' What is this password for > ')
append_file2.write('\n')
append_file2.write(userName + ":" + str(password_encrypt(savePass.encode(), gPassword).decode())) append_file2.write(userName + ":" + str(password_encrypt(savePass.encode(), gPassword).decode()))
append_file3.write(f'{str(password_encrypt(savePass.encode(), gPassword).decode())}:{wfor}')
append_file2.write('\n')
append_file3.write('\n') append_file3.write('\n')
append_file3.write(f'{wfor}:{str(password_encrypt(savePass.encode(), gPassword).decode())}')
savePassD[wfor] = str(password_encrypt(savePass.encode(), gPassword).decode()) savePassD[wfor] = str(password_encrypt(savePass.encode(), gPassword).decode())
append_file2.close() append_file2.close()
append_file3.close() append_file3.close()
@@ -167,107 +167,130 @@ def register():
def login(): def login():
#Data Puller
userData = {}
#Users Pull
f = open('Users.txt', 'r') f = open('Users.txt', 'r')
users = {} users = {}
for line in f: for line in f:
k, v = line.strip().split(':') k, v = line.strip().split(':')
users[k.strip()] = v.strip() users[k.strip()] = v.strip()
f.close() f.close()
j = open('UsersSP.txt', 'r') if len(users) == 0:
usersSP = {} print('No Users Found!')
for line in j: print('Register Now')
k, v = line.strip().split(':') register()
usersSP[k.strip()] = v.strip() elif len(users) > 0:
j.close() #Users SP pull
l = open('WSPF.txt', 'r') j = open('UsersSP.txt', 'r')
wspf = {} spList = []
for line in l: usersSP = {}
k, v = line.strip().split(':') for line in j:
wspf[k.strip()] = v.strip() myDict = {}
l.close() k, v = line.strip().split(':')
userData = {} myDict[k.strip()] = v.strip()
for user in users: spList.append(myDict)
savePassL = {} j.close()
for USER in usersSP: for user in users:
if USER == user: passlist = []
SavePass = usersSP[USER] for items in spList:
for r in wspf: for keys,values in items.items():
if password_decrypt(wspf[r].encode(), gPassword).decode() == password_decrypt(SavePass.encode(), gPassword).decode(): if keys == user:
pw = usersSP[USER] if keys not in usersSP:
savePassL[r] = pw passlist.append(password_decrypt(values.encode(), gPassword).decode())
data = {'username': user, 'password': users[user], 'savePassDict': savePassL} usersSP[keys]=passlist
userData[user] = data else:
passlist.append(password_decrypt(values.encode(), gPassword).decode())
username_check = False usersSP[keys]=passlist
password_check = False
adminName = '9581b8785e452a9d9672ddfb2277b2af' #What for Pull
adminPass = '9609c233f5c309419fa6393a1b959c13' l = open('WSPF.txt', 'r')
wspf = {}
for line in l:
k, v = line.strip().split(':')
wspf[k.strip()] = v.strip()
l.close()
print('Type cancel at anytime to cancel.') #Data Formater
print() userData = {}
for user in users:
passDict = {}
for USER in usersSP:
if USER == user:
for password in wspf:
if password_decrypt(password.encode(), gPassword).decode() in usersSP[user]:
passDict[wspf[password]] = password
data = {'username': user, 'password': users[user], 'savePass': passDict}
userData[user] = data
while not username_check: username_check = False
# Takes users input for username password_check = False
inputName = input('What is your Username > ')
inputName = str(inputName)
# Checks if username is correct adminName = '9581b8785e452a9d9672ddfb2277b2af'
if inputName in userData: adminPass = '9609c233f5c309419fa6393a1b959c13'
username_check = True
while not password_check:
# Takes users input for pw print('Type cancel at anytime to cancel.')
inputPass = input(f"Please enter password for {inputName} > ") print()
if hashlib.md5(inputPass.encode()).hexdigest() == userData[inputName]['password']: while not username_check:
user = User(inputName, inputPass, userData[inputName]['savePassDict']) # Takes users input for username
password_check = True inputName = input('What is your Username > ').lower().strip()
logged_in(user)
elif inputPass == "cancel": # Checks if username is correct
print("< Canceling >") if inputName in userData:
password_check = True username_check = True
time.sleep(1) while not password_check:
home()
elif hashlib.md5(inputPass.encode()).hexdigest() != userData[inputName]['password']: # Takes users input for pw
print("That is the incorrect password. Please try again.") inputPass = input(f"Please enter password for {inputName} > ").lower().strip()
elif hashlib.md5(inputName.encode()).hexdigest() == adminName: if hashlib.md5(inputPass.encode()).hexdigest() == userData[inputName]['password']:
username_check = True user = User(inputName, inputPass, userData[inputName]['savePass'])
while not password_check: password_check = True
logged_in(user)
# Takes users input for pw elif inputPass == "cancel":
inputAdminPass = input("Please enter password for the Admin > ") print("< Canceling >")
inputAdminPass = str(inputAdminPass) password_check = True
time.sleep(1)
home()
if hashlib.md5(inputAdminPass.encode()).hexdigest() == adminPass: elif hashlib.md5(inputPass.encode()).hexdigest() != userData[inputName]['password']:
password_check = True print("That is the incorrect password. Please try again.")
admin()
elif inputAdminPass == "cancel": elif hashlib.md5(inputName.encode()).hexdigest() == adminName:
print("< Canceling >") username_check = True
password_check = True while not password_check:
time.sleep(1)
home()
elif inputName == "cancel": # Takes users input for pw
print("< Canceling >") inputAdminPass = input("Please enter password for the Admin > ")
username_check = True inputAdminPass = str(inputAdminPass)
time.sleep(1)
home()
# Tells user if username is incorrect if hashlib.md5(inputAdminPass.encode()).hexdigest() == adminPass:
else: password_check = True
print("That is an invalid username, please try again.") admin()
elif inputAdminPass == "cancel":
print("< Canceling >")
password_check = True
time.sleep(1)
home()
elif inputName == "cancel":
print("< Canceling >")
username_check = True
time.sleep(1)
home()
# Tells user if username is incorrect
else:
print("That is an invalid username, please try again.")
def admin(): def admin():
print() print("\n < Welcome Braeden >\n")
print(" < Welcome Braeden >")
print()
login_op = False login_op = False
while not login_op: while not login_op:
@@ -302,8 +325,7 @@ def logged_in(user):
login_op = False login_op = False
while not login_op: while not login_op:
print() print("\n Options:")
print(" Options:")
print(" < logout | my.info | reset.password | change.savedPassword >") print(" < logout | my.info | reset.password | change.savedPassword >")
print(' < add.pass >') print(' < add.pass >')
@@ -318,6 +340,8 @@ def logged_in(user):
home() home()
elif user_select == "my.info": elif user_select == "my.info":
print()
print('Your passwords:')
# Gives them the saved pw in the account # Gives them the saved pw in the account
for r in user.savePassDict: for r in user.savePassDict:
print(f'{r}: {password_decrypt(user.savePassDict[r].encode(), gPassword).decode()}') print(f'{r}: {password_decrypt(user.savePassDict[r].encode(), gPassword).decode()}')
@@ -371,8 +395,7 @@ def logged_in(user):
print("Password cant be blank.") print("Password cant be blank.")
elif len(newSavedPass) < 8: elif len(newSavedPass) < 8:
print("That password is too short, please try again.") print("That password is too short, please try again.\n")
print()
elif newSavedPass == "cancel": elif newSavedPass == "cancel":
print("< Canceling >") print("< Canceling >")
@@ -382,6 +405,35 @@ def logged_in(user):
elif hashlib.md5(password.encode()).hexdigest() != user.password: elif hashlib.md5(password.encode()).hexdigest() != user.password:
print("That is the incorrect password. Please try again.") print("That is the incorrect password. Please try again.")
elif user_select == 'change.savedPassword':
print('This Option is Disabled for development. :(')
elif user_select == 'add.pass':
newPass = input(' What password would you like to save in this account > ')
if len(newPass) == 0:
print('New Password can\'t be blank')
elif len(newPass) > 0:
wfor = input(' What is this password for > ')
append_file2.write(user.userName + ":" + str(password_encrypt(newPass.encode(), gPassword).decode()))
append_file3.write(f'{str(password_encrypt(newPass.encode(), gPassword).decode())}:{wfor}')
append_file2.write('\n')
append_file3.write('\n')
newSavePassDict = user.savePassDict
newSavePassDict[wfor] = str(password_encrypt(newPass.encode(), gPassword).decode())
append_file2.close()
append_file3.close()
print()
user = User(user.userName, user.password, newSavePassDict)
logged_in(user)
elif user_select == "":
print("You cannot leave this blank.")
else:
print("That is an invalid option. Please try again.\n")
#Disabled for development fix
'''
elif user_select == 'change.savedPassword': elif user_select == 'change.savedPassword':
print("Type cancel at anytime to cancel.") print("Type cancel at anytime to cancel.")
@@ -427,32 +479,8 @@ def logged_in(user):
elif password != user.password: elif password != user.password:
print("That is the incorrect password. Please try again.") print("That is the incorrect password. Please try again.")
'''
elif user_select == 'add.pass':
newPass = input(' What password would you like to save in this account > ')
if len(newPass) == 0:
print('New Password can\'t be blank')
elif len(newPass) > 0:
wfor = input(' What is this password for > ')
append_file2.write('\n')
append_file2.write(user.userName + ":" + str(password_encrypt(newPass.encode(), gPassword).decode()))
append_file3.write('\n')
append_file3.write(f'{wfor}:{str(password_encrypt(newPass.encode(), gPassword).decode())}')
newSavePassDict = user.savePassDict
newSavePassDict[wfor] = str(password_encrypt(newPass.encode(), gPassword).decode())
append_file2.close()
append_file3.close()
print()
user = User(user.userName, user.password, newSavePassDict)
logged_in(user)
elif user_select == "":
print("You cannot leave this blank.")
else:
print("That is an invalid option. Please try again.")
print()
#remove.pass in >dev< #remove.pass in >dev<
''' '''
elif user_select == 'remove.pass': elif user_select == 'remove.pass':
@@ -491,11 +519,10 @@ def print_user_data(user_info):
def home(): def home():
system_home = False system_home = False
while not system_home: while not system_home:
print() print("\n < register | login | quit | notes > ")
print(" < register | login | quit | notes > ")
user_select = input(" > ") user_select = input(" > ")
user_select = str(user_select) user_select.lower()
if user_select == "register": if user_select == "register":
system_home = True system_home = True
@@ -513,7 +540,7 @@ def home():
user_select = str(user_select) user_select = str(user_select)
if user_select == "yes": if user_select == "yes":
system_home = True exit()
print("<Shutting down>") print("<Shutting down>")
elif user_select == "no": elif user_select == "no":
@@ -525,8 +552,7 @@ def home():
print(f_contents) print(f_contents)
elif user_select == "": elif user_select == "":
print("This cant be blank.") print("This cant be blank.\n")
print()
else: else:
print("That is an invalid option. Please try again.") print("That is an invalid option. Please try again.")
+2
View File
@@ -1,5 +1,7 @@
#Password Saver #Password Saver
Make Sure you install all the libraries using pip
This Is my Password Saver Console Project This Is my Password Saver Console Project
You can create an accout locally on your machine and store passwords in the account. You can create an accout locally on your machine and store passwords in the account.
All sensitive data like your account Password and Saved Password are encrypted. All sensitive data like your account Password and Saved Password are encrypted.
File renamed without changes.
File renamed without changes.
File renamed without changes.