|
|
|
@ -22,8 +22,8 @@ def database_enc():
|
|
|
|
|
for _ in range(3):
|
|
|
|
|
try:
|
|
|
|
|
password = gp(prompt = "Enter master password: ")
|
|
|
|
|
conn.execute(f"PRAGMA key = {password}")
|
|
|
|
|
conn.execute('''
|
|
|
|
|
cursor.execute(f"PRAGMA key = {password}")
|
|
|
|
|
cursor.execute('''
|
|
|
|
|
CREATE TABLE IF NOT EXISTS data (
|
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
|
service TEXT,
|
|
|
|
@ -56,7 +56,7 @@ def database_enc():
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
print("Both of the passwords are different. Please enter the same password.")
|
|
|
|
|
conn.execute(f"PRAGMA key = {mp}")
|
|
|
|
|
cursor.execute(f"PRAGMA key = {mp}")
|
|
|
|
|
conn.commit()
|
|
|
|
|
|
|
|
|
|
def gen():
|
|
|
|
@ -69,14 +69,20 @@ def gen():
|
|
|
|
|
print(username)
|
|
|
|
|
elif userpass == 'p':
|
|
|
|
|
while True:
|
|
|
|
|
length = int(input("Enter password length (above 8 only): "))
|
|
|
|
|
try:
|
|
|
|
|
length = int(input("Enter password length (above 8 only): "))
|
|
|
|
|
except ValueError:
|
|
|
|
|
length = 16
|
|
|
|
|
print("Password length not specified. Defaulting to 16.")
|
|
|
|
|
if length <= 7:
|
|
|
|
|
print("The password is too short. Please enter it again.")
|
|
|
|
|
else:
|
|
|
|
|
pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~@#$%^&*()-_=+]}[{\"';:.>,</?"
|
|
|
|
|
passwd = ""
|
|
|
|
|
for i in range(length):
|
|
|
|
|
passwd += pool[rint(0, 90)]
|
|
|
|
|
print(passwd)
|
|
|
|
|
break
|
|
|
|
|
pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~@#$%^&*()-_=+]}[{\"';:.>,</?"
|
|
|
|
|
strength = ''.join(sr().choice(pool) for i in range(length))
|
|
|
|
|
print(strength)
|
|
|
|
|
else:
|
|
|
|
|
print("Incorrect input.")
|
|
|
|
|
|
|
|
|
@ -215,7 +221,7 @@ quit - quit the program
|
|
|
|
|
elif command == 'ed':
|
|
|
|
|
edit()
|
|
|
|
|
elif command[0] == 'v':
|
|
|
|
|
print("keyvault: v1.0.5")
|
|
|
|
|
print("keyvault: v1.0.6")
|
|
|
|
|
elif command[0] == 'g':
|
|
|
|
|
gen()
|
|
|
|
|
elif command[0] == 's':
|
|
|
|
|