National Cipher Challenge

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Math for Liberal Studies.  When we studied ID numbers, we found that many of these systems use remainders to compute the check digits  Remainders have.
Cryptology Terminology and Early History. Cryptology Terms Cryptology –The science of concealing the meaning of messages and the discovery of the meaning.
Section 3.8: More Modular Arithmetic and Public-Key Cryptography
 Caesar used to encrypt his messages using a very simple algorithm, which could be easily decrypted if you know the key.  He would take each letter.
Creating Secret Messages. 2 Why do we need to keep things secret? Historically, secret messages were used in wars and battles For example, the Enigma.
Lecture 2.2: Private Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
CPSC CPSC 3730 Cryptography Chapter 2 Classical Encryption Techniques.
Introduction to Cryptography
1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University.
David Froot.  How do we transmit information and data, especially over the internet, in a way that is secure and unreadable by anyone but the sender.
Fmdszqujpo! Encryption!. Encryption  Group Activity 1:  Take the message you were given, and create your own encryption.  You can encrypt it anyway.
Cryptanalysis. The Speaker  Chuck Easttom  
Cryptanalysis of the Vigenere Cipher Using Signatures and Scrawls To break a Vigenere cipher you need to know the keyword length. – The Kasiski and Friedman.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
MAT 1000 Mathematics in Today's World Winter 2015.
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
Systems of Equations as Matrices and Hill Cipher.
Computer Security coursework 2 Dr Alexei Vernitski.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
Chapter 17 Security. Information Systems Cryptography Key Exchange Protocols Password Combinatorics Other Security Issues 12-2.
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
CRYPTOGRAPHY AND THE MATH MAJOR Dr. Mihai Caragiu Mathematics Department Ohio Northern University.
Abstract: Cryptology is a combination of the processes of keeping a message secret (cryptography) and trying to break the secrecy of that message (cryptoanalysis).
Data Security and Encryption (CSE348) 1. Lecture # 3 2.
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Governor’s School for the Sciences Mathematics Day 5.
Word problems DON’T PANIC! Some students believe they can’t do word problem solving in math. Don’t panic. It helps to read the question more than once.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Algebra Simplifying and collecting like terms. Before we get started! Believe it or not algebra is a fairly easy concept to deal with – you just need.
MAT 1000 Mathematics in Today's World Winter 2015.
An Introduction to Cryptology
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
Introduction to Cryptography and Secure Communications  What is cryptography?  Encryption  Decryption.
CRYPTOGRAPHY G REEK WORD MEANING “ SECRET WRITING ”
Encryption with Keys and Passwords
Substitution Ciphers.
Modular Arithmetic with Applications to Cryptography
Public Key Encryption Major topics The RSA scheme was devised in 1978
Vocabulary Big Data - “Big data is a broad term for datasets so large or complex that traditional data processing applications are inadequate.” Moore’s.
Read the instruments below
Chapter 2 Basic Encryption and Decryption
Encryption.
Cryptography and Network Security
Computer and Data Security 4th Class
Basic Encryption Methods
Networks Encryption.
Cryptography Lecture 2.
Lesson 5: Simple Encryption
National Cipher Challenge
Encryption with Keys and Passwords
Least Common Multiple LCM 2 Methods
Encryption and Decryption
National Cipher Challenge
Fundamentals of Data Representation
Simple Encryption- Lesson 5
Substitution Codes By Sarah Bonnell.
Encryption with Keys and Passwords
Classical Ciphers – I Terminology CSCI284 Spring 2004 GWU Shift Cipher
Lesson 7: Simple Encryption
Cryptography: Cesar Cipher
How to use hash tables to solve olympiad problems
LONG MULTIPLICATION is just multiplying two numbers.
Florida State University
Presentation transcript:

National Cipher Challenge A beginner’s guide to codes and ciphers Part 3, the affine shift cipher

We have seen that the Caesar shift cipher is easy to break because it only has 26 keys. Inventing new ciphers is not easy, but maths can come to the rescue. To start we reformulate the Caesar shift using modular arithmetic. A modern cipher has two components, an algorithm and a key. For the Caesar shift the algorithm is “rotate the alphabet” and the key is the amount of rotation, measured by where the letter A moves to.

Arithmetic mod 26 Replace each letter by a number starting with A=1, B=2 and so on. Choose a key as a number between 1 and 26. Encrypt text by adding the key to each number from step 1. Read off the cipher text by translating the new numbers back to letters using the encoding 1=A, 2=B, …

