Cryptography is the art of writing ("graph") in a hidden or obscured ("crypto") manner. On this page we will provide a basic introduction to the basic ideas and techniques. We will cover:

Content being prepared - please feel free to provide a brief and simple outline for any of the above.

Steganography

Steganography is the act of hiding a message, but not necessarily scrambling it or otherwise making any attempt to render it unreadable when found. A classic example from antiquity was to shave a slave's head, tattoo the message on his scalp, wait for the hair to grow back, then send him to the intended recipient.

Patience was required.

Another example is changing the least significant bit in each byte that represents a colour in an image. Alternatively, in a large image, specific pixels can be replaced by a different colour that represents a letter or cluster of letters. The changes go unnoticed, but the message is clear to read if you know where to look.


Caeser Cipher

How it works

In this case, each letter in a message is replaced by the letter that occurs three letters later in the alphabet, wrapping around if necessary. For example,
  • This is a message
becomes
  • Wklv lv d phvvdjh

Breaking it

The amount of shift can be changed, but it's not hard to check all 25 options for the amount of shift, so it's not hard to break.


Substitution Cipher

How it works

For the Substitution cipher we don't simply replace each letter with a letter from a fixed distance away, we choose some scrambling of the alphabet, so that "a" gets replaced by "v" (for example), and "e" gets replaced by "g" (for example) and so on. The "key" to decoding this cipher is some sort of chart of replacements.

Breaking it

The letter "E" occurs about 13% of the time in English text, so by counting how often each letter occurs in the cipher text we can try to deduce which letter represents "E". This is called Frequency Analysis.


Viginere Cipher

How it works

The Viginere Cipher is a variant of the Caeser Cipher, but it uses multiple amount of shift. For some key length (for example five) it uses one shift for the first letter, a different shift for the next letter, another for the third, fourth and fifth, and then starts over again. The amount of shift is usually encoded in a key word. For example, using the keyword CIPHER we can use a shift of 3 for the first letter (because "C" is the third letter of the alphabet), then 9 for the second letter (because "I" is the ninth letter), then 16, 8, 5 and finally 18. Then we start over.

This can easily be summarised in an appropriate table.

Breaking it

Not easy. Given enough cipher text, however, it's usually possible to find repeated strings. The distance between a repeated string is almost always a multiple of the key length, so finding enough of them allows one to guess that.

Given the key length we can then do frequency analysis on every $k^{th}$ letter, treating it as interleaved substitution ciphers,which it is.


The Enigma Machine

The Enigma Machine was a special mechanism that took Substitution Ciphers to an entirely new level. The machine was set up with a specific scrambling, and then the first letter of the message was encoded.
Note: the progression of one scrambling to the next did not rely on the letter being encoded.
The act of encoding the letter then caused the mechanism to advance to a new scrambling for the next letter, and so on.

One truly clever thing about the Enigma Machine was that each scrambling had a particular characteristic - the letters came in pairs. If "X" was encoded as "Y", then "Y" was encoded as "X". This meant that setting up the machine in the same way and sending through the encoded message resulted in the original message coming out. Thus the receiver could decode as easily as the sender encoded. The system was symmetric.

Symmetric ciphers

For many codes, knowing how to encode requires knowing the method and a key. For example, to encode using the substitution cipher you need to know the particular table of replacements to use. This then automatically implies knowing how to decode. A cipher in which knowledge of how to encode automatically implies knowledge of how to decode is called a symmetric cipher.

A significant result in the mid 20th century was the unexpected discovery of cipher systems for which this is not true - so-called "non-symmetric ciphers" or "asymmetric ciphers."

Asymmetric ciphers

E.g. RSA or DHMW.


Last change to this page
Full Page history
Links to this page
Edit this page
  (with sufficient authority)
Change password
Recent changes
All pages
Search