Announcements: Please use pencil on quizzes if possible Please use pencil on quizzes if possible Knuth quotes, part 1 Knuth quotes, part 1Questions?Today:

Slides:



Advertisements
Similar presentations
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Advertisements

Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
22C:19 Discrete Structures Integers and Modular Arithmetic
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
IB HL Adrian Sparrow Factor and remainder theorem.
Announcements: Programming exam next Thursday on breaking codes from chapter 2 Programming exam next Thursday on breaking codes from chapter 2 Written.
Announcements: Subscribe to Angel forums Subscribe to Angel forumsQuestions? Roll Call Today: affine ciphers DTTF/NB479: DszquphsbqizDay 2.
Announcements: We’ll attempt to grade Friday’s quizzes by end of day on Friday and leave outside my office We’ll attempt to grade Friday’s quizzes by end.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Announcements: Homework 1 returned. Comments from Kevin? Homework 1 returned. Comments from Kevin? Matlab: tutorial available at
The Algebra of Encryption CS 6910 Semester Research and Project University of Colorado at Colorado Springs By Cliff McCullough 20 July 2011.
Announcements: Assignment 2 finalized Assignment 2 finalizedQuestions?Today: Wrap up Hill ciphers Wrap up Hill ciphers One-time pads and LFSR One-time.
Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on.
Chapter 8 – Introduction to Number Theory Prime Numbers
DTTF/NB479: Dszquphsbqiz Day 9 Announcements: Homework 2 due now Homework 2 due now Computer quiz Thursday on chapter 2 Computer quiz Thursday on chapter.
Announcements: Homework 1 coming Monday… Homework 1 coming Monday… Practical quiz during week 4 on putting your code to work Practical quiz during week.
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.
3.1 - Solving Systems by Graphing. All I do is Solve!
An Introduction to Hill Ciphers Using Linear Algebra Brian Worthington University of North Texas MATH /10/2010.
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Arithmetic.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
Polyalphabetic Substitution Ciphers. First Steps Towards Complexity  If one alphabet is good, then two alphabets must be better!  By doubling the number.
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
Integers Number Theory = Properties of Integers
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.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Diffusion and Confusion Two properties that a good cryptosystem should have: Diffusion: change of one character in the plaintext results in several characters.
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
Copyright © Cengage Learning. All rights reserved.
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.
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.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
CRYPTOGRAPHY AND THE MATH MAJOR Dr. Mihai Caragiu Mathematics Department Ohio Northern University.
Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.
Announcements: Matlab tutorial linked to in syllabus Matlab tutorial linked to in syllabusQuestions?Today: Block ciphers, especially Hill Ciphers Modular.
Chinese Remainder Theorem Dec 29 Picture from ………………………
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Modular (Remainder) Arithmetic n = qk + r (for some k; r < k) eg 37 = (2)(17) + 3 Divisibility notation: 17 | n mod k = r 37 mod 17 = 3.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Network and Computer Security (CS 475) Modular Arithmetic
9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.1 CSE565: Computer Security Lecture 7 Number Theory Concepts Shambhu Upadhyaya Computer Science & Eng. University.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
Fermat’s Little Theorem The RSA Cryptosystem will require exponentiation to decrypt messages. Exponentiation Notation Example 1: Compute Exponentials Example.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
Cryptography Lecture 14 Arpita Patra © Arpita Patra.
Lecture 6. RSA Use in Encryption to encrypt a message M the sender: – obtains public key of recipient PU={e,n} – computes: C = M e mod n, where 0≤M
Dr. Saatchi, Seyed Mohsen 1 Arab Open University - AOU T209 Information and Communication Technologies: People and Interactions Sixth Session.
Introduction to Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
Copyright © Zeph Grunschlag, RSA Encryption Zeph Grunschlag.
3.1 - Solving Systems by Graphing
Mathematics of Cryptography
Chapter Applications of Number Theory Some Useful Results
Classical Polygraphic Ciphers
Number Theory (Chapter 7)
Solving Systems of Equations
Modular Arithmetic and Change of Base
Applied Symbolic Computation (CS 300) Modular Arithmetic
Systems Architecture I
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Clements MAΘ October 30th, 2014
Cryptography Lecture 16.
Presentation transcript:

