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
What is it?
Cryptography – maths in service of security
Cryptanalysis – breaking cryptographic systems
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”
https://www.cryptool.org/en/
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
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
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
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
DEMO CAESAR
https://www.cryptool.org/en/cto/caesar
But….
These are easily broken by frequency analysis:
given “enough” ciphertext, the code breaks itself
Attacking Substitution Ciphers
11
Trick 2:
Letter
Frequency
Most common: e,t,a,o,i,n
Least common: j,x,q,z
image source: wikipedia
Trick 1:
Word
Frequency
DEMO FREQUENCY
ANALYSIS
Cryptool 2.0 software
Exdsv wynobx dswoc, mbizdyqbkzri bopobbon kvwycd ohmvecsfovi dy
"oxmbizdsyx", grsmr sc dro zbymocc yp myxfobdsxq ybnsxkbi sxpybwkdsyx (mkvvon
zvksxdohd) sxdy kx exsxdovvsqslvo pybw (mkvvon mszrobdohd).[13] Nombizdsyx sc
dro bofobco, sx ydrob gybnc, wyfsxq pbyw dro exsxdovvsqslvo mszrobdohd lkmu dy
zvksxdohd. K mszrob (yb mizrob) sc k zksb yp kvqybsdrwc drkd mkbbi yed dro
oxmbizdsyx kxn dro bofobcsxq nombizdsyx. Dro nodksvon yzobkdsyx yp k mszrob sc
myxdbyvvon lydr li dro kvqybsdrw kxn, sx okmr sxcdkxmo, li k "uoi". Dro uoi sc k
combod (snokvvi uxygx yxvi dy dro mywwexsmkxdc), ecekvvi k cdbsxq yp
mrkbkmdobc (snokvvi crybd cy sd mkx lo bowowlobon li dro ecob), grsmr sc xoonon
dy nombizd dro mszrobdohd. Sx pybwkv wkdrowkdsmkv dobwc, k "mbizdycicdow"
sc dro ybnobon vscd yp ovowoxdc yp psxsdo zyccslvo zvksxdohdc, psxsdo zyccslvo
mizrobdohdc, psxsdo zyccslvo uoic, kxn dro oxmbizdsyx kxn nombizdsyx kvqybsdrwc
drkd mybboczyxn dy okmr uoi. Uoic kbo swzybdkxd lydr pybwkvvi kxn sx kmdekv
zbkmdsmo, kc mszrobc gsdryed fkbsklvo uoic mkx lo dbsfskvvi lbyuox gsdr yxvi dro
uxygvonqo yp dro mszrob econ kxn kbo drobopybo ecovocc (yb ofox myexdob-
zbynemdsfo) pyb wycd zebzycoc. Rscdybsmkvvi, mszrobc gobo ypdox econ
nsbomdvi pyb oxmbizdsyx yb nombizdsyx gsdryed knnsdsyxkv zbymoneboc cemr kc
kedroxdsmkdsyx yb sxdoqbsdi mromuc.
13
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
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.
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.
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:
Vigenère Table
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.
ONLINE DEMO VIGENERE
https://www.cryptool.org/en/cto/vigenere
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.
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
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.”
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.
Example
11677
39727
Easy to do: 11677 times 39727 is 463892179
Not so easy to do: what product of prime numbers
is 463892179 ?
RSA
https://www.cryptool.org/en/cto/rsa-step-by-step
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.
https://mysterytwister.org/
https://www.cipherchallenge.org/
Thank you
Dr Christian Bokhove C.Bokhove@soton.ac.uk
Professor in Mathematics Education

Cryptography

  • 1.
    CRYPTOGRAPHY Dr Christian Bokhove Professorin 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”
  • 4.
  • 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 peoplewill 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
  • 9.
  • 10.
    But…. These are easilybroken by frequency analysis: given “enough” ciphertext, the code breaks itself
  • 11.
    Attacking Substitution Ciphers 11 Trick2: Letter Frequency Most common: e,t,a,o,i,n Least common: j,x,q,z image source: wikipedia Trick 1: Word Frequency
  • 12.
  • 13.
    Exdsv wynobx dswoc,mbizdyqbkzri bopobbon kvwycd ohmvecsfovi dy "oxmbizdsyx", grsmr sc dro zbymocc yp myxfobdsxq ybnsxkbi sxpybwkdsyx (mkvvon zvksxdohd) sxdy kx exsxdovvsqslvo pybw (mkvvon mszrobdohd).[13] Nombizdsyx sc dro bofobco, sx ydrob gybnc, wyfsxq pbyw dro exsxdovvsqslvo mszrobdohd lkmu dy zvksxdohd. K mszrob (yb mizrob) sc k zksb yp kvqybsdrwc drkd mkbbi yed dro oxmbizdsyx kxn dro bofobcsxq nombizdsyx. Dro nodksvon yzobkdsyx yp k mszrob sc myxdbyvvon lydr li dro kvqybsdrw kxn, sx okmr sxcdkxmo, li k "uoi". Dro uoi sc k combod (snokvvi uxygx yxvi dy dro mywwexsmkxdc), ecekvvi k cdbsxq yp mrkbkmdobc (snokvvi crybd cy sd mkx lo bowowlobon li dro ecob), grsmr sc xoonon dy nombizd dro mszrobdohd. Sx pybwkv wkdrowkdsmkv dobwc, k "mbizdycicdow" sc dro ybnobon vscd yp ovowoxdc yp psxsdo zyccslvo zvksxdohdc, psxsdo zyccslvo mizrobdohdc, psxsdo zyccslvo uoic, kxn dro oxmbizdsyx kxn nombizdsyx kvqybsdrwc drkd mybboczyxn dy okmr uoi. Uoic kbo swzybdkxd lydr pybwkvvi kxn sx kmdekv zbkmdsmo, kc mszrobc gsdryed fkbsklvo uoic mkx lo dbsfskvvi lbyuox gsdr yxvi dro uxygvonqo yp dro mszrob econ kxn kbo drobopybo ecovocc (yb ofox myexdob- zbynemdsfo) pyb wycd zebzycoc. Rscdybsmkvvi, mszrobc gobo ypdox econ nsbomdvi pyb oxmbizdsyx yb nombizdsyx gsdryed knnsdsyxkv zbymoneboc cemr kc kedroxdsmkdsyx yb sxdoqbsdi mromuc. 13
  • 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èrecipher 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 • Tellingtime 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 canencrypt 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:
  • 19.
  • 20.
    Vigenere Cipher • Thismethod 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.
  • 21.
  • 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 IICryptography • 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 • Developedby 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 • Aprime 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 ?
  • 27.
  • 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.
  • 29.
  • 30.
  • 31.
    Thank you Dr ChristianBokhove C.Bokhove@soton.ac.uk Professor in Mathematics Education

Editor's Notes

  • #2 Thanks to slides from: Adam Goodbar