Code breaking

Document Sample
Code breaking Powered By Docstoc
					Code breaking
Juniors University Taster Week for Year 11 July 9, 2008 Kurt Langfeld, David McMullan School of Mathematics and Statistics University of Plymouth

Code breaking – p.1/31

Outline of the workshop: Encryption [history, basic techniques]

Code breaking – p.2/31

Outline of the workshop: Encryption [history, basic techniques] Hands on: encryption / decryption

Code breaking – p.2/31

Outline of the workshop: Encryption [history, basic techniques] Hands on: encryption / decryption Code breaking

Code breaking – p.2/31

Outline of the workshop: Encryption [history, basic techniques] Hands on: encryption / decryption Code breaking Hands on: break the Caesar cipher

Code breaking – p.2/31

Outline of the workshop: Encryption [history, basic techniques] Hands on: encryption / decryption Code breaking Hands on: break the Caesar cipher Encryption nowadays
[public-key cryptography] [what spies do]

Code breaking – p.2/31

Encryption: history and importance Atbash Bible Code (2000 bc):
[reverted Hebrew alphabet]

Code breaking – p.3/31

Encryption: history and importance Atbash Bible Code (2000 bc):
[reverted Hebrew alphabet]

Ceasar cipher: [simple substitution] used by the Roman emperor Julius Ceasar
unbroken for centuries !
plain text

abcdefghijklmnopqrstuvwxyz vwxyzabcdefghijklmnopqrstu shift 5

cypher key

Code breaking – p.3/31

Encryption: history and importance London 1850: ciphered press advertisements
[message exchange between lovers]

Code breaking – p.4/31

Encryption: history and importance London 1850: ciphered press advertisements
[message exchange between lovers]

Sir Charles Wheatstone (1802 - 1875) Charles Babbage (1791 - 1871)
[fun code breaking]

Code breaking – p.4/31

Encryption: history and importance Ludendorff Cipher (1st World War)
A D F G V X A c m n 5 p e D o k w s l q F 8 3 l i v 7 G x a 0 y b t V X f 4 z 9 j d h u 6 r 2 g

Code breaking – p.5/31

Encryption: history and importance Ludendorff Cipher (1st World War)
A D F G V X A c m n 5 p e D o k w s l q F 8 3 l i v 7 G x a 0 y b t V X f 4 z 9 j d h u 6 r 2 g

Enigma (2nd World war)

[Tony Sale, Codes and Ciphers]

[novel by Robert Harris]

Code breaking – p.5/31

Encryption: history and importance Who is involved nowadays?
M.I.6 G.C.H.Q
Governm. Communic. Headquarters

historical: G.C.&C.S, war station, Station X, Room 47 foreign office

U.S.I.B.

DIA CIA

Defense Intelligence Ag. Central Intelligence Ag.

Bundes− kanzleramt

.. Bundesamt fur BND Fernmeldestatistik .. .. since 1990: Amt fur Militarkunde .. Bundesamt fur Sicherheit in der Informationstechnik

Code breaking – p.6/31

Encryption: history and importance Who is involved nowadays?
M.I.6 G.C.H.Q
Governm. Communic. Headquarters

all of us !
historical: G.C.&C.S, war station, Station X, Room 47 foreign office

U.S.I.B.

DIA CIA

Defense Intelligence Ag. Central Intelligence Ag.

online banking e−health internet shopping mobile phones ....

Bundes− kanzleramt

.. Bundesamt fur BND Fernmeldestatistik .. .. since 1990: Amt fur Militarkunde .. Bundesamt fur Sicherheit in der Informationstechnik

Code breaking – p.6/31

Hands on: The Ceasar cipher Ceasar cipher: 25 different possibilities

Code breaking – p.7/31

Hands on: The Ceasar cipher Ceasar cipher: 25 different possibilities simple substitution: replace each letter with another one 25 × 24 × . . . × 3 × 2 ≈ 1.6 × 1025 possible ciphers

