Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Round 1 Guidebook:

This guidebook contains instructions on how to use the


ciphers/codes that will be tested in Round 1.
Caesar cipher:

The Caesar cipher, also known as a shift cipher, is one of the simplest forms of encryption. It is a substitution cipher
where each letter in the original message (called the plaintext) is replaced with a letter corresponding to a certain
number of letters up or down in the alphabet.

In this way, a message that initially was quite readable, ends up in a form that can not be understood at a simple
glance.

For example, here's the Caesar Cipher encryption of a message, using a right shift of 3.

Plaintext:

THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG

Ciphertext:

QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD

Note: To decrypt, we use left shifts (shift backwards).


Caesar’s cipher is identical to the cipher called ROT(n), where n represents the number of the shift.

Decimal (Base 10) to Binary (Base 2):

Let's look at base-two, or binary, numbers. How would you write, for instance, 12 10 ("twelve, base ten") as a binary
number? You would have to convert to base-two columns, the analogue of base-ten columns. In base ten, you have
columns or "places" for 100 = 1, 101 = 10, 102 = 100, 103 = 1000, and so forth. Similarly in base two, you have
columns or "places" for20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, and so forth.
The first column in base-two math is the units column. But only "0" or "1" can go in the units column. When you get
to "two", you find that there is no single solitary digit that stands for "two" in base-two math. Instead, you put a "1"
in the twos column and a "0" in the units column, indicating "1two and 0 ones". The base-ten "two" (2 10) is written
in binary as 102.

A "three" in base two is actually "1 two and 1 one", so it is written as 11 2. "Four" is actually two-times-two, so we
zero out the twos column and the units column, and put a "1" in the fours column; 4 10 is written in binary form
as 1002. Here is a listing of the first few numbers:

decimal binary
(base 10) (base 2)
0 0 0 ones
1 1 1 one
2 10 1 two and zero ones
3 11 1 two and 1 one
4 100 1 four, 0 twos, and 0 ones
5 101 1 four, 0 twos, and 1 one
6 110 1 four, 1 two, and 0 ones
7 111 1 four, 1 two, and 1 one
8 1000 1 eight, 0 fours, 0 twos, and 0 ones
9 1001 1 eight, 0 fours, 0 twos, and 1 one
10 1010 1 eight, 0 fours, 1 two, and 0 ones
11 1011 1 eight, 0 fours, 1 two, and 1 one
12 1100 1 eight, 1 four, 0 twos, and 0 ones
13 1101 1 eight, 1 four, 0 twos, and 1 one
14 1110 1 eight, 1 four, 1 two, and 0 ones
15 1111 1 eight, 1 four, 1 two, and 1 one
16 10000 1 sixteen, 0 eights, 0 fours, 0 twos, and 0 ones

Converting between binary and decimal numbers is fairly simple, as long as you remember that each digit in the
binary number represents a power of two.

Convert 1011001012 to the corresponding base-ten number.

I will list the digits in order, and count them off from the RIGHT, starting with zero:

digits: 1 0 1 1 0 0 1 0 1
numbering: 8 7 6 5 4 3 2 1 0

The first row above (labelled "digits") contains the digits from the binary number; the second row (labelled
" numbering") contains the power of 2 (the base) corresponding to each digits. I will use this listing to
convert each digit to the power of two that it represents:

1×28 + 0×27 + 1×26 + 1×25 + 0×24 + 0×23 + 1×22 + 0×21 + 1×20

= 1×256 + 0×128 + 1×64 + 1×32 + 0×16 + 0×8 + 1×4 + 0×2 + 1×1

= 256 + 64 + 32 + 4 + 1

= 357

Then 1011001012 converts to 35710


Binary to ASCII:
Binary to ASCII is fairly simple once you get binary. Know that certain numbers in decimal (base 10) when
converted to binary (base 2) can represent specific characters such as letters in ASCII. Use the table below for
Binary to ASCII conversions.

ASCII ASCII
Letter Binary Letter Binary
Code Code
a 097 01100001 A 065 01000001
b 098 01100010 B 066 01000010
c 099 01100011 C 067 01000011
d 100 01100100 D 068 01000100
e 101 01100101 E 069 01000101
f 102 01100110 F 070 01000110
g 103 01100111 G 071 01000111
h 104 01101000 H 072 01001000
i 105 01101001 I 073 01001001
j 106 01101010 J 074 01001010
k 107 01101011 K 075 01001011
l 108 01101100 L 076 01001100
m 109 01101101 M 077 01001101
n 110 01101110 N 078 01001110
o 111 01101111 O 079 01001111
p 112 01110000 P 080 01010000
q 113 01110001 Q 081 01010001
r 114 01110010 R 082 01010010
s 115 01110011 S 083 01010011
t 116 01110100 T 084 01010100
u 117 01110101 U 085 01010101
v 118 01110110 V 086 01010110
w 119 01110111 W 087 01010111
x 120 01111000 X 088 01011000
y 121 01111001 Y 089 01011001
z 122 01111010 Z 090 01011010

Using the table above if I wanted to convert the word “Hello” to binary, the outcome would be:

01001000 01100101 01001100 01001100 01001111

A 00100000 represents a space.


ADFGX Cipher:
After the invention of the telegraph, it was now possible for individuals to communicate across entire countries
instantaneously using Morse code. Unfortunately, it was also possible for anyone with the right equipment
to wiretap a line and listen in on exchanges. Moreover, most people had to rely on clerks to encode and decode
messages, making it impossible to send plaintext clandestinely. Once again, ciphers became important.

Germany created a new cipher based on a combination of the Polybius checkerboard and ciphers using key words.
It was known as the ADFGX cipher, because those were the only letters used in the cipher. The Germans chose
these letters because their Morse code equivalents are difficult to confuse, reducing the chance of errors.

