Announcements:
Please use pencil on quizzes if possible
Questions? Today:
Congruences Chinese Remainder Theorem Modular Exponents
DTTF/NB479: Dszquphsbqiz Day 8 Announcements: Please use pencil on - - PowerPoint PPT Presentation
DTTF/NB479: Dszquphsbqiz Day 8 Announcements: Please use pencil on quizzes if possible Questions? Today: Congruences Chinese Remainder Theorem Modular Exponents Hill Cipher implementation Encryption Easy to do in MATLAB.
Please use pencil on quizzes if possible
Congruences Chinese Remainder Theorem Modular Exponents
Easy to do in MATLAB. Or find/write a matrix library for language X.
Uses matrix inverse. How do we determine if a matrix is invertible
Each letter in the alphabet is always replaced by another one.
Which ciphers have we seen are substitution ciphers?
Which aren’t and why?
Breaking ciphertext only uses linguistic structure. Frequencies of:
Single letters
Digrams (2-letter combinations)
Trigrams
Where do T&W get their rules like “80% of letters preceding n are vowels”? (p. 26)
See http://keithbriggs.info/documents/english_latin.pdf
Lots of trial and error when done by hand. Could automate with a dictionary.
Goldilocks’ discovery of Newton’s method
changes.
HTTP://XKCD.COM/872/
For small numbers, do by hand For larger numbers, compute a-1 using Euclid
) (mod ) (mod , ) (mod ) (mod ) (mod | ) (mod . . ) (mod , , , , n c a n c b b a n a b iff n b a n a a a n iff n a nk b a t s Z k if n b a n Z d c b a Consider ≡ ⇒ ≡ ≡ ≡ ≡ ≡ ≡ + = ∈ ∃ ≡ ≠ ∈ ) (mod ), (mod 1 ) , gcd( ) (mod ) )(mod ( ) ( ) )(mod ( ) ( ), (mod , n c b then n ac ab and n a If n bd ac n d b c a n d b c a then n d c b a If ≡ ≡ = ≡ − ≡ − + ≡ + ≡ ≡
x0, x0+n/d,x0+2n/d,…x0+(d-1)n/d Always write solution with the
This is an easy program to code
1-2
Given gcd(m,n)=1. For integers a and b, there exists
Find them.
2 ≡
3-4
Let m1, m2,… mk be integers such that gcd(mi, mj)=1
2 2 1 1 k k
Get the powers of 3 by repeatedly squaring 3,
5-6
Repeatedly square
3, but take mod at each step.
Then multiply the
terms you need to get the desired power.
17 3 6 3 5 3 9 256 16 3 16 4 3 4 289 17 3 ) 2 ( 17 36 6 3 6 25 5 3 5 81 9 3 9 3
1024 512 256 2 128 2 64 2 32 2 16 2 8 2 4 2
≡ ≡ ≡ ≡ ≡ ≡ ≡ = ≡ ≡ = − ≡ ≡ = ≡ ≡ = ≡ ≡ = ≡
) 19 (mod 9 3 ) 1248480 ( 3 ) 17 )( 16 )( 9 )( 5 )( 6 )( 17 ( 3 ) 3 )( 3 )( 3 )( 3 )( 3 )( 3 ( 3
2000 2000 2000 16 64 128 256 512 1024 2000
≡ ≡ ≡ ≡
(All congruences are mod 19)
1024 512 256 128 2 64 2 32 2 16 2 8 2 4 2
) 152 (mod 9 3 ) 384492875 ( 3 ) 17 )( 73 )( 9 )( 81 )( 25 )( 17 ( 3 ) 3 )( 3 )( 3 )( 3 )( 3 )( 3 ( 3
2000 2000 2000 16 64 128 256 512 1024 2000
≡ ≡ ≡ ≡