Announcements: Please use pencil on quizzes if possible Please use pencil on quizzes if possible Knuth quotes, part 1 Knuth quotes, part 1Questions?Today: Congruences Congruences Chinese Remainder Theorem Chinese Remainder Theorem Modular Exponents Modular Exponents DTTF/NB479: DszquphsbqizDay 8

Hill Cipher implementation Encryption Easy to do in Matlab. Easy to do in Matlab. Or find/write a matrix library for language X. Or find/write a matrix library for language X.Decryption Uses matrix inverse. Uses matrix inverse. How do we determine if a matrix is invertible mod 26? How do we determine if a matrix is invertible mod 26?

How to break via known plaintext? Good work on last session’s quiz. Idea: Assume you know the matrix size, n. Then grab n sets of n plaintext chars  ciphertext This gives n 2 equations and n 2 unknowns. Then solve using basic linear algebra, but mod n. Caveat: sometimes it doesn’t give a unique solution, so you need to choose a different set of plaintext. Hmm. This could make a nice exam problem…

Substitution ciphers Each letter in the alphabet is always replaced by another one. Which ciphers have we seen are substitution ciphers? Which ciphers have we seen are substitution ciphers? Which aren’t and why? Which aren’t and why? Breaking ciphertext only uses linguistic structure. Frequencies of: Single letters Single letters Digrams (2-letter combinations) Digrams (2-letter combinations) Trigrams Trigrams Where do T&W get their rules like “80% of letters preceding n are vowels”? (p. 26) Where do T&W get their rules like “80% of letters preceding n are vowels”? (p. 26) See Lots of trial and error when done by hand. Could automate with a dictionary.

Fairy Tales Goldilocks’ discovery of Newton’s method of approximation required surprisingly few changes. HTTP :// XKCD. COM /872/

Basics 4: Congruence Def: a≡b (mod n) iff (a-b) = nk for some int k Properties You can easily solve congruences ax≡b (mod n) if gcd(a,n) = 1. For small numbers, do by hand For small numbers, do by hand For larger numbers, compute a -1 using Euclid For larger numbers, compute a -1 using Euclid

Solving ax≡b(mod n) when gcd(a,n)≠1 Let gcd(a,n)=d If d doesn’t divide b then no solution Else divide everything by d and solve (a/d)x=(b/d)(mod (n/d)) Get solution x 0 Multiple solutions: x 0, x 0 +n/d,x 0 +2n/d,…x 0 +(d-1)n/d Always write solution with the original modulus This is an easy program to code once you have Euclid…  Example: 2x ≡ 7(mod 10) Q1,Q2 Example: 3x ≡ 3 (mod 6)

How could we write x ≡ 16 (mod 35) as a system of congruences with smaller moduli?

Chinese Remainder Theorem Equivalence between a single congruence mod a composite number and a system of congruences mod its factors Two-factor form Given gcd(m,n)=1. For integers a and b, there exists exactly 1 solution (mod mn) to the system: Given gcd(m,n)=1. For integers a and b, there exists exactly 1 solution (mod mn) to the system:

CRT Equivalences let us use systems of congruences to solve problems Solve the system: How many solutions? Find them. Find them. Q3,Q4

Chinese Remainder Theorem n-factor form Let m 1, m 2,… m k be integers such that gcd(m i, m j )=1 when i ≠ j. For integers a 1, … a k, there exists exactly 1 solution (mod m 1 m 2 …m k ) to the system: Let m 1, m 2,… m k be integers such that gcd(m i, m j )=1 when i ≠ j. For integers a 1, … a k, there exists exactly 1 solution (mod m 1 m 2 …m k ) to the system:

Modular Exponentiation Compute last digit of 3^2000 Compute 3^2000 (mod 19) Idea: Get the powers of 3 by repeatedly squaring 3, BUT taking mod at each step. Get the powers of 3 by repeatedly squaring 3, BUT taking mod at each step. Q5

Modular Exponentiation Compute 3^2000 (mod 19) Technique: Repeatedly square 3, but take mod at each step. Repeatedly square 3, but take mod at each step. Then multiply the terms you need to get the desired power. Then multiply the terms you need to get the desired power. Book’s powermod() (All congruences are mod 19)

Modular Exponentiation Compute 3^2000 (mod 152)