Code breaking – p.7/31

Hands on: The Ceasar cipher Ceasar cipher: 25 different possibilities simple substitution: replace each letter with another one 25 × 24 × . . . × 3 × 2 ≈ 1.6 × 1025 possible ciphers difficult to remember use a password ⇒ construct the cipher advantage: cipher is easy to exchange

Code breaking – p.7/31

Hands on: The Ceasar cipher agree on a password; here: tuesday

Code breaking – p.8/31

Hands on: The Ceasar cipher agree on a password; here: tuesday create your substitution table: step 1
ab c d e f g h i j k l m n o p q r s t u v w x y z tues day

Code breaking – p.8/31

Hands on: The Ceasar cipher agree on a password; here: tuesday create your substitution table: step 1
ab c d e f g h i j k l m n o p q r s t u v w x y z tues day

step 2
ab c d e f g h i j k l m n o p q r s t u v w x y z

t u e s d ay z b c f g h i j k l m n o p q r v w x

Code breaking – p.8/31

Hands on: The Ceasar cipher create your substitution table: final step
ab c d e f g h i j k l m n o p q r s t u v w x y z encryption decryption t u e s d ay z b c f g h i j k l m n o p q r v w x

Code breaking – p.9/31

Hands on: The Ceasar cipher create your substitution table: final step
ab c d e f g h i j k l m n o p q r s t u v w x y z encryption decryption t u e s d ay z b c f g h i j k l m n o p q r v w x

example:
c e a s a r c e a s a r

e d t n t m

e d t n t m

Code breaking – p.9/31

hands on !

Code breaking – p.10/31

Decoding example:
Encryption and data security
Kurt Langfeld and David McMullan
School of Mathematics and Statistics

Decoding exercise
Recall example of lookup table with password TUESDAY:
Plain text Cipher text a T b U c E d S e D f A g Y h Z i B j C k F l G m H n I o J p K q L r M s N t O u P v Q w R x V y W z X

Now construct lookup table with password WENDY:
Plain text Cipher text a W b E c N d D e Y f g h i j k l m n o p q r s t u v w x y z

Decode the following ciphertext:
WJ YULYOQ CP PKIYKJY TBK GJKTP PKIY KZ QBY TKOPQ ICPQWGYP QBWQ NWJ EY IWDY CJ BCP PREFYNQ WJD BKT QK WSKCD QBYI. TYOJYO BYCPYJEYOA

Plaintext :

Juniors University Taster for Year 11, Wed 9.7.2008

Code breaking – p.11/31

Decoding example:
Encryption and data security
Kurt Langfeld and David McMullan
School of Mathematics and Statistics

Decoding exercise
Recall example of lookup table with password TUESDAY:
Plain text Cipher text a T b U c E d S e D f A g Y h Z i B j C k F l G m H n I o J p K q L r M s N t O u P v Q w R x V y W z X

Now construct lookup table with password WENDY:
Plain text Cipher text a W b E c N d D e Y f g h i j k l m n o p q r s t u v w x y z

Decode the following ciphertext:
WJ YULYOQ CP PKIYKJY TBK GJKTP PKIY KZ QBY TKOPQ ICPQWGYP QBWQ NWJ EY IWDY CJ BCP PREFYNQ WJD BKT QK WSKCD QBYI. TYOJYO BYCPYJEYOA Plaintext :

An expert is someone who knows some of the worst mistakes that can be made in his subject and how to avoid them. Werner Heisenberg Juniors University Taster for Year 11, Wed 9.7.2008

Code breaking – p.12/31

Code breaking
Generically difficult ⇒ need knowledge on the cipher

Code breaking – p.13/31

Code breaking
Generically difficult ⇒ need knowledge on the cipher

