gridhead / sanctuary-zero

A command-line bound implementation of secure synchronous lightweight chatroom with zero logging and total transience built using WebSockets, Fernet Cryptography, Asyncio and Prompt Toolkit
GNU General Public License v3.0
57 stars 34 forks source link

Make use of Base64 encoding while transferring messages #21

Open gridhead opened 4 years ago

gridhead commented 4 years ago

Base64 does add a bit of redundancy due to padding but it is a much safer and robust way to transfer messages over the network.

ShubhamPalriwala commented 4 years ago

Hey ! This might be a long shot but I'd like to try and resolve this issue out.

gridhead commented 4 years ago

Cool. I am assigning you this issue. Happy Hacktoberfest! :smile: (Take this. It might come handy)

gridhead commented 4 years ago

Hi @ShubhamPalriwala, Be sure to get yourself registered at https://organize.mlh.io/participants/events/4659-hack-astrosonic, our official Hacktoberfest event to stay in touch with the fellow contributors of this project.

Also, feel free to leave a star on the project - should you find it worth your time. Happy hacking! :smile:

varolbora5 commented 4 years ago

Hi! I'm seeing the first person to be assigned haven't really done much or at least didn't put a pull request through, could you assign me too?

Edit: Do you want anything that goes through the server to be encoded or only messages users send?

gridhead commented 4 years ago

Hi @varolbora5. thanks for expressing your interest in the issue. You could tag the assignee to see if they are interested to continue and if not, I can have unassigned in favour for your assignment.

ShubhamPalriwala commented 4 years ago

@varolbora5 am still trying to figure which layers require the encoding, if you would also like to do it, let both of us do and whosoever does it first, gets to make a PR. What do you say?

If @t0xic0der is okay with this

varolbora5 commented 4 years ago

@ShubhamPalriwala It's ok for me But I should warn you, I already figured out what to do

ShubhamPalriwala commented 4 years ago

As far as it helps @t0xic0der am happy for you, just warning you, I might be writing my own Base64 algo too! lol jk

gridhead commented 4 years ago

As far as it helps @t0xic0der am happy for you, just warning you, I might be writing my own Base64 algo too! lol jk

I'm afraid it might not be needed for a simple project like this. We are preferring utility over innovation when it comes to this issue.

@varolbora5 am still trying to figure which layers require the encoding, if you would also like to do it, let both of us do and whosoever does it first, gets to make a PR. What do you say?

If @t0xic0der is okay with this

Sounds good to me.

@ShubhamPalriwala It's ok for me But I should warn you, I already figured out what to do

Feel free to make a PR.

vinmay commented 3 years ago

hey @t0xic0der, I have a change ready for this ! I did not know about the assignment. Let me know if you want me to keep my PR open.

vinmay commented 3 years ago

@t0xic0der There is one issue I see here when we are trying to encode the messages specifically. When we are encoding the message, it will be converted into bytes, so the approach would be to encode, not just the message but the whole json. This will be in contention with the cphrsuit.cphrsuite requires a str and not bytes. Are we thinking of replacing cphrsuite as well ?

gridhead commented 3 years ago

hey @t0xic0der, I have a change ready for this ! I did not know about the assignment. Let me know if you want me to keep my PR open.

Keep it open for now. If the assignee does not meet the requirements then I might just assign you and begin reviewing your pull request.

gridhead commented 3 years ago

@t0xic0der There is one issue I see here when we are trying to encode the messages specifically. When we are encoding the message, it will be converted into bytes, so the approach would be to encode, not just the message but the whole json. This will be in contention with the cphrsuit.cphrsuite requires a str and not bytes. Are we thinking of replacing cphrsuite as well ?

One way to approach this would be to typecast the JSON object to string, and then converting those strings to bytes. I am open to suggestions though if the aforementioned approach makes it slow.