ENGR/CS 101 CS Session Lecture 5 No programming today Submission - - PowerPoint PPT Presentation

engr cs 101 cs session lecture 5
SMART_READER_LITE
LIVE PREVIEW

ENGR/CS 101 CS Session Lecture 5 No programming today Submission - - PowerPoint PPT Presentation

ENGR/CS 101 CS Session Lecture 5 No programming today Submission system will be demonstrated at the end of class. Lecture 5 ENGR/CS 101 Computer Science Session 1 Outline Problem: How to send a secret message? Codes and ciphers


slide-1
SLIDE 1

ENGR/CS 101 CS Session Lecture 5

 No programming today  Submission system will be demonstrated at

the end of class.

Lecture 5 ENGR/CS 101 Computer Science Session 1

slide-2
SLIDE 2

Outline

 Problem: How to send a secret message?  Codes and ciphers  Substitution ciphers

Lecture 5 ENGR/CS 101 Computer Science Session 2

slide-3
SLIDE 3

Problem:

How to send a secret message?

 Steganography ("concealed writing"):

science of sending concealed messages. Includes physical concealment like invisible ink, microdots...

 Cryptography ("hidden writing"): how to

  • bscure message so it cannot be read even if
  • intercepted. Use codes and ciphers.

Lecture 5 ENGR/CS 101 Computer Science Session 3

slide-4
SLIDE 4

Codes & Ciphers

 Code: whole words or phrases replaced by a

word, letter, or a number. Like an alien language; uses translation code book.

 Cipher: individual letters are replaced by

  • ther letters or symbols.

 Plaintext: message in normal language  Ciphertext: message in secret form

Lecture 5 ENGR/CS 101 Computer Science Session 4

slide-5
SLIDE 5

Ciphers

 Transposition cipher: rearrange letters of

message.

 Scytale: strip of writing material wrapped around a

dowel; write message across dowel.

 Block: arrange message into a block, rewrite

vertical lines

 Substitution cipher: replace letters with other

letters

Lecture 5 ENGR/CS 101 Computer Science Session 5

slide-6
SLIDE 6

Cipher = Algorithm + Key

 Algorithm: a series of well-defined steps that

can be followed as a procedure.

 Key: auxiliary information used by an

  • algorithm. Different keys produce different

ciphers using the same algorithm.

Lecture 5 ENGR/CS 101 Computer Science Session 6

slide-7
SLIDE 7

Caesar Shift Cipher

 Algorithm: substitute a letter with the letter n

places to the right

 Key: letter to shift 'A' to that is n places to the

  • right. E.g. A -> I is shifting 8 places to the right:

Lecture 5 ENGR/CS 101 Computer Science Session 7

A B C D E F G H I J K L M I J K L M N O P Q R S T U N O P Q R S T U V W X Y Z V W X Y Z A B C D E F G H plain cipher plain cipher

slide-8
SLIDE 8

In-class Exercise

 Practice enciphering and deciphering using

Caesar shift cipher.

 Turn in worksheet at the end of class.

Lecture 5 ENGR/CS 101 Computer Science Session 8

slide-9
SLIDE 9

What if the key is unknown?

 How many possible keys are there for the

Caesar Shift Cipher?

 How easy would it be to find the key?

Lecture 5 ENGR/CS 101 Computer Science Session 9

slide-10
SLIDE 10

Polyalphabetic Ciphers

 Make cipher harder to break by using multiple

substitution alphabets

 Vigenere cipher: key is a "word" rather than

just a single letter. Algorithm is to use the key letters to change the Caesar cipher shift key for each letter of plaintext.

Lecture 5 ENGR/CS 101 Computer Science Session 10

slide-11
SLIDE 11

Vigenere Cipher Example

 For example, if the

key word is "LION" and the plaintext message is "GO ACES", the ciphertext would be "RW OPPA", formed as shown to the right.

plain key cipher

G L R O I W A O O C N P E L P S I A

Lecture 5 ENGR/CS 101 Computer Science Session 11

slide-12
SLIDE 12

Polyalphabetic Ciphers

 Suppose we allow any letter to be substituted

by any other letter? E.g. a cryptoquip puzzle.

 The key would a substitution table mapping

each letter to another letter.

 How many possible keys are there for this

cipher?

Lecture 5 ENGR/CS 101 Computer Science Session 12

slide-13
SLIDE 13

400 Million Billion Billion

 Just how big is this number?  6.5 billion people on Earth; 31 million

seconds in a year. If everyone on Earth checked one key per second, ...

 We can conclude that checking every

possible key is not a feasible way of trying to decipher an arbitrary substitution cipher.

Lecture 5 ENGR/CS 101 Computer Science Session 13

slide-14
SLIDE 14

A Better Way to Decipher

 English letter

frequency: E, T, A, O, ...

 One/two letter

words: "I", "a", "to", "of", ...

 Common words:

"the", "and", ...

 Repeated letters  Context

Lecture 5 ENGR/CS 101 Computer Science Session 14

slide-15
SLIDE 15

Enigma Machine

 Random substitution cipher

represented using a code

  • wheel. Originally 3 code

wheels, later 5 wheels.

 Instead of always starting with

same letter on wheel as A, just encipher the current letter

  • f plaintext with the next letter
  • n wheel.

Lecture 5 ENGR/CS 101 Computer Science Session 15