Password Vault¶
In this modern information age, we all have dozens of passwords to dog-knows-where. Not only that but those passwords should be secure too. Ain't no one got the capacity to remember all of that. Luckily this can be solved by what caused it: technology. By putting all passwords in a manager, you only need to remember the master password to retrieve all of your ultrasecure passwords. Since we are on a programming course, of course we're implementing our own solution for this. Time to make a terminal password manager.
Program Features¶
The submitted program should have the following features. Extra features are not required for the project to be accepted but they will naturally give you extra points. Whenever asking the user to input passwords, you should use the getpass module instead of the input function. When setting a new password it must also be prompted twice, and the passwords must match.
- Adding a new password
- When a new password is added, the following information needs to be provided: a title for recognition, optionally a username, and the password itself.
- Extra feature: instead of inputting the password, the user has the additional option to ask the program to generate a password of desired length for them. In order to get full points for this feature, you need to use the secrets module instead of random.
- Listing entries
- With this feature the user can list available password entries. enumerated. This feature only shows the titles, passwords are not shown.
- Extra feature: the use can select a password to display by selecting it with a number. Empty string returns to the main menu with no selection made.
- Displaying password
- The user can choose a password to display by typing its title. The associated username is also displayed.
- Extra feature: the username and password are only displayed on the screen until they are no longer needed. After the user presses enter, the terminal screen is wiped clear.
- Removing entry
- This feature allows the user to remove a password entry by inputting its title.
Data Management¶
In minimal implementation password entries are only kept in program memory. Design and implement a suitable data structure for storing them so that they are easy to handle. Extra points will be awarded for storing data in files instead.
Naturally there isn't much point in storing passwords into a plaintext file because anyone can read them from there. For this purpose we are also offering a chance to make the manager suitable for real use, by utilizing encrypted files that are opened with a master key. This way passwords will be safe even if the file falls into the wrong hands.
There's a few details about encryption algorithms that fall outside the scope of this course. In order to get around this issue, we have provided you with a small module that does the encryption and decryption with functions. As long as you understand how to invoke these functions, you should be able to use encryption for your data. In order to use it, you do need to install pycryptodome, in the usual way.
pip install pycryptodome
In order to get full points for using this module, your code needs to import it. Do not copy the contents of this module into your own code file.