Author: Mike Hearn 2012-12-03 21:28:13
Published on: 2012-12-03T21:28:13+00:00
The author suggests that migrating to textual representations of data structures would be preferable to binary ones, as most successful internet standards are based on text. However, several binary protocols have also been successful, such as TCP, IP, PNG, JPEG, MP3, DNS, SSH, SSL, and the Bitcoin protocol. The author argues that some text-based protocols have suffered serious problems due to their choice, such as SMTP's absurd design that prevents starting a paragraph with the word "From" and file attachments growing by 33% when sent. Additionally, header splitting attacks can lead to various exploits in web servers.The author contends that trying to represent something binary as text is pointless because the data structures consist of fundamentally binary things like keys, signatures, hashes, and certificates. Base64 encoding would be necessary, creating an inefficient binary protocol that masquerades as text. Such a protocol would possess the disadvantages of both binary and text protocols without the advantages of either.Although protocol buffers have a text form that you can print to and parse from, the author notes that people mainly use this support for debug prints or to load hand-written config files directly into protobuf generated objects.
Updated on: 2023-06-06T08:39:11.259150+00:00