This is called eavesdropping or (in some circles) packet snarfing. Once the host has copies of all the frames it desires, it can then analyse them to discover the data they contain.
Most data transfers across the Internet are not encoded (or encrypted) in any way -- the data is simply sent as plain text. Thus it is simple to observe messages transmitted by others. This is the origin of the (oft repeated, and generally true) assertion that "The Internet is insecure". The solution is encryption -- encoding the message so that it is unintelligible to the intruder.
An area where this insecurity can present a serious problem is password authentication. Many application protocols (eg Telnet, POP3, etc) send their usernames and passwords across the network as plain text, exactly the same as other data -- ie, unencrypted. You need to always be aware of this possibility!Encryption is a vast technical, scientific and political topic, tightly intertwined with the history of computing itself. We will look briefly at a few aspects in this lecture and the next.
The security of the ciphertext depends on:![]()
There are many examples of this technique. Most fall into the general category of monoalphabetic substitution, where the output alphabet is the same as the input. For example, in the classic Caesar Cipher, letters of the alphabet were shifted by 3 positions, hence a becomes D, b becomes E, etc. A more complex example:
hence bad is encrypted as WQR.plaintext: a b c d e f g h i j k l m n o p q r s t u v w x y z ciphertext: Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
This type of cipher turns out to be relatively easy to break, despite
the huge (26!
) keyspace, by using known statistical
characteristics of English (or other languages), eg:
Exclusive-OR
(or
XOR
function is worth examining as a simple example
of a symmetric encryption method. XOR
is a
bitwise (or Boolean) operator, with the following
truth table:
Most programming languages provide an
A
B
A XOR B
0
0
0
0
1
1
1
0
1
1
1
0
XOR
function.
To "encrypt" (for example) a byte of data, we could do (in Java, all
variables of Java primitive type "byte
"):
The symmetric aspect ofcipher = plainText ^ key;
XOR
comes
from the fact that to recover the plain text, we can simply repeat the
operation on the ciphertext:
Symmetic encryption and decyption (ie, using the same algorithm and key to both encrypt and decrypt) is a characteristic of all "single-key" encryption systems, unlike "Public Key" systems, see next lecture. TheplainText = cipher ^ key;
XOR
function is used one component among many in
"Real World" encryption algorithms.
Hence, the ciphertext is:![]()
Neither substitution nor transposition ciphers are regarded as secure for any serious use. The modern approach is to use basically the same ideas as these, but with much more complex algorithms (see DES, later).eatitnihmexnetmgmedt
For example, convert both the plaintext and the key to bit strings
(which will be, necessarily, of the same length). Apply the
XOR
function function bitwise between the strings,
giving the ciphertext. The recipient can then apply the same key to the
ciphertext using XOR
function and thus recover the
original plaintext.
This is, in every respect, unbreakable, but rather impractical for real-world use in most cases. Some reasons:
Neverthless, see s/key
for a practical, working
example of a one-time pad system.
XOR
function to combine them with the key.
The effectiveness of DES is based on the complexity of the 19 stages. In the above diagram, two identical 64-bit plaintexts will result in identical ciphertexts. This is called the Electronic Code Book (ECB) mode of operation.
In the Chain Block Cipher (CBC) mode, each block of plaintext is exclusive-ORed with the ciphertext output from the previous encryption operation. Thus, the next block of ciphertext is a function of its corresponding plaintext, the 56-bit key and the previous block of ciphertext. Identical blocks of plaintext no longer generate identical ciphertext, which makes this system much more difficult to break.
The CBC mode of DES is the normal technique used for encryption in modern business data communications.![]()
DES has always been controversial: