Classical Cryptography
Classical Cryptography
CRYPTOGRAPHY
WHAT IS CRYPTOGRAPHY?
DONEC
THE DEFINITION
QUIS NUNC
It is the practice and study of techniques for secure communication in the presence of adversarial
behavior.
Basic aspects of information security include confidentiality, data integrity, authentication, etc.
A classical cipher is a cipher that was used in history. We do not use it anymore because it has
been badly broken.
SYSTEMATIC
REPLACEMENT
SUBSTITUTION
CIPHERS
CAESAR CIPHER
SUBSTITUTION
DONEC QUIS CIPHERS
NUNC
In Caesar cipher, each letter in the plaintext is replaced by a letter some fixed number of positions
down the alphabet.
The method is named after Julius Caesar, who used it in his private correspondence.
For example, if the key we use to encrypt is 3, then all the letters in the standard alphabet
will shift left for 3 positions.
Each letter in the plaintext will be replaced by the corresponding cipher letter. If we want
to encrypt “THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG” under the
same key, we will get “QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD”.
We can do the encryption by converting each letter in the keyword into a value between 0 & 25,
and use the values as keys for Caesar cipher operation. For convenience, we can also just use the
Vigenere table.
For example, if our plaintext is “THE QUICK BROWN FOX” and the keyword is
“LEMON”, we first convert the keyword into numbers.
“LEMON” gives 11 04 12 14 13. Then we do Caesar cipher according to these key values.
Plaintext: T H E Q U I C K B R O W N F O X
Right Shift: 11 04 12 14 13 11 04 12 14 13 11 04 12 14 13 11
Ciphertext: E L Q E H T G W P E Z A Z T B I
ASCII is the abbreviation of American Standard Code for Information Interchange. ASCII code is
actually used to represent text in computers and other devices, so people do not usually consider it
as a cipher.
However, ASCII code satisfies a popular, public imagination of ciphers and coding, so it is widely
used in webpage puzzles as a substitution cipher.
Most of the time, it is in the form of binary, hexadecimal, or decimal. Hexadecimal form is more
common because it can fit into modern encryption algorithms well.
MORSE CODE
SUBSTITUTION
DONEC QUIS CIPHERS
NUNC
Morse code is named after Samuel Morse, one of the inventors of the telegraph.
Nowadays, Morse code is also a toy substitution cipher which is used in many puzzles.
SCRAMBLED ORDER
TRANS-
POSITION
CIPHERS
COLUMNAR CIPHER
TRANSPOSITION
DONEC QUIS NUNC
CIPHERS
In a columnar transposition, the message is written out in rows of a fixed length, and then read out
again column by column, and the columns are chosen in some scrambled order.
A keyword is involved to determine the length of each row, and the order of reading off columns is
the alphabetical order of each letter in the keyword.
Our plaintext is still “THE QUICK BROWN FOX” and our key is “LEMON”.
L E M O N
11 04 12 14 13
T H E Q U
I C K B R
O W N F O
Rail fence cipher is named from the way in which it is encoded. In the rail fence cipher, the
plaintext is written downwards and diagonally on successive "rails" of an imaginary fence, then
moving up when we get to the bottom. The message is then read off in rows.
T———U———B———N———J———S———R———L———D——
— H—Q— I —K—R—W—F—X—U—P—O—E—T—E—A—Y—O —
——E———C———O———O———M———V———H———Z———G
We get “TUBNJSRLDHQIKRWFXUPOETEAYOECOOMVHZG”.
INSECURITY OF
CLASSICAL CIPHERS
ATTACKS
FREQUENCY ANALYSIS
DONEC
ATTACKS
QUIS NUNC
Frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The
method is used as an aid to breaking classical ciphers, especially substitution ciphers.
Frequency analysis is based on the fact that, in any given stretch of written language, certain
letters and combinations of letters occur with varying frequencies. Moreover, there is a
characteristic distribution of letters that is roughly the same for almost all samples of that
language.
If the adversary compares the frequency distribution in the ciphertext with the distribution in some
language, the relationship between substitutes and the original letters will be revealed.
BRUTE-FORCE ATTACK
DONEC
ATTACKS
QUIS NUNC
Many classical ciphers have a small key space or message space. Hence, an adversary can just take
some time and simply guess out the correct key or plaintext by using trial-and-error method.
For Caesar cipher, the key is always within the range between 1 and 25, only a short period is
needed for finding the key by guessing.
For transposition ciphers, the adversary can rearrange the letters several times to find the correct
combination of letters and get the plaintext.
Even for the “complicated” Vigenere cipher, there is a way to break it as long as the key length is
given. You can think about it when you have time.
SPARE-TIME ACTIVITY
REFERENCE
&A
RECOMMENDED
APP
THE GUIDES
THEDONEC
RECOMMENDED
QUIS NUNCAPP