Thomas Braun
Thomas Braun

Reputation: 535

WWW safe codecs for data transmission

By encoding data into base64, we can ensure that the data we transmit throughout the WWW isn't going to be mutated across its journey. If we use a simple bytes codec, it is not uncommon for data to mutate across its journey since we are in base 256 (max byte size) instead of base 64.

Are there other codecs we can use for web-safe transmission? Is CBOR relevant in this case?

Upvotes: 0

Views: 36

Answers (1)

Joni
Joni

Reputation: 111359

Base64 or any other transfer encoding is neither necessary, nor would it protect you.

The HTTP protocol, which is what is used for data transfer in www, is "8-bit safe." There is no way to specify a "content transfer encoding" like base64, like you would need with email. In HTTP you can safely transfer body content using all 256 byte values. The lower level protocol (TCP) protects the data stream from accidental modification by computing a check sum for every transmitted segment.

HTTP does not protected the data from being intentionally modified by potentially malicious "middle men". For that you need to use HTTPS which is HTTP over a secure channel.

Upvotes: 1

Related Questions