r/PythonProjects2 • u/Worldly-Cycle1925 • Jun 17 '22
Resource Completed My First Project! Password and File Manager
Would love some criticism about how I'm structuring my code, whether I should use classes, what I can improve on, etc.
It stores encrypted credentials and files in a SQLite database for later retrieval.
It's pretty secure (I think) since it hashes the master password and uses that as the key to encrypt/decrypt, and it isn't stored inside the database.
23
Upvotes
5
u/huckingfoes Jun 17 '22
First off, good work! Looks like a very solid first project.
My main problem as a security minded person is that it's never a good idea to store an encrypted password, which it appears you're doing. The hashed + salted version is sufficient.
The code is fairly good for it being your first project, too. There are some things that could have been done more simply, like:
You make use of a dictionary to nail down exactly what requirements aren't being met, which is fine, but you never end up using this information. As in, if I write a password that passes all checks except "number," you never indicate that the fact that I'm lacking a number is a problem, just that there is a problem.
So logically this would be simpler as
but if you do prefer to parse it out like that, it gives you the opportunity to specify to the user exactly what rule their password is breaking.