1 / 12

Cryptanalysis of the Affine Cipher

Cryptanalysis of the Affine Cipher. Ciphertext-only attack: Brute-force (try possible keys) Frequency analysis Any other ideas ? Suppose we know two symbols and what they map to. Example: 0  3 7  10. Cryptanalysis of the Affine Cipher. More challenging examples: 4  17

smattingly
Télécharger la présentation

Cryptanalysis of the Affine Cipher

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cryptanalysis of the Affine Cipher • Ciphertext-only attack: • Brute-force (try possible keys) • Frequency analysis • Any other ideas ? • Suppose we know two symbols and what they map to. • Example: 0  3 • 7  10

  2. Cryptanalysis of the Affine Cipher More challenging examples: 4  17 19  3 4  17 19  10

  3. Cryptanalysis of the Affine Cipher • Remarks: • For which attacks do we have two pairs of symbols and their maps ? • Can we use this idea for the ciphertext-only attack ? • What if we have only one pair of a symbol and its map ? • Read Section 3.3 to learn more about congruences.

  4. Some More Number Theory Recall that there are 12 elements a2Z26 such that gcd(a,26)=1. In general, for m>0, the number of elements of Zm that are relatively prime to m is denoted by Á(m) and it is usually referred to as the Euler phi function. Examples: Á(26) = Á(p) = if p is a prime

  5. Some More Number Theory For non-prime numbers: Suppose m = ¦i=1,…,n pie where the pi’s are distinct primes and ei>0 for i2{1,2,…,n}. Then, Á(m) = ¦i=1,…,n (pie – pie -1) How many keys do we have for the affine cipher over Zm ?

  6. Some More Number Theory • Computing a-1 (mod m): • Option 1: brute-force • advantages / disadvantages ? • Option 2: ??? • First, some math analysis: For which a 2 Zm the inverse a-1 does not exist in Zm ?

  7. Some More Number Theory Computing gcd(a,b):

  8. Euclidean Algorithm Def EuclideanAlgorithm (a,b): // a,b>0, integers r0 = a, r1 = b m = 0 while rm+1 0: m++ qm = b rm-1/rmc rm+1 = rm-1 – qmrm return rm

  9. Extended Euclidean Algorithm Given integers a,b>0, it computes r,s,t such that: r = gcd(a,b) sa + tb = r How is it helpful for computation of a-1 ?

  10. Extended Euclidean Algorithm Def ExtendedEuclideanAlgorithm (a,b): // a,b>0, integers r0 = a, r1 = b, s0 = 1, s1 = 0, t0 = 0, t1 = 1 m = 0 while rm+1 0: m++ qm = b rm-1/rmc rm+1 = rm-1 – qmrm tm+1 = tm-1 – qmtm sm+1 = sm-1 – qmsm return rm, sm, tm

  11. Extended Euclidean Algorithm • Remarks: • By induction on j we can show that for j2{0,1,…,m}: • rj = sja + tjb • Hence, the algorithm is correct. • We can save space by using many fewer variables. • Running time ?

  12. Solving ax ´ c (mod m) • useful for cryptanalysis of e.g. the affine cipher • Possibilities: • if gcd(a,m)=1, then: • if gcd(a,m)=d>1 and d does not divide c, then: • if gcd(a,m)=d>1 and d divides c, then:

More Related