Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Classical Cryptography - Cryptography - Lecture Slides, Slides of Cryptography and System Security

Some concept of Cryptography are Block Ciphers, Classical Cryptography, Computational, Cryptanalysis, Digital Signatures, Knowledge Proofs, Number Theory, One Way Functions, Perfect Secrecy, Perfect Secrecy. Main points of this lecture are: Classical Cryptography, Classical Cryptosystem, Possible Plaintexts, Possible Ciphertexts, Encryption Rules, Decryption Rules, Plaintext Blocks, Ciphertext String, Shift Cipher Disk, Prime Factor

Typology: Slides

2012/2013

Uploaded on 04/27/2013

divyaa
divyaa 🇮🇳

4.4

(59)

71 documents

1 / 31

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Classical Cryptography
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Classical Cryptography - Cryptography - Lecture Slides and more Slides Cryptography and System Security in PDF only on Docsity!

Classical Cryptography

2

Classical Cryptosystem

A CRYPTOSYSTEM is a 5-tuple

(P , C , K , E , D ) satisfying

  1. P is a finite set of possible plaintexts
  2. C is a finite set of possible ciphertexts
  3. K is a finite set of possible keys
  4. E is a finite set of encryption rules indexed by K so for each K ∈ K there is a function eK : P → C
  5. D is a finite set of decryption rules indexed by K so for each K ∈ K there is a function d (^) K : C → P
  6. for each K ∈ K , d (^) KeK = identity

4

Shift Cipher disk

5

Shift Cipher

  • denotes the set {0, 1, ... , 25} with addition and multiplication taken modulo 26 The shift cipher is the cryptosystem defined by taking

Letters are identified with numbers: A=0, B=1, .... , Z= Z 26 P = C = K = Z 26 eK ( x ) = ( x + K ) mod 26 dK ( y ) = ( yK ) mod 26

7

Ring

  • Often, addition too easily cracked
  • Extra structure obfuscates: multiplication DEF: A commutative ring is a 3-tuple ( R,+, · ) which satisfies:
  1. ( R,+ ) is a commutative group
  2. R is closed under “ · ” - which is associative, commutative and has identity
  3. Distributive: 1 ∈ Rx , y , zR , x ( y + z ) = xy + xz and ( x + y ) z = xz + yz

8

Translational Group

Cipher

Taking any group G (even non-commutative) can generalize shift cipher by using G ’s “addition” rule:

  • G is translated by the element K P = C = K = G eK ( x ) = x + K and dK ( x ) = x + (− K )

10

Field

  • When almost every element in ring is invertible (except 0 which can’t be) ring is called field DEF: A field is a commutative ring F such that F* = F - {0}
  • Z 26 is not a field

11

and the Euler

Phi Function

DEF: The ring is the set with addition and multiplication taken mod m. LEMMA: x is invertible in iff gcd(x, m) = 1. COR: is a field iff m is prime. DEF:. In other words, is the number of elements in which are relatively prime to m.

Z

m

!( m )

!( m ) = |Z ∗ m | Z m !( m ) Z m { 0 , 1 ,... , m − 1 } Z m Z m

13

Affine Ring Cipher

Can define a general cipher over any ring, even non-commutative rings (where multiplication non-commutative, but addition commutative).

  • For K = ( a, b )
  • When this is the affine cipher. P = C = R K = R ∗ × R R = Z 26 eK ( x ) = ax + b and dK ( y ) = a − 1 ( yb )

14

Substitution Cipher

Shift and Affine cipher have limited key spaces. Better to use all possible permutations of :

  • consists of all permutations of.
  • In practice, may use keyword to remember. Z 26 P = C = Z 26 K Z 26 e! ( x ) = !( x ) and d! ( y ) =! − 1 ( y ) ! !

16

Modular Matrix Inverse

THM: Let A be a square matrix whose entries are in. A is invertible modulo m iff det( A ) is invertible in. Furthermore the inverse of A mod- m is given by where is the inverse of A over.

  • is computed using Gaussian elimination, Cramer’s rule, etc. Z m Z m A − 1 mod m = (det( A ) − 1 mod m ) · (det( A ) · A − 1 ) A R − 1 A − 1

17

Inverting modular

matrices in matlab

  1. (^) Define the matrix A using nested brackets.
  2. (^) Compute the determinant d and store it.
  3. (^) Determine if d is relatively prime to 26. If not, matrix not invertible so STOP.
  4. (^) ELSE, invert d mod-26 using extended gcd and store value in e.
  5. (^) Invert A in matlab, multiply result by d*e, and reduce mod-

19

matlab example 2

**>> A = [ [21 10] ; [18 5] ];

d = det(A) d = - [g, e, t] = gcd(d,26) g = 1 e = 9 t = 26 B = A^- B = -0.0667 0. 0.2400 -0. B = Bde B = 45.0000 -90. -162.0000 189. B = round(B) B = 45 - -162 189 B = mod(B,26) B = 19 14 20 7 C = AB C = 599 364 442 287 mod(C,26) ans = 1 0 0 1*

20

Hill Cipher patent