PasswordManager is a Python class that provides encryption and decryption capabilities for files using the Fernet encryption scheme from the cryptography
library.
- Python 3.x
cryptography
library
- Import necessary modules:
import datetime
import os.path
from cryptography.fernet import Fernet
- Create an instance of the
PasswordManager
class:
# Provide the secret key or leave it empty to generate a new key
p = PasswordManager(key=b'your_secret_key')
- Use the
encrypt_file
anddecrypt_file
methods to encrypt and decrypt files, respectively:
# Encrypt a file
p.encrypt_file(secret_key=your_secret_key, file_path='path/to/file')
# Decrypt a file
p.decrypt_file(secret_key=your_secret_key, file_path='path/to/encrypted_file')
- Use the
engine
method to interact with the PasswordManager through the console:
p.engine()
Generate a new secret key for encryption and decryption of data.
Encrypt the provided data using the given secret key.
Decrypt the encrypted data using the given secret key.
Encrypt a file using the provided secret key.
Decrypt an encrypted file using the provided secret key.
Interactive user interface to choose file encryption or decryption.
This project is licensed under the MIT License - see the LICENSE file for details.
PasswordManager is licensed under the MIT License. By contributing to this project, you agree to release your contributions under this license.
We look forward to your contributions and hope you find the project enjoyable to work on!
Feel free to modify this section to better suit your project's specific contribution guidelines and community practices. Happy coding!
If you are a developer interested in contributing to PasswordManager, we welcome your contributions! Whether it's fixing bugs, adding new features, or improving documentation, your help is valuable.
To contribute to the project, follow these steps:
- Fork the repository on GitHub.
- Create a new branch from the
main
branch for your changes. - Make your changes and commit them with descriptive commit messages.
- Push your branch to your forked repository.
- Create a pull request (PR) against the
main
branch of the original repository.
If you find any issues or bugs in the PasswordManager project, please create an issue on GitHub. Include detailed information about the problem, steps to reproduce it, and any relevant error messages.
We expect all contributors to adhere to the project's Code of Conduct. Please be respectful and considerate of others while participating in the project.