6
CSC 386 – Computer Security Scott Heggen

CSC 386 – Computer Security

Embed Size (px)

DESCRIPTION

CSC 386 – Computer Security. Scott Heggen. Agenda. Cryptography. Substitution Cipher (Caesar Cipher). k =. Alice. Bob. “ egc hjj ”. C = E( k,m ) = “ egc hjj ”. D. E. “bad egg”. “bad egg”. k. k. Eve. Ciphers. How can we improve upon the Caesar Cipher?. - PowerPoint PPT Presentation

Citation preview

Page 1: CSC 386 – Computer Security

CSC 386 – Computer Security

Scott Heggen

Page 2: CSC 386 – Computer Security

Agenda

• Cryptography

Page 3: CSC 386 – Computer Security

Substitution Cipher (Caesar Cipher)

A C

B E

C F

D G

E H

F I

G J

… …

k = Alice Bob

Eve

k k

“bad egg” EC = E(k,m) = “egc hjj”

“bad egg”D “egc hjj”

Page 4: CSC 386 – Computer Security

Ciphers

• How can we improve upon the Caesar Cipher?

Page 5: CSC 386 – Computer Security

Other Substitution Ciphers

Original Alphabet

Caesar Offset

(shift +2)

RandomSubstitution

A C L

B E K

C F M

D G Y

E H A

F I J

G J F

… … …

k =

Message index

Pseudo-Random

Offset

0 Shift +4

1 Shift -4

2 Shift +6

3 Shift +22

4 Shift +1

5 Shift -14

6 Shift -8

… …

Page 6: CSC 386 – Computer Security

Assignment

• For Monday:• Create a Python script which takes in two files: original_message.txt and key.txt• The original_message.txt file can contain any message you chose to send me• The key.txt file must contain your B-number, without the letter B• The Python script must compute C using the message and the key. Your

encryption algorithm E should be a pseudo-random substitution cipher which shifts each letter of message by the integer value in key with the same index (e.g., message[0] should be shifted by key[0] letters)

• Submit to Moodle:• Your Python Script• coded_message.txt