|
| 1 | +# Python Password Manager |
| 2 | + |
| 3 | +Welcome to the **Python Password Manager** — your personal vault for securely managing passwords, powered by the robust combination of **Python** and **MariaDB**. Whether you're tired of forgetting passwords or juggling dozens of them, this tool simplifies your digital life with cutting-edge security built right in. |
| 4 | + |
| 5 | +At its core, the password manager leverages **PBKDF2** (Password-Based Key Derivation Function 2) to transform your **MASTER PASSWORD** and a **DEVICE SECRET** (a unique code tied to your device) into a powerful 256-bit encryption key. This key acts as the ultimate lock-and-key system, ensuring that your passwords are safely encrypted using **AES-256**, one of the most trusted encryption standards today. |
| 6 | + |
| 7 | +With this password manager, your sensitive information is locked away in a local database that only you can access — no cloud storage, no third-party access — just **you and your securely encrypted data**. |
| 8 | + |
| 9 | +Plus, with a command-line interface that’s easy to use and lightning-fast, managing your passwords is not only secure but also fun and efficient. Take control of your digital security while exploring the exciting world of encryption and databases! |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Features |
| 14 | +- Strong AES-256 encryption for password security. |
| 15 | +- User-friendly command-line interface for adding, retrieving, and generating passwords. |
| 16 | +- Secure storage of credentials in a local MariaDB database. |
| 17 | +- Copy passwords directly to the clipboard using [Pyperclip](https://pypi.org/project/pyperclip/). |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Table of Contents |
| 22 | +- [Installation](#installation) |
| 23 | + - [Linux](#linux) |
| 24 | + - [Windows](#windows) |
| 25 | +- [Configuration](#configuration) |
| 26 | +- [Usage](#usage) |
| 27 | + - [Adding Entries](#adding-entries) |
| 28 | + - [Retrieving Entries](#retrieving-entries) |
| 29 | + - [Generating Passwords](#generating-passwords) |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Installation |
| 34 | + |
| 35 | +### Requirements: |
| 36 | +- **Python 3.x** |
| 37 | +- **MariaDB** |
| 38 | +- [Pyperclip](https://pypi.org/project/pyperclip/) (for clipboard functionality) |
| 39 | + |
| 40 | +### Linux |
| 41 | + |
| 42 | +1. **Install Python Requirements:** |
| 43 | + ```bash |
| 44 | + sudo apt install python3-pip |
| 45 | + pip install -r requirements.txt |
| 46 | + ``` |
| 47 | + |
| 48 | +2. **Install MariaDB:** |
| 49 | + ```bash |
| 50 | + sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db |
| 51 | + sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntuprecise main' |
| 52 | + sudo apt-get update |
| 53 | + sudo apt-get install mariadb-server |
| 54 | + ``` |
| 55 | + |
| 56 | +3. **Create MariaDB User:** |
| 57 | + - Login as root: |
| 58 | + ```bash |
| 59 | + sudo mysql -u root |
| 60 | + ``` |
| 61 | + - Create a user: |
| 62 | + ```sql |
| 63 | + CREATE USER 'pm'@localhost IDENTIFIED BY 'password'; |
| 64 | + ``` |
| 65 | + - Grant necessary privileges: |
| 66 | + ```sql |
| 67 | + GRANT ALL PRIVILEGES ON *.* TO 'pm'@localhost IDENTIFIED BY 'password'; |
| 68 | + ``` |
| 69 | + |
| 70 | +4. **Pyperclip Fix (if needed):** |
| 71 | + If you encounter a "not implemented error", follow [this guide](https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error). |
| 72 | + |
| 73 | +### Windows |
| 74 | + |
| 75 | +1. **Install Python Requirements:** |
| 76 | + ```bash |
| 77 | + pip install -r requirements.txt |
| 78 | + ``` |
| 79 | + |
| 80 | +2. **Install MariaDB:** |
| 81 | + Follow [this guide](https://www.mariadbtutorial.com/getting-started/install-mariadb/) for installation on Windows. |
| 82 | + |
| 83 | +3. **Create MariaDB User:** |
| 84 | + - Navigate to the MariaDB bin directory: |
| 85 | + ```bash |
| 86 | + C:\Program Files\MariaDB\bin |
| 87 | + ``` |
| 88 | + - Login as root: |
| 89 | + ```bash |
| 90 | + mysql.exe -u root -p |
| 91 | + ``` |
| 92 | + - Create a user: |
| 93 | + ```sql |
| 94 | + CREATE USER 'pm'@localhost IDENTIFIED BY 'password'; |
| 95 | + ``` |
| 96 | + - Grant privileges: |
| 97 | + ```sql |
| 98 | + GRANT ALL PRIVILEGES ON *.* TO 'pm'@localhost IDENTIFIED BY 'password'; |
| 99 | + ``` |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Configuration |
| 104 | + |
| 105 | +Before using the password manager, you need to configure it by setting up a **MASTER PASSWORD**. |
| 106 | + |
| 107 | +1. **Create Configuration:** |
| 108 | + Run the following command to set up the MASTER PASSWORD and generate the DEVICE SECRET. This also creates the necessary database and tables. |
| 109 | + ```bash |
| 110 | + python config.py make |
| 111 | + ``` |
| 112 | + |
| 113 | +2. **Delete Configuration:** |
| 114 | + Warning: This will permanently delete all saved passwords. |
| 115 | + ```bash |
| 116 | + python config.py delete |
| 117 | + ``` |
| 118 | + |
| 119 | +3. **Remake Configuration:** |
| 120 | + This will delete the existing setup and create a new configuration. |
| 121 | + ```bash |
| 122 | + python config.py remake |
| 123 | + ``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Usage |
| 128 | + |
| 129 | +After configuration, you can use the password manager to add, retrieve, or generate passwords. Below are the common commands: |
| 130 | + |
| 131 | +### Command Help |
| 132 | +```bash |
| 133 | +python pm.py -h |
| 134 | +``` |
| 135 | +This displays all available options for adding, retrieving, and generating passwords. |
| 136 | + |
| 137 | +### Adding Entries |
| 138 | +To add a new entry for a site: |
| 139 | +```bash |
| 140 | +python pm.py add -s mysite -u mysite.com -e [email protected] -l myusername |
| 141 | +``` |
| 142 | + |
| 143 | +### Retrieving Entries |
| 144 | +- Retrieve all entries: |
| 145 | + ```bash |
| 146 | + python pm.py extract |
| 147 | + ``` |
| 148 | +- Retrieve entries by site name: |
| 149 | + ```bash |
| 150 | + python pm.py e -s mysite |
| 151 | + ``` |
| 152 | +- Retrieve a specific entry by site name and username: |
| 153 | + ```bash |
| 154 | + python pm.py e -s mysite -l myusername |
| 155 | + ``` |
| 156 | +- Copy the password of a specific entry to the clipboard: |
| 157 | + ```bash |
| 158 | + python pm.py e -s mysite -l myusername --copy |
| 159 | + ``` |
| 160 | + |
| 161 | +### Generating Passwords |
| 162 | +To generate a random password and copy it to the clipboard: |
| 163 | +```bash |
| 164 | +python pm.py g --length 15 |
| 165 | +``` |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## License |
| 170 | +This project is licensed under the [MIT License](LICENSE.md). |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +## Contributing |
| 175 | +Contributions are welcome! Please open an issue or submit a pull request if you'd like to improve the code or documentation. |
0 commit comments