Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AES Encryption and Decryption #351

Open
sam14243 opened this issue Oct 20, 2024 · 13 comments
Open

AES Encryption and Decryption #351

sam14243 opened this issue Oct 20, 2024 · 13 comments

Comments

@sam14243
Copy link

sam14243 commented Oct 20, 2024

Is your feature request related to a problem? Please describe.
There is a need for a secure way to encrypt and decrypt files for safe storage.

Describe the solution you'd like
Python scripts that implement AES encryption and decryption for files with a key.

Describe alternatives you've considered
While online tools exists, they require users to trust third-party services with their files.

Please assign me this issue for hacktoberfest. Thanks!

@hc671123
Copy link

Hi a few questions regarding your issue:

  1. In which mode would you like to operate AES (GCM, ECB, etc.)?
  2. Would you like to use an existing library like pycryptodomex or build the implementation from scratch?

If you are fine with using a library like pycryptodomex it should not take long to code a small script which en- and decrypts files...

@sam14243
Copy link
Author

sam14243 commented Oct 24, 2024

Hi,
I have built an implementation from scratch which encrypts block by block(so technically in ECB mode). If some other mode is preferred, i can code a script using the libraries as mentioned.

@hc671123
Copy link

Hi,
Thanks for your fast reply!
If you want the Script to encrypt files with good crypto, I would recommend using AES-GCM as it is safer than AES-ECB and also ensures data integrity...
But if you want the script to be a bit more educational I would find a from scratch implementation very nice as one may better understand what's going on.

I wish you all a great day

@hc671123
Copy link

Another Idea: If you want you could maybe let the user decide which Mode he wants to use...
If you want I can also give you an implementation of AES-GCM 256 Bit with pycryptodomex I implemented a while ago.

@sam14243
Copy link
Author

sam14243 commented Oct 24, 2024

Hi again,
This repo is mainly for automating tasks right, So I guess using the library(in GCM mode) and letting the user decide will be the best option here. Also, I am trying to read a file(basically input file and not text), encrypt it and store the encrypted file. If you could provide me with AES-GCM 256 code, I'll modify it to add the other implementation(128 and 192) as well. Let me know what you think!

@sam14243
Copy link
Author

Also, can any of the maintainers assign me this issue pls? Thanks!

@hc671123
Copy link

Hi,
Sounds good, I'll make a public repo with the Code and link it when im done with it. I'll just double check everything and translate my comments into English. I suppose it will be ready by the 27th... I'll also add a README with some thinks to consider regarding AES GCM in general and my implementation in particular

@sam14243
Copy link
Author

sam14243 commented Oct 25, 2024

Sounds good, btw @hc671123, are you a maintainer of this repo or you want to contribute to this issue(in general or for hacktoberfest)?

@hc671123
Copy link

hc671123 commented Oct 25, 2024

I am not a maintainer but I'll contribute on another Issue and I'll give you the AES GCM Code... I could also contribute to this issue but in the moment I dont have much free time

@sam14243
Copy link
Author

Ah, alright cool, I'll work on this issue then

@sam14243
Copy link
Author

Hi, @DhanushNehru, can you pls review the problem and assign me this issue?

@hc671123
Copy link

Hi again,
My implementation is in this Repo: https://github.com/hc671123/AES_GCM_Python

some ideas I just had regarding the file encryption / decryption: Maybe it would be nice to have some kind of Key Managment System, which ensures that maybe every file has its own key and a deterministic nonce which increments with changes to the file?! And maybe one could add a possibility to encrypt a file with a password using a key derivation function or by encrypting the key with the password with Vigenere or something like that... But these are just ideas I had you can also take a completely different approach!

If you have any questions regarding my implementation you are free to ask them anytime and I wish you a pleasant day!

@sam14243
Copy link
Author

Hi there, thanks for the implementation! For now, let's implement the basic script and later we can add these ideas. I'll complete my part now. Have a good day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants