Plain text vs binary

ukejoe

I'm a bit confused when I read that information is sent in plain text over the internet. I thought all data was sent as binary data-- e.g. a webserver like Django returns bytes, not strings. What am I missing?

tadman

What you're missing is that "plain text" is just a series of bytes. In general terms bytes are "binary data" but a subset of binary data is "ASCII-encoded human readable text" which is what we refer to as plain-text.

IP itself has some framing, headers, flags and what have you, that's not plain-text, but the payload of a TCP/IP packet for a plain-text protocol like SMTP or HTTP is easy to read.

You can always use a tool like tcpdump or Wireshark to dump out packets and see what's inside. There's many examples of how this plays out where the binary data looks like this:

0x0000:  4520 0054 882b 0000 3001 7cf5 45fe d52b  E..T.+..0.|.E..+
0x0010:  4815 222a 0800 3530 272a 0000 25ff d744  H."..50'..%..D
0x0020:  ae5e 0500 0809 0a0b 0c0d 0e0f 1011 1213  .^..............
0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
0x0050:  3435 3637                                4567

In the middle is the hex representation of the data. On the right is the plain-text expression of same. You can see at the end it's just ASCII data even if the earlier bits look like garbage.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related