The first step was to create a matrix that looked a lot like the Polybius checkerboard:

A D F G X
A A B C D E
D F G H I/J K
F L M N O P
G Q R S T U
X V W X Y Z
Cryptographers would use pairs of cipher letters to represent plaintext letters. The letter's row becomes the first
cipher in the pair, and the column becomes the second cipher. In this example, the enciphered letter "B" becomes
"AD," while "O" becomes "FG." Not all ADFGX matrices had the alphabet plotted in alphabetical order.

Next, the cryptographer would encipher his message. Let's stick with "How Stuff Works." Using this matrix, we'd
get "DFFGXD GFGGGXDADA XDFGGDDXGF."

The next step was to determine a key word, which could be any length but couldn't include any repeated letters.
For this example, we'll use the word DEUTSCH. The cryptographer would create a grid with the key word spelled
across the top. The cryptographer would then write the enciphered message into the grid, splitting the cipher pairs
into individual letters and wrapping around from one row to the next.

D E U T S C H
D F F G X D G
F G G G X D A
D A X D F G G
D D X G F
Next, the cryptographer would rearrange the grid so that the letters of the key word were in alphabetical order,
shifting the letters' corresponding columns accordingly:

C D E H S T U
D D F G X G F
D F G A X G G
G D A G F D X
D D F G X
He would then write out the message by following down each column (disregarding the letters of the key word on
the top row). This message would come out as "DDG DFDD FGAD GAG XXFF GGDG FGXX." It's probably clear why
this code was so challenging -- cryptographers enciphered and transposed every plaintext character. To decode,
you would need to know the key word (DEUTSCH), then you'd work backward from there. You'd start with a grid
with the columns arranged alphabetically. Once you filled it out, you could rearrange the columns properly and use
your matrix to decipher the message.

The Vigenère Cipher:


The Vigenère cipher, was invented by a Frenchman, Blaise de Vigenère in the 16th century. It is a polyalphabetic
cipher because it uses two or more cipher alphabets to encrypt the data. In other words, the letters in the Vigenère
cipher are shifted by different amounts, normally done using a word or phrase as the encryption key. Unlike the
monoalphabetic ciphers, polyalphabetic ciphers are not susceptible to frequency analysis, as more than one letter
in the plaintext can be represented by a single letter in the encryption.

The Vigenère Square: Blaise de Vigenère developed a square to help encode messages. Reading along each row, you
can see that it is a really a series of Caesar ciphers the first has a shift of 1, the second a shift of 2 and so.

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

A 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

B 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 A

C C D E F G H I J K L M N O P Q R S T U V W X Y Z A B

D D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D

F F G H I J K L M N O P Q R S T U V W X Y Z A B C D E

G G H I J K L M N O P Q R S T U V W X Y Z A B C D E F

H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G

I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H

J J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K K L M N O P Q R S T U V W X Y Z A B C D E F G H I J

L L M N O P Q R S T U V W X Y Z A B C D E F G H I J K

M M N O P Q R S T U V W X Y Z A B C D E F G H I J K L

N N O P Q R S T U V W X Y Z A B C D E F G H I J K L M

O O P Q R S T U V W X Y Z A B C D E F G H I J K L M N

P P Q R S T U V W X Y Z A B C D E F G H I J K L M N O

Q Q R S T U V W X Y Z A B C D E F G H I J K L M N O P

R R S T U V W X Y Z A B C D E F G H I J K L M N O P Q

S S T U V W X Y Z A B C D E F G H I J K L M N O P Q R

T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S

U U V W X Y Z A B C D E F G H I J K L M N O P Q R S T

V V W X Y Z A B C D E F G H I J K L M N O P Q R S T U

W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V

X X Y Z A B C D E F G H I J K L M N O P Q R S T U V W

Y Y Z A B C D E F G H I J K L M N O P Q R S T U V W X

Z Z 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

The Vigenère cipher uses this table in conjunction with a key to encipher a message.

So, if we were to encode a message using the key COUNTON, we write it as many times as necessary above our
message. To find the encryption, we take the letter from the intersection of the Key letter row, and the Plaintext
letter column.

Key C O U N T O N C O U N T O N

Plaintext V I G E N E R E C I P H E R

Encryption X W A R G S E G Q C C A S E

To decipher the message, the recipient needs to write out the key above the ciphertext and reverse the process.

Pigpen Cipher:
The Pigpen cipher is a fairly easy cipher to understand. But instead of the letters or numbers we use symbols.
The following is the code 'I am a codebreaker' using the pigpen cipher.

Although the pigpen cipher looks unintelligible, it is actually a fairly basic form of the substitution cipher. The
letters of the alphabet are written out on 4 grids.
To write your code, take the portion of the grid in which the letter you require is written. This then becomes your
code!

Example:

The symbols above decrypt to: THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
RAIL-FENCE

The rail fence cipher (also called a zigzag cipher) is a form of classical transposition Cipher. It

derives its name from the manner in which encryption is performed.

Encryption:

Rail Fence Encryption uses an integer for the number of levels of the zigzag.

The encoded message is written in zig-zag (like a rail fence/sawtooth) along a path

with N levels/floors.

Encrypt DCODEZIGZAG with N=3 is writing

D---E---Z--
-C-D-Z-G-A-
--O---I---G
The cipher message is read by rows. The encrypted message is DEZCDZGAOIG

Decryption:

RailFence decryption requires to know the number of levels N. Decrypt the

message DEZCDZGAOIG with N=3

Write the expected zigzag form and complete it by lines, before reading as zig zag

X---X---X--
-X-X-X-X-X-
--X---X---X

D---E---Z--
-C-D-Z-G-A-
--O---I---G
The original plain text is DCODEZIGZAG.

You might also like