many codes get broken because of the sloppy use of ciphers
The Register 2008: Mafia boss undone by clumsy crypto
Clues left in the clumsily encrypted notes of a Mafia don have helped Italian investigators to track his associates and ultimately contributed to his capture after years on the run. ....instructions incorporating basic encryption on small scraps of paper, known locally as pizzini.

Code breaking – p.13/31

Code breaking
Generically difficult ⇒ need knowledge on the cipher

many codes get broken because of the sloppy use of ciphers
The Register 2008: Mafia boss undone by clumsy crypto
Clues left in the clumsily encrypted notes of a Mafia don have helped Italian investigators to track his associates and ultimately contributed to his capture after years on the run. ....instructions incorporating basic encryption on small scraps of paper, known locally as pizzini.

What went wrong?
used always (!) a 3-shift for the Ceasar cipher

Code breaking – p.13/31

Code breaking
How can we break a substitution cipher?

Code breaking – p.14/31

Code breaking
How can we break a substitution cipher? Frequency analysis:
in a simple substitution cipher, each letter is replaced with another certain letters and combinations of letters occur with varying frequencies count the letters of the encrypted message!

Code breaking – p.14/31

Frequency analysis:
abundance of letters in an English text:

Code breaking – p.15/31

Frequency analysis:
abundance of letters in an English text:

[wikipedia]

Code breaking – p.15/31

hands on !

Code breaking – p.16/31

Code breaking example:
Encryption and data security
Code breaking exercise
Kurt Langfeld and David McMullan
School of Mathematics and Statistics Letter and word frequencies can help decipher a secret message. In English the following results are known for a sufficiently long piece of text: Order of frequency of single letters Order of frequency of pairs of letters Order of frequency of most common doubles One-letter words Most frequent two-letter words Most frequent three-letter words ETAOINSHRDLU th er on an re he in ed nd ha at en es of or nt ea ti to it st io le is ou ar as de rt ve ss ee tt ff ll mm oo aI of, to, in, it, is, be, as, at, so, we, he, by, or, on, do, if, me, my, up, an, go, no, us, am the, and, for, are, but, not, you, all, any, can, had, her, was, one, our, out, day, get, has

Intercepted message
O X O Q D E K Q K E M F C E J R A O X S C R L J , Q O Y L D F I Q J K F M O I K L K L L K O Y I K L J X C C J Y L K Y C D B K D K Q J Q I L O E C Q R Y G B I O Y L J K Y K M X E Q E I V Q K L ’L . Q S G J S Y E F G L R M C L F K X M ? J K L J Q L Q Q Q E B E Y J B M C L K A I F K X O M . C , Y A F J I L U W Q X Q I E K E K I F L Q U S U M A X J K K L I L R X I Q F F F Q Y J K L E K L J D X R J K . Q I P K I

Construct lookup table
Cipher text Frequency(%) Plain text A 2 B 2 C 4 D 2 E 6 F 5 G 1 H 0 I 7 J 8 K 12 L 11 M 4 N 0 O 4 P 1 Q 10 R 3 S 2 T 0 U 1 V 1 W 1 X 5 Y 5 Z 0

What is the secret password?

Juniors University Taster for Year 11, Wed 9.7.2008

Code breaking – p.17/31

Code breaking example:
Encryption and data security
Code breaking exercise
Kurt Langfeld and David McMullan
School of Mathematics and Statistics Letter and word frequencies can help decipher a secret message. In English the following results are known for a sufficiently long piece of text: Order of frequency of single letters Order of frequency of pairs of letters Order of frequency of most common doubles One-letter words Most frequent two-letter words Most frequent three-letter words ETAOINSHRDLU th er on an re he in ed nd ha at en es of or nt ea ti to it st io le is ou ar as de rt ve ss ee tt ff ll mm oo aI of, to, in, it, is, be, as, at, so, we, he, by, or, on, do, if, me, my, up, an, go, no, us, am the, and, for, are, but, not, you, all, any, can, had, her, was, one, our, out, day, get, has

