sanctuary-zero icon indicating copy to clipboard operation
sanctuary-zero copied to clipboard

Make use of Base64 encoding while transferring messages

Open gridhead opened this issue 3 years ago • 13 comments

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.

gridhead avatar Sep 25 '20 04:09 gridhead

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

ShubhamPalriwala avatar Sep 25 '20 06:09 ShubhamPalriwala

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

gridhead avatar Sep 25 '20 07:09 gridhead

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:

gridhead avatar Sep 29 '20 18:09 gridhead

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?

varolbora5 avatar Oct 13 '20 23:10 varolbora5

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.

gridhead avatar Oct 14 '20 05:10 gridhead

@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

ShubhamPalriwala avatar Oct 14 '20 07:10 ShubhamPalriwala

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

varolbora5 avatar Oct 14 '20 08:10 varolbora5

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

ShubhamPalriwala avatar Oct 14 '20 11:10 ShubhamPalriwala

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.

gridhead avatar Oct 14 '20 13:10 gridhead

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 avatar Oct 16 '20 11:10 vinmay

@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 ?

vinmay avatar Oct 16 '20 13:10 vinmay

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 avatar Oct 16 '20 15:10 gridhead

@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.

gridhead avatar Oct 16 '20 15:10 gridhead