I created this project so I can use a USB drive to automatically type in my master password in my password manager.
- Your password is encrypted and saved into the flash drive. unless someone doesn't have access to your pc, it can't be decrypted. even by copy pasting the files to different devices.
- To enhance your password even more, the app also does some face recognition using Open-CV to verify it's you who's using this app and flash drive. You can turn this option off.
- python 3.8 or higher idk
-
Installing prerequisities
pip install -r requirements.txt
Note: If you are on windows, you most probably won't be able to installdlib
library like this. To solve the problem, follow this tutorial or search up the internet, then run the command above again untill every library is installed
-
Create encrypted password and key
- run
python CreatePassword.py
, enter your master password and press enter. two files would be created:enc_salt.bin
andenc_mp.bin
. - Move
enc_mp.bin
To the flash drive (in the directory you specified in the config.py file. default: root) Note: Don't copy it. You want to seperate these two so your security would increase.
- run
-
Training the AI This section is not needed if you don't want to do face recognition.. Just set
DO_FACE_RECOGNITION
to False (in config)- Change your name in the config file, using the
FACE_RECOGNITION_USER
variable. The name must be folder-name-friendly. - Take multiple images of your face, put them all in a folder under trainting (the more pictures the better). The name of the folder must be the same string you specified for
FACE_RECOGNITION_USER
. The structure would look like this:
USB-Master-Password ├── training │ └── hamid │ ├── img1.jpg │ ├── img2.jpg │ ├ ...
Note: If you want to reset the training module, just delete the file
encodings.pkl
(or by the variable in config:DEFAULT_ENCODINGS_PATH
)- In th root directory, run
python train.py
- Once trained, you can validate it using
python validate.py
. It should print out your name and the location of your face in the picture it took.
- Change your name in the config file, using the
-
Make executable file In the root directory make
detect.bat
file, open it with your editor, and type this:cd "/path/to/USB-Master-Password/" start pythonw detect.pyw
(change that path accordingly)
-
Add Scheduled Task
- Enable the Operational Log and create your custom view. You can use this tutorial (you can only use 2003 as the ID since we only need to detect when a USB is plugged in)
- Create an scheduled task. There is this tutorial for it. For the action, just copy the path to the bat file and paste it in the
Program/Script
field.
- Open your password manager
- Plug in your USB while you're in front of the camera
- Instantly click on the password field so it will paste it there for you. If you failed to do it on time, you can manually paste it from the clipboard.
- If you have multiple webcams, you can increase
CAM_PORT
in config, to reach the webcam you want - Each password encrypted file is unique to the device you used to create that password, therefore even if you copy paste this folder to another pc and use the same usb and encrypted file, you don't get to see the password. If you want to use your password on multiple devices, simply make a new password as explained in Create encrypted password and key in the new device, then change the name of the
enc_mp.bin
(both the file and the config) and use these new files alongside.
MIT License
This project is free and open-source. You can use, modify, and distribute it without any restrictions. Any credits is appreciated doe