Intercepted message
O X O Q D E K Q K E M F C E J R A O X S C R L J , Q O Y L D F I Q J K F M O I K L K L L K O Y I K L J X C C J Y L K Y C D B K D K Q J Q I L O E C Q R Y G B I O Y L J K Y K M X E Q E I V Q K L ’L . Q S G J S Y E F G L R M C L F K X M ? J K L J Q L Q Q Q E B E Y J B M C L K A I F K X O M . C , Y A F J I L U W Q X Q I E K E K I F L Q U S U M A X J K K L I L R X I Q F F F Q Y J K L E K L J D X R J K . Q I P K I

Construct lookup table
Cipher text Frequency(%) Plain text A 2 B 2 C 4 D 2 E 6 F 5 G 1 H 0 I 7 J 8 K 12 L 11 M 4 N 0 O 4 P 1 Q 10 R 3 S 2 T 0 U 1 V 1 W 1 X 5 Y 5 Z 0

Solution: Well, Art is Art, isn’t it? Still, on the other hand, water is water. And east is east and west is west and if you take cranberries and stew them like applesauce they taste much more like prunes than rhubarb does. Now you tell me what you know. Groucho Marx Juniors University Taster for Year 11, Wed 9.7.2008

Code breaking – p.18/31

Public Key Cryptography: modern applications:
internet banking sign electronic documents encrypt an email

Code breaking – p.19/31

Public Key Cryptography: modern applications:
internet banking sign electronic documents encrypt an email

exchange of a key is very inconvenient

Code breaking – p.19/31

Public Key Cryptography: modern applications:
internet banking sign electronic documents encrypt an email

exchange of a key is very inconvenient can two parties exchange secure messages without having met before?

Code breaking – p.19/31

Public Key Cryptography: modern applications:
internet banking sign electronic documents encrypt an email

exchange of a key is very inconvenient can two parties exchange secure messages without having met before?

yes !
public key cryptography

Code breaking – p.19/31

Public Key Cryptography: How does it work?
door with a strange lock ⇒ two different keys one key locks the door only the other key unlocks the door

Code breaking – p.20/31

Public Key Cryptography: How does it work?
door with a strange lock ⇒ two different keys one key locks the door only the other key unlocks the door Bob prepares himself to receive encrypted messages ⇒ leaves his door open ⇒ puts ONE key beside the door

[public key]

Code breaking – p.20/31

Public Key Cryptography:
Alice wants to send Bob a message which only Bob can read

Code breaking – p.21/31

Public Key Cryptography:
Alice wants to send Bob a message which only Bob can read

Bob finds his door locked [only he can open it]

private key

Code breaking – p.21/31

Public Key Cryptography:
Alice wants to send Bob a message which only Bob can read

Bob finds his door locked [only he can open it]

private key

Alice is sure that only Bob reads her message [application: internet banking]

Code breaking – p.21/31

Public Key Cryptography: Where the maths is:
GCHQ (early 70s): Ellis, Cocks, Williamson [disclosed until 1997] MIT (1997): Rivest, Shamir, Adleman – the RSA standard

Code breaking – p.22/31

Public Key Cryptography: Where the maths is:
GCHQ (early 70s): Ellis, Cocks, Williamson [disclosed until 1997] MIT (1997): Rivest, Shamir, Adleman – the RSA standard

... it is all about primes

Code breaking – p.22/31

Public Key Cryptography: Where the maths is:
GCHQ (early 70s): Ellis, Cocks, Williamson [disclosed until 1997] MIT (1997): Rivest, Shamir, Adleman – the RSA standard

... it is all about primes [What are primes?]

Code breaking – p.22/31

RSA security aspects Mathematics tells us:
if you know how to factorise an integer into primes, you can break the RSA code !

Code breaking – p.23/31

RSA security aspects Mathematics tells us:
if you know how to factorise an integer into primes, you can break the RSA code !

