Announcements: Programming exam next Thursday on breaking codes from chapter 2 Programming exam next Thursday on breaking codes from chapter 2 Written.

Slides:



Advertisements
Similar presentations
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesThe Mighty Mod.
Advertisements

Cryptology with Spreadsheets A Computer Course for Everyone Jim Belk Texas A&M University.
CS 202 Epp section ?? Aaron Bloomfield
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Public Key Encryption Algorithm
Announcements: Please pass in Assignment 1 now. Please pass in Assignment 1 now. Assignment 2 posted (when due?) Assignment 2 posted (when due?)Questions?
Announcements: Subscribe to Angel forums Subscribe to Angel forumsQuestions? Roll Call Today: affine ciphers DTTF/NB479: DszquphsbqizDay 2.
Announcements: Please use pencil on quizzes if possible Please use pencil on quizzes if possible Knuth quotes, part 1 Knuth quotes, part 1Questions?Today:
Announcements: Matlab: tutorial available at Matlab: tutorial available at
ENGG2013 Unit 11 Row-Rank Feb,
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
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.
Announcements: Computer exam next class Computer exam next classQuestions? DTTF/NB479: DszquphsbqizDay 10.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
Announcements: Homework 1 returned. Comments from Kevin? Homework 1 returned. Comments from Kevin? Matlab: tutorial available at
Announcements: 1. HW6 due now 2. HW7 posted Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions.
Announcements: Pass in Assignment 1 now Pass in Assignment 1 now Meet my assistant Kevin Reed Meet my assistant Kevin Reed Assignment 2 (tentative) posted.
Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz today Written quiz today Computer quiz next Friday on breaking.
Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on.
Cryptography & Number Theory
Announcements: Assignment 1 due tomorrow in class. Assignment 1 due tomorrow in class.Questions? Roll Call Today: Vigenere ciphers Pronunciation? DTTF/NB479:
Announcements: Homework 2 due now Homework 2 due now Quiz this Friday on concepts from chapter 2 Quiz this Friday on concepts from chapter 2 Practical.
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
Properties of the Integers: Mathematical Induction
1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University.
CS1101: Programming Methodology Aaron Tan.
Polyalphabetic Substitution Ciphers. First Steps Towards Complexity  If one alphabet is good, then two alphabets must be better!  By doubling the number.
A Cryptography Education Tool Anna Yu Department of Computer Science College of Engineering North Carolina A&T State University June 18, 2009.
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
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.
MATH 224 – Discrete Mathematics
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Great Theoretical Ideas in Computer Science.
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.
Extended Euclidean Algorithm Presented by Lidia Abrams Anne Cheng.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
CSE 311 Foundations of Computing I Lecture 15 Recursive Definitions and Structural Induction Autumn 2011 CSE 3111.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 4 (Part 3): Mathematical Reasoning, Induction.
Announcements: HW4 – DES due Thursday HW4 – DES due Thursday I have installed, or will install: Java, C (gcc), Python. What other languages? Please make.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Announcements: Please pass in Assignment 1 now. Please pass in Assignment 1 now. Assignment 2 posted (when due?) Assignment 2 posted (when due?)Questions?
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Network and Computer Security (CS 475) Modular Arithmetic
Announcements: Homework 2 returned Homework 2 returned Monday: Written (concept and small calculations) exam on breaking ch 2 ciphers Monday: Written (concept.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
CSE 311 Foundations of Computing I Lecture 14 Euclid’s Algorithm Mathematical Induction Autumn 2012 CSE
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Application: Algorithms Lecture 20 Section 3.8 Wed, Feb 21, 2007.
Discrete Mathematics 4. NUMBER THEORY Lecture 7 Dr.-Ing. Erwin Sitompul
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2012 Nitesh Saxena.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Application: Algorithms Lecture 19 Section 3.8 Tue, Feb 20, 2007.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2014.
Substitution Ciphers Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
Information and Computer Security CPIS 312 Lab 8 1 Asymmetric Key Algorithms RSA Algorithm TRIGUI Mohamed Salim.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division Fermat's little theorem intro.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
Encryption with Keys and Passwords
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division
Chapter 4 (Part 3): Mathematical Reasoning, Induction & Recursion
Prelude to Public-Key Cryptography
CSE 311: Foundations of Computing
Copyright © Zeph Grunschlag,
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

Announcements: Programming exam next Thursday on breaking codes from chapter 2 Programming exam next Thursday on breaking codes from chapter 2 Written exam at start of week 4 on concepts from chapter 2 Written exam at start of week 4 on concepts from chapter 2Questions? This week: see schedule page 2 days of chapter 3, then back to Hill cipher 2 days of chapter 3, then back to Hill cipher DTTF/NB479: DszquphsbqizDay 6

Vigenere is more secure than affine cipher, but still breakable You should be able to answer: 1. What makes a Vigenere cipher more secure than a shift cipher? 2. Why does the max of dot(A 0,A i ) occur when i==0? 3. What are the advantages and disadvantages of using the dot product method (method 2) vs. max is ‘e’ (method 1) to decrypt the key? 4. How do we find the key length?

Visualization /Vigenere.html /Vigenere.html Play with now and for homework Thanks to Dr. Dino Schweitzer, USAFA, who I met last Friday, for pointing me to his demo! Aren’t you glad I was at SIGCSE?

Does combining Vigenere with affine ciphers help? What if we modified the Vigenere cipher so that each individual letter was not simply shifted, but the result of an affine function?

Vigenere can be made secure with appropriate precautions From Key must be as long as the plaintext message. Build the key from random characters. Never use the key again. Don't use text decorations (spaces, punctuations, capitalization). Protect the key.

Vigenere trivia (if time at end) Consider Gadsby by Ernest Vincent Wright, February 1939: What do you notice about it?

Back to Basics: 3. GCD gcd(a,b)=max j (j|a and j|b). Def.: a and b are relatively prime iff gcd(a,b)=1 gcd(14,21) easy… What about gcd(1856, 5862)? Or gcd( , )? Do you really want to factor each one? What’s our alternative?

Euclid’s Algorithm gcd(a,b) { if (a < b) swap (a,b) // a > b r = a % b while (r ~= 0) { a = b b = r r = a % b } gcd = b // last r ~= 0 } Calculate gcd(1856, 5862) =2 Q1

Euclid’s Algorithm gcd(a,b) { if (a > b) swap (a,b) // a > b r = a % b while (r ~= 0) { a = b b = r r = a % b } gcd = b // last r ~= 0 } Assume a > b Let q i and r i be the series of quotients and remainders, respectively, found along the way. a = q 1 b + r 1 b = q 2 r 1 + r 2 r 1 = q 3 r 2 + r 3... r i-2 = q i r i-1 + r i... r k-2 = q k r k-1 + r k r k-1 = q k+1 r k You’ll prove this computes the gcd in Homework 3 (by induction)… r k is gcd(a,b) Q2

Fundamental result: If d = gcd(a,b) then ax + by = d For some integers x and y. These ints are just a by-product of the Euclidean algorithm! Allows us to find a -1 (mod n) very quickly… Choose b = n and d = 1. Choose b = n and d = 1. If gcd(a,n) =1, then ax + ny = 1 If gcd(a,n) =1, then ax + ny = 1 ax = 1 (mod n) because it differs from 1 by a multiple of n ax = 1 (mod n) because it differs from 1 by a multiple of n Therefore, x = a -1 (mod n). Therefore, x = a -1 (mod n). Why does the result hold? How do we find x and y? Q3

Why does this work? Given a,b ints, not both 0, and gcd(a,b) = d. Prove ax + by = d Recall gcd(a,b,)=d = r k is the last non-zero remainder found via Euclid. We’ll show the property true for all remainders r j (by strong induction) Assume a > b Let q i and r i be the series of quotients and remainders, respectively, found along the way. a = q 1 b + r 1 b = q 2 r 1 + r 2 r 1 = q 3 r 2 + r 3... r i-2 = q i r i-1 + r i... r k-2 = q k r k-1 + r k r k-1 = q k+1 r k Q4

How to find x and y? To find x, take x 0 = 1, x 1 = 0, x j = x j-2 – q j-1 x j-1 To find y, take y 0 = 0, y 1 = 1, y j = y j-2 – q j-1 y j-1 Use to calculate x k and y k (the desired result) Example:gcd(1856,5862)=2 Yields x = -101, y = 319 Assume a > b Let q i and r i be the series of quotients and remainders, respectively, found along the way. a = q 1 b + r 1 b = q 2 r 1 + r 2 r 1 = q 3 r 2 + r 3... r i-2 = q i r i-1 + r i... r k-2 = q k r k-1 + r k r k-1 = q k+1 r k x and y swapped from book, which assumes that a < b on p. 69 Check: 5862(-101) (319) = 2? Q2, Q5