a try to create encrypted password manager this is the last version i guess
CHARLIST="""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:;"'%[]{}_,→()*/+-?!&^|#""" PASSWORDS=[] def analyse(key): if len(key)<1:return 0 for i in range(len(str(key))): if not key[i] in CHARLIST:return 0 return 1 def encrypt(key,MASTER): crypted="" if analyse(key) and analyse(MASTER): for i in range(len(key)): crypted+=CHARLIST[(CHARLIST.index(key[i])+CHARLIST.index(MASTER[i%len(MASTER)]))%len(CHARLIST)] return crypted def decrypt(key,MASTER): decrypted="" if analyse(key) and analyse(MASTER): for i in range(len(key)): decrypted+=CHARLIST[(CHARLIST.index(key[i])-CHARLIST.index(MASTER[i%len(MASTER)]))%len(CHARLIST)] return decrypted def addPassword(key="",MASTER=""): if key=="":key=input("Enter new password: ") if MASTER=="":MASTER=input("Enter master password: ") if encrypt(key,MASTER)not in PASSWORDS: PASSWORDS.append(encrypt(key,MASTER)) def removePassword(key="",MASTER=""): if key=="":key=input("Enter the password you want to remove:\n") if MASTER=="":MASTER=input("Enter master password: ") if encrypt(key,MASTER)in PASSWORDS: PASSWORDS.remove(encrypt(key,MASTER)) def readPasswords(MASTER=""): if MASTER=="":MASTER=input("Enter master password:") for i in range(len(PASSWORDS)): print(PASSWORDS[i]+" → "+decrypt(PASSWORDS[i],MASTER)) def syncr(echo=1): try:f=open("mdpsave.sav","r") except NameError: if echo:print("Error: make sure your on Omega\n to use files functions") else: cp=f.read(2**20) while " "in cp: print(cp) if cp[:cp.index(" ")]not in PASSWORDS: PASSWORDS.append(cp[:cp.index(" ")]) cp=cp[cp.index(" ")+1:] f=open("mdpsave.sav","w") f.truncate(0) if len(PASSWORDS)>0: for i in range(len(PASSWORDS)): f.write(PASSWORDS[i]+" ")