Cryptography
A Python-based tool for encrypting and decrypting messages using the cryptography library's Fernet method. The program features a simple command-line interface and automatic secret key generation for secure data protection.
Install / Use
/learn @pkprajapati7402/CryptographyREADME
🔒 Encryption and Decryption Program
This is a Python program that uses the cryptography library's Fernet method for encryption and decryption. It provides a simple command-line interface to choose between encrypting and decrypting a message.
🚀 Features
- Encrypt any message using the Fernet encryption method.
- Decrypt any previously encrypted message using the same method.
- Automatically generates and uses a secret key for encryption and decryption.
📦 Installation
-
Clone the repository:
git clone https://github.com/yourusername/encryption-decryption.git cd encryption-decryption -
Install the required dependencies:
pip install cryptography
🛠️ Usage
-
Run the program:
python main.py -
Choose between encryption (
E) and decryption (D):- For encryption, enter the message you want to encrypt.
- For decryption, enter the encrypted message.
🔑 Key Management
- The program generates a
secret.keyfile if it doesn't exist. - This key is used for both encryption and decryption.
- Keep the
secret.keyfile safe. Losing this file will make it impossible to decrypt any messages encrypted with it.
📄 Example
Choose (E)ncrypt or (D)ecrypt: E
Enter the message to encrypt: Hello, world!
Encrypted message: gAAAAABeJc2V-MvhF7L3qfjzIHHGJ9tF5MEP3Gj2Pi8Y5kbU6iE4z6MSv1JazbTtXRXFwG1Y1NRpkRznlx0Kigc=
Choose (E)ncrypt or (D)ecrypt: D
Enter the message to decrypt: gAAAAABeJc2V-MvhF7L3qfjzIHHGJ9tF5MEP3Gj2Pi8Y5kbU6iE4z6MSv1JazbTtXRXFwG1Y1NRpkRznlx0Kigc=
Decrypted message: Hello, world!
📂 File Structure
encryption-decryption/
│
├── main.py # The main script to run the program
├── secret.key # The secret key file (auto-generated)
└── README.md # This README file
🤝 Contributing
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Prince
Related Skills
healthcheck
350.8kHost security hardening and risk-tolerance configuration for OpenClaw deployments
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
prose
350.8kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
claude-opus-4-5-migration
110.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
