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

Implement AES encryption on strings passed into the cipher. #3

Closed
M4cs opened this issue Dec 9, 2019 · 7 comments
Closed

Implement AES encryption on strings passed into the cipher. #3

M4cs opened this issue Dec 9, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@M4cs
Copy link
Owner

M4cs commented Dec 9, 2019

In order to make this more cryptographically secure we should implement some sort of AES standard into the strings that are encrypted and add that to the encryption and decryption functions respectively.

@M4cs M4cs added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Dec 9, 2019
@TotallyNotChase
Copy link
Contributor

Hello again!
A few questions regarding how you'd like the AES encryption to be implemented:-

  • Do you want the string to be encrypted before this try block but inside encrypt_w_user_key?
    image
  • Do you want to implement a manual AES algorithm using matrices or am I allowed to import the Pycrypto module?
  • We have to store the AES key somewhere, for the sake of organization, is it ok to store it in the key_image?

@M4cs
Copy link
Owner Author

M4cs commented Dec 10, 2019

I think the Crypto module should work for this. And yes before that try block would be the best place i think as that try block is really just ciphering the message into the pixel map. I think we should also store the AES key in key_image or re-write the base_key generator to better create a cipher for the user and keep their AES key private.

@M4cs
Copy link
Owner Author

M4cs commented Dec 10, 2019

p.s Glad to see you around again @TotallyNotChase always appreciate your PRs ;)

@M4cs M4cs pinned this issue Dec 10, 2019
Repository owner deleted a comment Dec 11, 2019
@TotallyNotChase
Copy link
Contributor

So, a little progress update, I was reading into AES encryption and according to its standards, we'll need an initialization vector that is different each encryption. This means we can't store it in the user_key. I'm thinking of generating the primary AES key in the user_key but I'm not sure about the initialization vector, any suggestions?

also sorry for the massive delay, a bit busy this week but I highly advise leaving the library unchanged. Expect a PR by 12th dec :)

@M4cs
Copy link
Owner Author

M4cs commented Dec 11, 2019

All good! I will not be touching it until you make your PR as you always seem to have great refactoring changes to go along with your logical changes.

As for the initialization vector I think we can generate one using this: random.read(AES.block_size) using the PyCrypto module but this is off memory so I'm not sure.

@M4cs
Copy link
Owner Author

M4cs commented Dec 11, 2019

I've assigned this ticket to you @TotallyNotChase, it seems you are going to be taking this on and I'm excited to see the PR you come up with. Always appreciated.

@M4cs
Copy link
Owner Author

M4cs commented Dec 11, 2019

This gist looks like a good reference point for generating AES encrypted strings and decrypting: https://gist.github.com/mborgerson/9847638

EDIT: Disclaimer!! Be careful for vulnerabilities in stream cipher attacks if using this method of AES or any AES Stream Ciphers for that matter. I'll review during code review of your PR but i would still check to make sure while self-reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants