Top Banner
University of Warwick Headstart Residential Course 2015 Introduction to secret key encryption () 1 / 27 Cryptography kryptos + grafein “hidden” “to write” The study of secure communication in the presence of adversaries. One of the most important tools in the cyber security tool box () 2 / 27 Cryptography kryptos + grafein “hidden” “to write” The study of secure communication in the presence of adversaries. One of the most important tools in the cyber security tool box Not the only one Underpins a lot of modern life Plenty to keep both mathematicians and computer scientists excited! () 3 / 27 What cryptography does for us Thwarting eavesdroppers confidentiality Preventing (detecting) tampering integrity Proving someone is who they say they are authentication Preventing later denial of your actions non-repudiation Loads of amazing stuff using clever protocols. Eg: Yao’s millionaire problem (secure multi-party computation) () 4 / 27
7

University of Warwick Headstart Residential Course 2015

Dec 27, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: University of Warwick Headstart Residential Course 2015

University of Warwick

Headstart Residential Course 2015

Introduction to secret key encryption

() 1 / 27

Cryptography

kryptos + grafein“hidden” “to write”

The study of secure communication in the presence of adversaries.

One of the most important tools in the cybersecurity tool box

() 2 / 27

Cryptography

kryptos + grafein“hidden” “to write”

The study of secure communication in the presence of adversaries.

One of the most important tools in the cybersecurity tool box

Not the only one

Underpins a lot of modern life

Plenty to keep both mathematiciansand computer scientists excited!

() 3 / 27

What cryptography does for us

Thwarting eavesdroppers confidentiality

Preventing (detecting) tampering integrity

Proving someone is who they say they are authentication

Preventing later denial of your actions non-repudiation

Loads of amazing stuff using clever protocols.

Eg: Yao’s millionaire problem (secure multi-party computation)

() 4 / 27

Page 2: University of Warwick Headstart Residential Course 2015

Encompasses a diverse range of maths/CS/EE topics

() 5 / 27

Two fundamentally different approaches

Encryption uses a key to “lock up” the message

Secret key encryption

Aka:- shared key- symmetric key- conventional cryptography

Same key needed to “lock” and“unlock” the secret

Public key encryption

Aka:- asymmetric key

Different keys needeed to “lock”and “unlock” the secret

() 6 / 27

What do these all have in common . . . !

() 7 / 27

Secret key cryptography

Plaintextfile

-

6

Ciphertextfile

-

Transmitciphertext

Ciphertextfile

6

-Plaintextfile

Encrypt with knownalgorithm (eg AES)and secret key, K

Decrypt with knownalgorithm (eg AES)and secret key, K

Key is secret shared by sender and receiver

Public algorithm with decrypt reverse of encrypt.

Shared key is small - used to “seed” the process

Secret key cryptography makes use of several basic techniques whichhave been around for 1000s of years!

() 8 / 27

Page 3: University of Warwick Headstart Residential Course 2015

Technique 1: permutation (transposition)

Changes the order of the letters

Example: simple columnar transposition with 5 columns

Plaintext: THIS IS A VERY SECRET MESSAGE

T H I S IS A V E RY S E C RE T M E SS A G E X

Ciphertext: TSYES HASTA IVEMG SECEE IRRSX

Letters are the same, but in a different order.

Generally remove punctuation and spaces.

Which of the pictures from earlier slide shows a simple transposition?

What is the shared secret?

Without padding, can the receiver still decrypt? Eg: message length = 17() 9 / 27

Real life examples

An early example - the skytale.

B L E A K H O U S E2 7 3 1 6 5 8 10 9 4T H I S I S P R O BA B L Y N O T A V ER Y S E C U R E W AY T O E N C R Y P T

B L E A K H O U S E2 7 3 1 6 5 8 10 9 4S Y E E T A R Y I LS O B E A T S O U CI N C N H B Y T P TR R O V W P R A E Y

EENVS SIREB COLCT YATBP TAHWY ONRRSYRIUP EYOTA

Double transposition “Ubchi”used by German military at thestart of the 1st WW.

Permutation used in DES toshuffle each 32-bit half block.

16 7 20 21 29 12 28 171 15 23 26 5 18 31 102 8 24 14 32 27 3 919 13 30 6 22 11 4 25

() 10 / 27

Transpositions today

Permutation steps are an integral part of modern secret key encryptionalgorithms.

AES (Advanced Encryption Standard) is the current standard algorithm.

It’s an SPN - substitution-permutation network

Each input block goes through a number of rounds - which include a stepto cycle the rows in the matrix.

() 11 / 27

Technique 2: Substitution

Replace plaintext elements (letters, words, digraphs, bits, . . . ) withsomething else.

Monoalphabetic substitution

Replace each letter of the ciphertext with a different letter or symbol (theciphertext alphabet)

Well known example: Caesar cipher, using shift alphabet

CRYPTOGRAPHY RULES OK

FUBSW RJUDS KBUXO HVRN

() 12 / 27

Page 4: University of Warwick Headstart Residential Course 2015

Technique 2: Substitution

Monoalphabetic substitution

Can use any 1-1 replacement, any alphabet (doesn’t have to be a shift)

Example: Sherlock Holmes and The Adventure of the Dancing Men

Key in each case? And the major weakness is....?

() 13 / 27

Polyalphabetic substitutions

This means using more than one substitution

Eg: Vigenere

If key is “adbc” then shifts of 1432 are used repeatedly.

Suppose plaintext is: CRYPTOGRAPHY RULES OK

C R Y P T O G R A P H Y R U L E S O K1 4 2 3 1 4 2 3 1 4 2 3 1 4 2 3 1 4 2D V A S U S I U B T J B S Y N H T S M

Ciphertext is: DVASU SIUBT JBSYN HTSM

A lot better! But still has same statistical flaws taking letterskeylength apart.

What if we could make the key really long ... infinitely long?!() 14 / 27

Infinite random polyalphabetic substitution

Each letter in the message is encrypted using an unpredictable alphabet.

But the communicating parties each need to know what this never-endingsequence of substitutions is.

One time pad Telekrypton machine (Vernam cipher)

This is as secure as you can get! But how to share the key?

What do you think about agreeing to use “War and Peace”?

One time pad isn’t a practical solution: key generation, distribution,protection.() 15 / 27

Generating pseudo-random key streams

In the “modern era”, electromechanical machines used to generatesuccessive key values.

Seed process with short key.

Can be many rapid subprocesses in a single step, but all relate to thetechniques we’ve described.

() 16 / 27

Page 5: University of Warwick Headstart Residential Course 2015

Mechanising encryption

Electromechanical devices such asEnigma used stepping rotors whichmoved on with each key press to com-plete the circuit in a different way.

But, tell-tail traits andflaws in usage.

And other machines canbe used to check througha (reduced) search space.

() 17 / 27

Combining electronic message and key

With letters: can interpret key letter as shift alphabet.

Use binary for representation of text and key in a computer. Eg:

Plaintext H iASCII 1001000 1101001Key 0100111 0010100Ciphertext ? ?

How should we combine the bits when we encrypt?

() 18 / 27

Which bitwise operation?

AND OR XORPlaintext 1 1 0 0 1 1 0 0 1 1 0 0Key 1 0 1 0 1 0 1 0 1 0 1 0

−−−− −−−− −−−−Ciphertext? 1 0 0 0 1 1 1 0 0 1 1 0

Which method issuitable for encryp-tion?

How do you decrypt?

() 19 / 27

Which bitwise operation?

AND OR XORPlaintext 1 1 0 0 1 1 0 0 1 1 0 0Key 1 0 1 0 1 0 1 0 1 0 1 0

−−−− −−−− −−−−Ciphertext 1 0 0 0 1 1 1 0 0 1 1 0

? ? ? ?

Key 1 0 1 0−−−−1 1 0 0

Which method issuitable for encryp-tion?

How do you decrypt?

() 20 / 27

Page 6: University of Warwick Headstart Residential Course 2015

Substitutions today

Substitution steps using suitably generated key and fixed lookup tables arean integral part of modern secret key encryption algorithms.

This is AES again. Remember it’s an SPN.

The processing in each round includes:

- subBytes replaces each byte using a fixed lookup table

- AddRoundKey incorporates the key for this round() 21 / 27

Questions to think about

How can we know if a secret key encryption scheme is “good”?

Not just information-theoretically secure - think One Time Pad.

What measures might help us decide?

What would convince you?

() 22 / 27

Tell-tale sign in a simple transposition cipher

The letters are the same, but in a different order.

Without fractionation, what could we observe?

Letter frequency analysis

Transposition - direct correspondence with standard language count

() 23 / 27

Considering a suspected columnar transposition

Need to get the number of columns.

If padding is used to fill a rectangle - what would a ciphertext reveal?

If not, we could consider cases from n=2 upwards

Example ciphertext: BHFEEMWIAADRRECESHTOX

If we suspect this comes from a padded columnar transposition, whatmight we deduce?

7*3

B I CH A EF A SE D HE R TM R OW E X

3*7B E W A R E TH E I D E S OF M A R C H X

() 24 / 27

Page 7: University of Warwick Headstart Residential Course 2015

What if a key was used to read off columns?

Example ciphertext: TAAATRKBJTDEAWDAESCNY

7*3

T B DA J AA T EA D ST E CR A NK W Y

3*7T A K T A A CA T B D W E NA R J E D S Y

Each row is an anagramof the actual plaintext.How many possibilities?

Why is 7*3 unlikely?

Can you spot a goodanagram word (or partword) to try in row 1?

3*7A T T A C K AT A D W N B ER A E D Y J S

Let’s rearrange (arbi-trarily for repeat letters)to try “ATTACK”.

Look at 2nd row - re-member, each row ispermuted in same way

3*7A T T A C K AT D A W N B ER E A D Y J S

Key: 2 4 1 5 7 3 6

Rearranging columns forword guess in row 2

() 25 / 27

Building up the tools . . .

English has roughly 40% vowels. Maybe get info on number of columns bylooking for % of vowels on each row. But small grid - so not brilliant.

Example ciphertext: TAAATRKBJTDEAWDAESCNY

If 3 columns, expect 1.2 vowels per row

If 7 columns, expect 2.8 vowels per row

7*3

#vowels difference from expected

T B D 0 1.2A J A 2 0.8A T E 2 0.8A D S 1 0.2T E C 1 0.2R A N 1 0.2K W Y 0 1.2

4.6

3*7

#vowels difference from expected

T A K T A A C 3 0.2A T B D W E N 2 0.8A R J E D S Y 2 0.8

1.8

() 26 / 27

Building up the tools . . .

In any language, not only will some letters be more common, but there will alsobe distinctive patterns of digraph frequency.

Could use this to guide the anagram solving

Example ciphertext: TAAATRKBJTDEAWDAESCNY

T A K T A A CA T B D W E NA R J E D S Y

Consider 1st column. Score likelihood for each of the other columns that they wouldfollow it.

Again, the more cipher text the better.

Digraph frequencies - created from large corpus of English text.

() 27 / 27