CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Simple Substitution :

Caesar Cipher : ch = (char)((ch + K) % 26);

    PT : abcdefghijklmnopqrstuvwxyz
    CT : DEFGHIJKLMNOPQRSTUVWXYZABC

Here K = 3.

Monoalphabetic Substitution :

Each symbol maps to some other symbol. The key is simply a 26 letter string from the alphabet.

    PT : abcdefghijklmnopqrstuvwxyz
    CT : QWERTYUIOPASDFGHJKLZXCVBNM

Here there are 26! = 4x1026 possible keys.

At 1msec per solution, a brute force approach would take 1013 years.

However, in English and many other natural languages, text statistics are available on the most frequently used letters, (262) digraphs, (263) trigraphs and words. To break simple codes we :

  • count frequencies of each letter and match e's, t's, etc.
  • count digraphs (th, er, on, an, re, he, in, ed, nd, ha, at, en, es, of, or...) and trigraphs (he, and, tha, ent, ion, tio, for, nde, has, nce...)
  • match th, the, in, and, ...



The movie Windtalkers focuses on the use of the natural language of Navajo Indians as a code in WWII.
Speakers of Klingon claim that their language is, for other reasons, indecipherable (in practice).


CITS3002 Computer Networks, Lecture 12, Cryptography's role in networking, p4, 22nd May 2024.