bhargavnova / python-helper-modules

MIT License
7 stars 24 forks source link

File Encryption and Decryption Module πŸ“πŸ” #7

Closed bhargavnova closed 9 months ago

bhargavnova commented 9 months ago

Objective:

Write a Python module that enables users to easily encrypt and decrypt files. This functionality will enhance the security of sensitive data stored in files.

Features:

  1. Encryption Functionality:

    • Create a function that can encrypt a given file using a secure encryption algorithm.
  2. Decryption Functionality:

    • Implement a function that can decrypt an encrypted file, restoring it to its original state.
  3. Password Protection:

    • Allow users to set and use a password for encryption and decryption operations.
  4. Robust Error Handling:

    • Implement thorough error handling to gracefully manage edge cases and invalid inputs.

Example Usage:

import file_encryptor

# Encrypt a file
file_encryptor.encrypt_file("/path/to/input_file.txt", "/path/to/output_file.enc", "my_password")

# Decrypt a file
file_encryptor.decrypt_file("/path/to/encrypted_file.enc", "/path/to/decrypted_output.txt", "my_password")

Difficulty: Beginner/Intermediate Tags: Python, Encryption

Note: The main point of this module is to implement encryption and decryption functionality to files, no matter what approach you follow.

SaranshBaniyal commented 9 months ago

Hello @bhargavnova , I would like to contribute to this, I have been into Python and Django dev for quite some time and would love to test my skillset in developing this.

bhargavnova commented 9 months ago

Sure!! Just a little advice, it's better to use Python instead of Django, it should be a fair and simple script, and Django is quite a robust framework.

Happy coding!! :)

SaranshBaniyal commented 9 months ago

Yeah sure thing @bhargavnova , there is no point in using Django here, when all u need is a simple python module. Thanks for assigning the issue😁

bhargavnova commented 9 months ago

Thanks :) for contributing

bhargavnova commented 9 months ago

Updated Contribution Guidelines

Dear @SaranshBaniyal ,

I hope this message finds you well!

I wanted to take a moment to inform you about some updates I've made to contribution guidelines. Your valuable contribution will be been instrumental in the success of this repo project, and I want to ensure that we both are on the same page moving forward.

The updated guidelines can be found here. I kindly request you to review them at your earliest convenience.

If you have any questions or need further clarification on any points, please don't hesitate to reach out. Your expertise and insights are highly valued, and I greatly appreciate your continued dedication to this repo.

Thank you once again for all your hard work and contributions. I look forward to collaborating with you on future endeavors! Warm regards,

SaranshBaniyal commented 9 months ago

@bhargavnova I have one doubt, do we have to generate the .enc file for encryption, as I am able to overwrite the file with encrypted data and then upon entering the key/password the file gets overwritten with decrypted data

bhargavnova commented 9 months ago

Yes if we use a single script, that will overwrite the data,

so I think you should follow this approach,

ask for the password, if the file exists without .enc, then encrypt the file and make .enc file, the old file will be removed,

If the .enc file exists, then the script will try to decrypt that file, using password provided by the user,

Hope this helps, Fill free to ask any doubts you have. @SaranshBaniyal

In short every time scripts gets run, it will ask for the password from the user, and depending on which file exists, script will know what whether perform decryption or encryption

SaranshBaniyal commented 9 months ago

Thanks, got it PS: Sorry for the delay, kinda stuck in college exams

SaranshBaniyal commented 9 months ago

Hey @bhargavnova, I have opened a PR #58 please review it and suggest any modifications if required

bhargavnova commented 9 months ago

Hi @SaranshBaniyal, Thank you for your contribution :),

You can check on other open issues or you can also submit your own code, Happy Coding!