# William Stallings, Cryptography and Network Security 3/e - Get Now PowerPoint

Document Sample

```					CRYPTOGRAPHY AND INFORMATION SECURITY
 Lecturer: Dr. Nguyen Nam Hong
 Tel.: 048781437.
 Mob.: 0912312816.
 Email:
 nguyennamhong2003@yahoo.com.au
 Website:
 www.freewebs.com/namhongthanhloc
Chapter 22. Revision
Chapter 22. rEVISION (1/3)
1.1. Substitution Cipher
1.2. Affine Cipher
1.3. Vigenere Cipher
1.4. Hill Cipher
1.5. Permutation Cipher
2.1. Extended Euclidean Algorithm
2.2. The Chinese Remainder Theory
2.3. RSA CryptoSystem

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 2 / 32
Chapter 21. Firewalls (2/3)
2.4. The Jacobi Symbol
2.5. Rabin CryptoSystem
3.1. Elgamal CryptoSystem
3.2. Shanks Algorithm
3.3. Polig-Hellman Algorithm
3.4. Menezes-Vanstone CryptoSystem
3.5. Merkle-Hellman CryptoSystem
4.1. Elgamal Digital Signature

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 3 / 32
Chapter 21. Firewalls (3/3)
4.2. DSS
4.3. Lampoert Digital Signature
4.4. Chaum-Van Antwerpen Digital Signature
4.5. Van Heyst-Pederson Digital Signature
5.1. Blom Key Distribution with k = 1
5.2. Blom Key Distribution with k = 2
5.3. Diffie-Hellman Key Distribution
5.4. MTI Key Distribution
5.5. Girault Key Agreement
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 4 / 32
1.1. Substitution Cipher (1/2)
• Figure 1.3:
Let P = C = Z26.
Let K consists of all posible permutations of the
26 symbols 0, 1, …, 25.
For each permutation π Є K, define
Eπ(x) = π(x)
and
Dπ(x) = π-1(x)
where π-1 is the inverse permutation to π

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 5 / 32
1.1. Substitution Cipher (2/2)
• Example of π:
a    b    c   d   e    f   g    h    i   j   k    l   m
X    N    Y   A   H    P   O    G   Z    Q   W    B   T
n    o    p   q   r    s   t    u   v    w   x    y   z
S    F    L   R   C    V   M    U   E    K    J   D   I

• Example of Encryption:
Plaintext : wewillmeetatmidnight
Ciphertext: KHKZBBTHHMXXTZASZOGM
• Example of Decryption:
Ciphertext: KHKZBBTHHMXXTZASZOGM
Plaintext : wewillmeetatmidnight
Dr. Nguyen Nam Hong, Le Quy Don Technical University           Slide 6 / 32
1.2. Affine Cipher (1/2)
• Figure 1.4:
Let P = C = Z26.
Let K = {(a,b) Є Z26 x Z26 : gcd(a,26)=1}
For each k = (a,b) Є K, define
Ek(x) = ax + b mod 26
and
DK(y) = a-1(y-b) mod 26
(x, y Є Z26)

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 7 / 32
1.2. Affine Cipher (2/2)
• Example of K:
K = (7,3) (7-1 mod 26 = 15)
• Example of Encryption:
Plaintext : wewillmeetatmidnight
Ciphertext: BFBHCCJFFGDGJHYQHTAG
• Example of Decryption:
Ciphertext: BFBHCCJFFGDGJHYQHTAG
Plaintext : wewillmeetatmidnight

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 8 / 32
1.3. Vigener Cipher (1/2)
• Figure 1.5:
Let m be some fixed positive integer.
Let P = C = K = (Z26)m
For a key K = (k1,k2, .., km), define
EK(x1,x2,..,xm) = (x1 + k1, x2 + k2, … xm+km)
and
DK(y1,y2,..,ym) = (y1-k1,y2-k2,…, ym-km)
where all operations are performed in Z26

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 9 / 32
1.3. Vigenere Cipher (2/2)
• Example of m and K:
m = 6, K = (2,8,15,7,4,17)
• Example of Encryption:
Plaintext : thiscryptosystemisnotsecure
Ciphertext: VPXZGIAXIVWPUBTTMJPWIZITWZT
• Example of Decryption:
Ciphertext: VPXZGIAXIVWPUBTTMJPWIZITWZT
Plaintext : thiscryptosystemisnotsecure

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 10 / 32
1.4. Hill Cipher (1/2)
• Figure 1.6:
Let m be some fixed positive integer.
Let P = C = (Z26)m
and K = (mxm invertible matrices over Z26)
For a key K Є K, define
EK(x1,x2,..,xm) = xK
and
DK(y) = yK-1
where all operations are performed in Z26
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 11 / 32
1.4. Hill Cipher (2/2)
• Example of m and K:
m = 3,
K = ((17,17,5),(21,18,21),(2,2,19))
(K-1 = ((4,9,15),(15,17,6),(24,0,17))
• Example of Encryption:
Plaintext : thiscryptosystemisnotsecure
Ciphertext: SXESMNHOQOMULGTSUYHRSESEDEN
• Example of Decryption:
Ciphertext: SXESMNHOQOMULGTSUYHRSESEDEN
Plaintext : thiscryptosystemisnotsecure
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 12 / 32
1.5. Permutation Cipher (1/2)
• Figure 1.7:
Let m be some fixed positive integer.
Let P = C = (Z26)m
and K = {permutation of {1,2,…,m}}
For a key π Є K, define
EK(x1,x2,..,xm) = (xπ(1), xπ(2),…, xπ(m))
and
DK(y1,y2,..,ym) = (xπ-1(1), xπ-1(2),…, xπ-1(m))
where π-1 is inverse permutation to π
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 13 / 32
1.5. Permutation Cipher (2/2)
• Example of m and K:
1     2    3     4     5    6
m = 6, K =     3     5    1     6     4    2
• Example of Encryption:
Plaintext : shesellsseashellsbytheseashore
Ciphertext: EESLSHSALSESLSHBLEHSYEETHRAEOS
• Example of Decryption:
Ciphertext: EESLSHSALSESLSHBLEHSYEETHRAEOS
Plaintext : shesellsseashellsbytheseashore

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 14 / 32
2.1. Extended Euclidean Algorithm (1/2)
• Figure 4.1: find b-1 mod n
1. n0 = n, b0 = b, t0 = 0, t = 1,
q = n0\b0, r = n0 – q * b0
2. While r > 0
temp = (t0 – q * t) mod n
t0 = t, t = temp, n0 = b0, b0 = r
q = n0\b0, r = n0 – q * b0
3. If b0<>1 then b has no inverse modulo n
Else b-1 = t mod n
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 15 / 32
2.1. Extended Euclidean Algorithm (2/2)
• Example: find 550-1 mod 1769
Step         n0          b0           r             q    t0         t
1         1769         550         119             3    0          1
2          550         119          74             4    1         -3
3          119          74          45             1    -3        13
4           74          45          29             1   13         -16
5           45          29          16             1   16         29
6           29          16          13             1   29         -45
7           16          13          3              1   -45        74
8           13          3           1              4   74        -119
9           3           1           0              3   -119      550

Dr. Nguyen Nam Hong, Le Quy Don Technical University              Slide 16 / 32
2.2. Chinese Remainder Theory (1/2)
• Theory 4.3
find x = ai mod mi (1 <= i <= r)
x = Sumi(ai*Mi*yi) mod M
where
M = Multi(mi)
Mi = M \ mi
yi = invert(Mi) mod mi

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 17 / 32
2.2. Chinese Remainder Theory (2/2)
• Example:
x = 5 mod 7
x = 3 mod 11
x = 10 mod 13
i           m(i)          M(i)          y(i)     a(i)     Mult
1             7            143            5        5      3575
2             11            91            4        3      1092
3             13            77            12      10      9240

• Sum = 13907
• X = 894 mod 1001
Dr. Nguyen Nam Hong, Le Quy Don Technical University          Slide 18 / 32
2.3. RSA CryptoSystem (1/2)
• Figure 4.2:
Let n = p*q where p,q are primes
Let P = C = Zn and
K = {(n,p,q,a,b): n = pq, ab = 1 mod (n)}
For a key K = (n,p,q,a,b) and x,y Є Zn, define
EK(x) = xb mod n (Encryption)
and
DK(y) = ya mod n (Decryption)
The values n and b are public, and
values p, q, a are secret

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 19 / 32
2.3. RSA CryptoSystem (2/2)
• Example:
p = 101, q = 113 → n = 11413 and (n) = 11200
Choose b = 3533 → b-1 = 6597 mod 1120
• Public n = 11413 and b = 3533
• Encryption
Plaintext = 9726
→ Ciphertext =97263533 mod 11413 = 5761
• Decryption
Ciphertext = 5761
→ Plaintext =57616597 mod 11413 = 9726
Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 20 / 32
2.5. Rabin CryptoSystem (1/2)
• Figure 4.2:
Let n = p*q where p,q are primes = 3 mod 4
Let P = C = Zn and
K = {(n, p, q, B): 0 <= B <= n - 1}
For a key K = (n, p, q, B) and x,y Є Zn, define
EK(x) = x(x + B) mod n (Encryption)
and
DK(y) = ((B2/4 + y)^0.5 – B/2) mod n (Decryption)
The values n and B are public, and
values p, q are secret
• Decryption gives four posible plaintexts

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 21 / 32
2.5. Rabin CryptoSystem (2/2)
• Example:
p = 7, q = 11 → n = 77
Choose B = 9 → b-1 = 6597 mod 1120
• Public n = 77 and B = 9
• Encryption
Plaintext = 24
→ Ciphertext =24*(24+9) mod 77 = 22
• Decryption
Ciphertext = 22
→ Plaintext = ((1+22)^0.5 – 43) mod 77 =
(44 or 24 or 66 or 2)

Dr. Nguyen Nam Hong, Le Quy Don Technical University   Slide 22 / 32

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 25 posted: 7/21/2012 language: English pages: 22
How are you planning on using Docstoc?