4. Ancient Ciphers
●The Scytale
○Spartan cryptographic
device
○ Wooden staff, around
which a strip of leather or
parchment is wound
○The sender writes the
message and unwinds
the the strip.
5. Ancient Ciphers (Cont)
●Caesar Shift
○Alphabet is shifted a number
of places
The image shows a Caesar shift of 13.
Plaintext: HELLO
Ciphertext: AXEEH
6. Ancient Ciphers (Cont)
●Atbash Cipher
○Substitutes each letter for it's counterpart in the alphabet.
■A->Z
■B->Y
■C->X
■etc
Plaintext: HELLO
Ciphertext: SVOOL
8. Cryptanalysis
●Mono-alphabetic substitutions
○Easily decipherable by means of frequency analysis
■Certain letters appear more often than others
Table of standard frequencies based on passages taken from newspapers and
novels (100 362 alphabetic characters)
Letter % Letter % Letter % Letter %
a 8.2 h 6.1 o 7.5 v 1.0
b 1.5 i 7.0 p 1.9 w 2.4
c 2.8 j 0.2 q 0.1 x 0.2
d 4.3 k 0.8 r 6.0 y 2.0
e 12.7 l 4.0 s 6.3 z 0.1
f 2.2 m 2.4 t 9.1
g 2.0 n 6.7 u 2.8
9. Cryptanalysis - Example
Ciphertext
PCQ VMJYPD LBYK LYSO KBXBJXWXV BXV ZCJPO EYPD
KBXBJYUXJ LBJOO KCPK. CP LBO LBCMKXPV XPV IYJKL PYDBL,
QBOP KBO BXV OPVOV LBO LXRO CI SX’XJMI, KBO JCKO XPV
EYKKOV LBO DJCMPV ZOICJO BYS, KXUYPD: ‘DJOXL EYPD, ICJ X
LBCMKXPV CPO PYDBLK Y BXNO ZOOP JOACMPLYPD LC UCM
LBO IXZROK CI FXKL XDOK XPV LBO RODOPVK CI XPAYOPL EYPDK.
SXU Y SXEO KC ZCRV XK LC AJXNO X IXNCMJ CI UCMJ SXGOKLU?’
OFYRCDMO, LXROK IJCS LBO LBCMKXPV XPV CPO PYDBLK
10. Cryptanalysis - Example (Cont)
From analysing the ciphertext we get the following frequencies
From this we can assume that
O = e, t or a
X = e, t or a
P = e, t or a
Letter % Letter % Letter % Letter %
A 0.9 H 0.0 O 11.2 V 5.3
B 7.4 I 3.3 P 9.2 W 0.3
C 8.0 J 5.3 Q 0.6 X 10.1
D 4.1 K 7.7 R 1.8 Y 5.6
E 1.5 L 7.4 S 2.1 Z 1.5
F 0.6 M 3.3 T 0.0
G 0.3 N 0.9 U 1.8
11. Cryptanalysis - Example (Cont)
Next we determine how much O,X and P neighbour other
characters. If a letter tends to be shy of others, it is usually a
consonant.
ABCDEFGHIJKLMNOPQESTUVWXYZ
O 19031110146012280410030112
X 07011110246303190240332001
P 105600000112208000000110990
From this we determine P is a consonant. Now the question is
O=e and X=a or O=a and X=e?
Analysis shows that OO appears twice and XX does not
appear. Also X appears on it's own, thus we can assume
that X=a and O=e. The only other letter that appears on
it's own is Y, thus we assume Y=i.
12. Cryptanalysis - Example (Cont)
As can be seen on the previous slide, each letter in the English
language has it's own "personality".
For example, the letter h frequently goes before the letter e
(the, then, there, they, etc.), but rarely after e.
We know that O=e, thus we need to check which letter appears
most often before O. From this we can determine that B=h.
Thus far we have O=e, X=a, Y=i, B=h.
13. Cryptanalysis - Example (Cont)
PCQ VMJiPD LhiK LiSe KhahJaWaV haV ZCJPe EiPD
KhahJiUaJ LhJee KCPK. CP Lhe LhCMKaPV aPV IiJKL PiDhL,
QheP Khe haV ePVeV Lhe LaRe CI Sa’aJMI, Khe JCKe aPV
EiKKeV Lhe DJCMPV ZeICJe hiS, KaUiPD: ‘DJeaL EiPD, ICJ a
LhCMKaPV CPe PiDhLK i haNe ZeeP JeACMPLiPD LC UCM
Lhe IaZReK CI FaKL aDeK aPV Lhe ReDePVK CI aPAiePL EiPDK.
SaU i SaEe KC ZCRV aK LC AJaNe a IaNCMJ CI UCMJ SaGeKLU?’
eFiRCDMe, LaReK IJCS Lhe LhCMKaPV aPV CPe PiDhLK
14. Cryptanalysis - Example (Cont)
Next we examine the 3 letter word that appear often.
Lhe and aPV, which represent the and and.
From this we have L=t, P=n and V=d.
Substituting more letters, we can start seeing words form and
allows us to build the alphabet further.
Eventually we have the complete alphabet:
abcdefghijklmnopqrstuvwxyz
XZAVOIDBYGERSPCFHJKLMNQTUW
15. Cryptanalysis - Example (Cont)
uring this time Shahrazad had borne King
ar three sons. On the thousand and first night,
he had ended the tale of Ma’aruf, she rose and
the ground before him, saying: ‘Great King, for a
d and one nights I have been recounting to you
es of past ages and the legends of ancient kings.
make so bold as to crave a favour of your majesty?’
ogue, Tales from the Thousand and One Nights
16. Vigenère Cipher
●Consists of 26 Caesar shift
ciphers
●Alternate between different
alphabets making cipher
immune to standard
cryptanalysis at the time
Suppose our code word was
CAESAR, then we would alternate between the alphabets with
Caesar shift of 2, 0, 4, 18, 0, 17.
Keyword: CAESARCAESARCAESARCAESA
Plaintext: diverttroopstoeastridge
Ciphertext: FIZWRKVRSGPJVOISSKTIHYE
17. Key distribution
Probably the biggest problem with ciphers are the fact that a
common key or secret needs to be shared between the sender
and the receiver.
18. RSA the solution to the key problem
Uses public and private keys to encrypt messages. Public key
is known to everybody, but private key is only know by the
recipient.
19. How does it work?
The simple answer: MAGIC and lot's of it.
20. No, really, how does it work?
It makes use of modular arithmetic and prime numbers.
C = Me
mod p1
p2
C is the ciphertext and M is the plaintext
p1
and p2
are prime numbers (let's say 5 and 11)
e is a number such that gcd(e, (p1
-1)x(p2
-1)) = 1 (let's say 3)
From this we can now publish our public key as p1
p2
=55 and e=3
M = Cd
mod p1
p2
d is the decryption key (private key) and is calculated the inverse to e
modulo (p1
-1)x(p2
-1) which would be 27
21. RSA Example
Let's say we wish to encrypt HI or 08 09
C = 83
mod55
= 17
C = 93
mod55
= 14
So 08 09 becomes 17 14, by only knowing the public key e=3
and p1
p2
=55
To decrypt the message
M = 1727
mod55
= 8
M = 1427
mod55
= 9
For the decryption we needed to know the private key d=27 and
p1
p2
=55
22. RSA Vulnerabilities
Having p1
p2
one can theoretically determine the values of p1
-1
and p2
-1, and from this calculate the value of d(private key).
That is why p1
and p2
are chosen to be relatively large primes,
because integer factorisation will take long using current
algorithms.
23. QKD
Quantum key distribution makes use of quantum mechanics to
guarantee a secure channel of communication.
By using quantum entanglement and transmitting information in
quantum states, it can be determined if someone is
eavesdropping.
UKZN's Center for Quantum Technology is currently testing
QKD devices from id Quantique.
QKD's are currently only used to share secret keys for
encryption algorithms, because the technology is still too slow
for data transmission.