GithubHelp home page GithubHelp logo

abdullah4tech / file-encryption-and-decryption Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 8 KB

This Python program includes two scripts, ๐Ÿ“œ encrypt.py and ๐Ÿ“œ decrypt.py, designed for encrypting and decrypting text files using the Fernet encryption scheme from the cryptography library.

License: MIT License

Python 100.00%
encryption-decryption python python-script

file-encryption-and-decryption's Introduction

๐Ÿ”’ File Encryption and Decryption ๐Ÿ”“

This Python program includes two scripts, ๐Ÿ“œ encrypt.py and ๐Ÿ“œ decrypt.py, designed for encrypting and decrypting text files using the Fernet encryption scheme from the cryptography library.

How it Works ๐Ÿ› ๏ธ

encrypt.py ๐ŸŒ

The encrypt.py script follows these steps:

  1. Gets the current directory.
  2. Identifies all text files (files with a '.txt' extension) in the directory.
  3. Generates a Fernet key.
  4. Writes the key to a file named key.key.
  5. Encrypts the content of each text file using the generated key.

decrypt.py ๐Ÿ”“

The decrypt.py script follows these steps:

  1. Gets the current directory.
  2. Identifies all encrypted text files in the directory (files with a '.txt' extension).
  3. Reads the Fernet key from the key.key file.
  4. Decrypts the content of each encrypted text file using the stored key.

Requirements ๐Ÿ“‹

  • Python
  • cryptography library

Install the required library using:

pip install cryptography

Contribution ๐Ÿค

Feel free to contribute to the project by opening issues or submitting pull requests. Follow the guidelines outlined in CONTRIBUTING.md.

How to Run โ–ถ๏ธ

Encryption ๐Ÿ”

Run the encryption script using a Python interpreter:

python encrypt.py

Decryption ๐Ÿ”“

Run the decryption script using a Python interpreter:

python decrypt.py

Key Storage ๐Ÿ—๏ธ

The encryption key is generated and stored in a file named key.key during the encryption process. This key file is crucial for decryption. Ensure its security and do not share it with encrypted files.

Important Security Information โš ๏ธ

  • Keep the encryption key (key.key) secure.
  • Do not share the key or store it with the encrypted files.
  • Losing the key will result in permanent data loss as decryption will not be possible.

Caution: Use this encryption method responsibly, and always keep a secure backup of your key.

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE.md file for details.


Disclaimer: This program is for educational purposes and should be used responsibly. The developers are not responsible for any misuse or data loss resulting from the use of this software.

file-encryption-and-decryption's People

Contributors

abdullah4tech avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.