1. CRYPTOGRAPHY
Dr Christian Bokhove
Professor in Mathematics Education
Disclaimer: I too am standing on the shoulders of giants and have made use of many
excellent resources on the web.
https://is.gd/y9crypto
2. What is it?
Cryptography – maths in service of security
Cryptanalysis – breaking cryptographic systems
3. Four functions
Confidentiality – “set of rules that limits access”
Integrity – “consistency and accuracy of
data throughout its life-cycle”
Authentication – “confirms a truth claimed
by some entity”
Non-repudiation – “ensure that the author of a piece
of information cannot deny it”
5. Origins of Cryptography
• Thought that the earliest form of cryptography was in the
Egyptian town of Menet Khufu
• The hieroglyphics on the tomb of nobleman
KHNUMHOTEP II contained unusual symbols, used to
obscure the meaning of the inscriptions.
1900 BC
Menet Khufu
Method: substitution
6. Origins of Cryptography
• The Spartans, in 5 BC,
developed a device called
a Scytale.
• A messenger would carry
a strip of parchment, which
was meaningless until it
was wrapped around a
Scytale of the same
dyameter.
• https://www.cryptool.org/en
/cto/scytale
Method: transposition
7. Caesar Cipher: c = m + 3
Caesar Shift Cipher
• Each letter was substituted by shifting n places
• Only 25 possible ciphers.
7
Julius Caesar
100 BC- 44 BC
8. Caesar Cipher
Many people will have tried this!
+m
A->C
B->D
C->E etc
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 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
Let m == 3, then the cleartext CAT
becomes the ciphertext FDW
15. Until modern times, cryptography referred almost exclusively to "encryption",
which is the process of converting ordinary information (called plaintext) into an
unintelligible form (called ciphertext).[13] Decryption is the reverse, in other words,
moving from the unintelligible ciphertext back to plaintext. A cipher (or cypher) is a
pair of algorithms that carry out the encryption and the reversing decryption. The
detailed operation of a cipher is controlled both by the algorithm and, in each
instance, by a "key". The key is a secret (ideally known only to the communicants),
usually a string of characters (ideally short so it can be remembered by the user),
which is needed to decrypt the ciphertext. In formal mathematical terms, a
"cryptosystem" is the ordered list of elements of finite possible plaintexts, finite
possible cyphertexts, finite possible keys, and the encryption and decryption
algorithms that correspond to each key. Keys are important both formally and in
actual practice, as ciphers without variable keys can be trivially broken with only the
knowledge of the cipher used and are therefore useless (or even counter-
productive) for most purposes. Historically, ciphers were often used directly for
encryption or decryption without additional procedures such as authentication or
integrity checks.
15
https://en.wikipedia.org/wiki/Cryptography
16. Vigenère
• The Vigenère cipher is a polyalphabetic cipher. The relationship
between a character in the plaintext to a character in the
cipher text is one-to-many.
• Blaise de Vigenère, a 16th century French mathematician.
• It was used in the American civil war and was once believed to
be unbreakable.
• A Vigenère cipher uses a different strategy to create the key
stream. The key stream is a repetition of an initial secret key
stream of length m, where we have 1 ≤ m ≤ 26.
• The Vigenère cipher is a method of encrypting alphabetic text
by using a series of different Caesar ciphers based on the
letters of a keyword.
• The Vigenère cipher uses multiple mixed alphabets, each is a
shift cipher.
17. Modular arithmetic
• Telling time is famously ‘modular arithmetic’.
• Can see it as arithmetic with remainders:
20 divided by 7 remainder is 6.
• The alphabet consists of 26 letters. Let’s number them 0,
1, 3, 4….., 25.
• What if I would do B+C?
That would be 1+2=3 and that’s D.
• What if I do R+T? That’s 17+19 = 36.
• But the alphabet doesn’t go that high, so start counting
from 0 again after 25, so that’s 10, or K.
• This is arithmetic ‘modulo 26’
• Notation: 17 + 19 mod 26 = 10.
18. Vigenere Cipher
We can encrypt the message “She is listening” using
the 6-character keyword “PASCAL“. The initial key stream
is (15,0,18,2,0,11). The key stream is the repetition of this
initial key stream (as many times as needed) .
Use encryption algorithm:
20. Vigenere Cipher
• This method was actually discovered earlier, in 1854 by
Charles Babbage.
• Vigenere-like substitution ciphers were regarded by many
as practically unbreakable for 300 years.
• In 1863, a Prussian major named Kasiski proposed a
method for breaking a Vigenere cipher that consisted of
finding the length of the keyword and then dividing the
message into that many simple substitution cryptograms.
22. Government Communications Headquarters
• During WWI, the British Army had a separate division from
the British Navy (“Room 40”).
• After WWI, it was proposed that a peacetime
codebreaking division be created.
• The Government Communications Headquarters was
created.
• Pre WWII, was a very small department.
• By 1940, was attacking codes of 26 countries and over
150 diplomatic cryptosystems.
• In USA many developments during WWII, including
Elizabeth Friedman, Grace Hopper and others.
23. World War II Cryptography
• Most Famous example of
Cryptography in World War
II was the German
Enigma.
• Made use of Rotors and
Plugboards
• One or more of the rotors
moved after each key
press, depending on the
settings.
• Created a changing
substitution cypher, or a
polyalphabetic substitution
cypher.
https://www.cryptool.org/en/cto/enigma-step-by-step
24. RSA Encryption
• Developed by Ron Rivest, Adi Shamir, and Leonard
Adleman.
• Type of Public Key Encryption.
• Later discovered that a similar method had been
developed by the GCHQ (The British SIGINT agency), in
1973, but was kept classified until 1997.
• “The security of RSA is based on the fact that it is easy to
calculate the product n of two large primes p and q.
However, it is very difficult to determine only from the
product n the two primes that yield the product. This
decomposition is also called the factorization of n.”
25. Prime numbers
• A prime number only has 1 or itself as ‘factor’.
• So, 7 is prime
• 13 is prime
• 21 is not prime because that can also be 3*7
• No even number is prime because 2 is always a factor.
• It’s not even always easy to know whether a(n odd)
number is prime or not.
26. Example
11677
39727
Easy to do: 11677 times 39727 is 463892179
Not so easy to do: what product of prime numbers
is 463892179 ?
28. Current day cryptography
• E.g. DES uses a 56-bit key, so 256 possible keys.
• 72,057,594,037,927,936 keys (72 thousand billion in the
UK, 72 quadrillion in the US)
• Even with all these keys, still susceptible to brute force
attacks.
• “It is known that the NSA encouraged, if not persuaded,
IBM to reduce the key size from 128 to 64 bits, and from
there to 56 bits; this is often taken as an indication that
the NSA possessed enough computer power to break
keys of this length even in the mid-1970s.” (Wikipedia)
• Many uses: Whatsapp, banking, https, 802.11, WPA,
GSM, Bluetooth, encrypting files on disk, content
protection on DVD/Blu-ray, user authentication.