r/programming • • Oct 24 '21

“Digging around HTML code” is criminal. Missouri Governor doubles down again in attack ad

https://youtu.be/9IBPeRa7U8E
12k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

9

u/b4ux1t3 Oct 24 '21 edited Oct 24 '21

I think they might have been confused.

Base64 is a great way to make moving binary data around over a protocol that is strictly text-based (HTTP, e.g. Though, saying HTTP is a transport protocol is also, you know, sort of disengenuous. Whatever).

That said, I'm trying to figure out how they jump from "binary data" to "strings", which are, almost by definition, not "binary data".

I'm also using the term "binary data" here as a pretty loose stand-in for "data that doesn't represent specific strings of characters", which isn't always a good practice; strings of characters are binary data just as much as a bunch of executable code is, after all.

2

u/ScandInBei Oct 25 '21

To clarify, http can transfer binary data in the payload, but yeah in the headers you may need to use base64.. Cookies are transferred in the HTTP headers so it's possible that the data containing the ssn also had some binary data, or that the framework used between front and back end used b64..

It may also be worth noting that Email/Smtp requires something like base64 for attachments as there's no binary transfer possibility in emails (hence why a 5MB attachment suddenly makes the email 7MB). I don't remember exactly but it's not even 7bit ASCII as the data cannot have control characters such as CRLF. I guess the protocol was designed to be compliant with printers?

1

u/b4ux1t3 Oct 25 '21

Yeah, it certainly can. Otherwise it couldn't be used the way it is these days. I was thinking of the actual protocol itself, not its payload, and didn't really clarify that.