Hang on, that doesn’t work! Suppose we choose the key k=8 and we want to encrypt the letter S First we replace S by the number 19. Then we add on 8 to get 27. But there is no letter labelled 27, the biggest is 26 which stands for Z.

The cipher wheel suggests what we should do

The cipher wheel suggests what we should do We wrap around the wheel. When we get to 27, that wraps back to 1 which represents the letter A. So the letter S is encrypted as the letter A. This should be familiar as the way we add hours on a 24 hour clock. 8 hours after 19:00 hours is 03:00 hours, not 27:00 hours. We just wrap around at 24. Similarly 8 hours after 11am can be described as 7pm, wrapping round at 12.

Modular arithmetic was invented by Karl Friedrich Gauss 1+2+3+…+100? That’s easy, it is 5050. He was a child genius who reinvented mathematics as an adult, discovering new forms of geometry, inventing the normal distribution in statistics and revolutionizing number theory. There is a (probably apocryphal) story that when Gauss was 8 his class were challenged to add the numbers from 1 to 100. Gauss worked out the trick, pairing 1 with 100, 2 with 99 and so on to quickly give the correct answer 5050. The story might not be true, but he invented so many clever ideas it is at least believable.

The great thing is that we can multiply in clock arithmetic as well as add. Example: Suppose it takes 25 minutes to mark an exam and a further 15 minutes to write up the marks list. If you have 38 scripts to mark and you start at 6pm, what time will you finish? 38*25= 950=900+50 = 15 hours and 50 minutes, or 38*25 = 50 mod 60. 6+15=21=12+9 (or, in modular arithimetic 6+15=9 mod 12) so 15 hours after 6pm is 9am, and you will finish marking at 10 minutes to 10 in the morning. A further 15 minutes for the marks list takes you to 5 past 10 since 50+15=5 mod 60.

The affine shift cipher Replace each letter by a number starting with A=1, B=2 and so on. For the key, choose two numbers a, b between 1 and 26. Encrypt text by multiplying each number from step 1 by a and adding b to each of the answers. Read off the cipher text by translating the new numbers back to letters using the encoding 1=A, 2=B

Example Choose a=3, b=7. We will encrypt the word “Affine” using this key. First replace A by 1, f by 6, i by 9, n by 14, e by 5. Multiplying by 3 and adding 7 gives 10, 25, 25, 8, 23, 22 mod 26. Which we convert to the letters: J Y Y H W V This is not a Caesar shift cipher because of the multiplication by 3.

How on earth can we crack that cipher?

What have we already learned about codebreaking? Good time to have a discussion around brute force and team work, and to remind them about frequency analysis

Let’s try to decipher the following affine shift cipher using intelligent brute force kar karvez dh kavevnxa Guessing that KAR = THE THE karvez dh kavevnxa So K= T, A=H and R=E Modular inverses will be discussed in lesson plan 4, but here we will just use intelligent guessing. THE THEvez dh THvevnxa

But now we are stuck! We can try guessing a bit more. What six letter words start THE? A Scrabble (or crossword) dictionary is really useful for this: http://www.crosswordsolver.org

In computing this would be called Using a lookup table

Looking up 6 letter words starting THE gives The smaller words in the word cloud are very rarely used. We can’t be certain they are wrong, but it is a good first guess.

We can rule out some of these We are working on the assumption that E is encrypted as R, so none of the words can have E in the last three letters. Similarly the last three letters must all be different.

This leaves us with a list of three possibilities Thefts Thermo Theory

V->F, E->T, Z->S THE THEvez dh THvevnxa Trying the word THEFTS would give us V->F, E->T, Z->S Which doesn’t work too well! There is no word in English beginning THFTF. THE THEFTS dh THFTFnxa

V->R, E->M, Z->O THE THEvez dh THvevnxa Trying the word THERMO would give us V->R, E->M, Z->O Which doesn’t work too well! There is no word in English beginning THRMR. THE THERMO dh THRMRnxa

Trying the word THEORY would give us V->O, E->R, Z->Y THE THEvez dh THvevnxa Trying the word THEORY would give us V->O, E->R, Z->Y Which is much more promising! There is a word in English beginning THORO, and the crossword dictionary comes to our aid once more! There is only one, and it is THOROUGH! THE THEORY dh THOROnxa

THE THEORY dh THOROUGH A smart guess would be that DH represents IS, to complete the decryption.

This text was encrypted using the affine shift x->3x+3. THE THEORY IS THOROUGH This text was encrypted using the affine shift x->3x+3. This text was encrypted with the affine shift x->3x+3.

Next time: How we could have discovered this with less guesswork (and, even better, less work).