...but that is easy: 21 = 7 × 3

Code breaking – p.23/31

RSA security aspects Mathematics tells us:
if you know how to factorise an integer into primes, you can break the RSA code !

...but that is easy: 21 = 7 × 3 though the numbers of interest are a bit bigger

Code breaking – p.23/31

The RSA challange: what about this number?
200 digits, 2 prime factors:
2799783391122132787082946763872260162107044678695 5428537560009929326128400107609345671052955360856 0618223519109513657886371059544820065767750985805 57613579098734950144178863178946295187237869221823983

Code breaking – p.24/31

The RSA challange: what about this number?
200 digits, 2 prime factors:
2799783391122132787082946763872260162107044678695 5428537560009929326128400107609345671052955360856 0618223519109513657886371059544820065767750985805 57613579098734950144178863178946295187237869221823983

Using HPC, the problem was only solved in 2005 [55 years on a single 2.2 GHz Opteron CPU]

Code breaking – p.24/31

The RSA challange: what about this number?
200 digits, 2 prime factors:
2799783391122132787082946763872260162107044678695 5428537560009929326128400107609345671052955360856 0618223519109513657886371059544820065767750985805 57613579098734950144178863178946295187237869221823983

Using HPC, the problem was only solved in 2005 [55 years on a single 2.2 GHz Opteron CPU]

and the winners are:
35324619344027701212726049781984643686711974001976250 23649303468776121253679423200058547956528088349

and
79258699544783330333470858414800596877379758573642 19960734330341455767872818152135381409304740185467

Code breaking – p.24/31

The RSA challange: The RSA Security division offered prizes to factor huge numbers

Code breaking – p.25/31

The RSA challange: The RSA Security division offered prizes to factor huge numbers
RSA-140: solved on February 2, 1999 RSA-200: solved on May 2005 RSA-640: solved on November 2, 2005 RSA-2048: Bank of England (effective 1 June 2006), not solved (hopefully!)

Code breaking – p.25/31

What spies do an encrypted email attracts a lot of interest...
[hide your message]

Code breaking – p.26/31

What spies do an encrypted email attracts a lot of interest...
[hide your message]

steganography: [hide your message in a picture]
←− historical

Code breaking – p.26/31

Steganography

Code breaking – p.27/31

Steganography nowadays use electronic pictures:
[jpg, png, ppm, ...]

Code breaking – p.28/31

Steganography nowadays use electronic pictures:
[jpg, png, ppm, ...]

Picture: made out of 720 × 576 pixels (DVD)
use 24 Bit colour map
One pixel: binary number: 8 bit 10011011 10001101 01110010 red blue green

11111111 00111111

(255) (63)

intense blue weak blue use unimportant bits to hide a message

Code breaking – p.28/31

Steganography nowadays

strip off the two high intensity bits

Code breaking – p.29/31

Steganography nowadays

strip off the two high intensity bits

...and amplify the result by 85

Code breaking – p.29/31

steganography How much is it used by spies, terrorist, ...
[we don’t know]

Code breaking – p.30/31

steganography How much is it used by spies, terrorist, ...
[we don’t know] To date, over 725 digital steganography applications have been idenitfied by SARC [Steganography Analysis and Research Center]

Code breaking – p.30/31

References:
Simon Singh, The Code Book: The Secret History of Codes and Code-breaking Fourth Estate; New Ed edition (8 Jun 2000)

Code breaking – p.31/31

References:
Simon Singh, The Code Book: The Secret History of Codes and Code-breaking Fourth Estate; New Ed edition (8 Jun 2000) Robert Harris, Enigma , Arrow Books Ltd; New Ed edition (2 May 1996).

Code breaking – p.31/31


				
DOCUMENT INFO
Shared By:
Tags: Code, breaking
Stats:
views:282
posted:1/26/2010
language:English
pages:66
Description: Code breaking