ISA 662 Internet Security Protocols: Demonstration
ISA 662 Internet Security Protocols: Demonstration
ISA 662
Internet Security Protocols
Lecture 2
ISA 662
Beauty of Mathematics
Demonstration
Pick a number from 10 to 99
At the 2 digits, for example:
If you chose 51, you would add 5+1=6
Then subtract the result from the original number
So 51-6=45
(Demonstration shown in class)
x/(ln x - 1)
Percentage
168
16.8%
169
16.9%
10,000
1,229
12.3%
1,218
12.2%
100,000
9,592
9.6%
9,512
9.5%
1,000,000
78,498
7.8%
78,030
7.8%
10,000,000
664,579
6.6%
661,459
6.6%
5.7%
100,000,000
5,761,455
5.8%
5,740,304
1,000,000,000
50,847,534
5.1%
50,701,542
5.1%
10,000,000,000
455,052,511
4.6%
454,011,971
4.5%
Division (I)
Percentage
1,000
Division (II)
Division (III)
in Z
10
Examples:
Insecure
(21)= 21*(1-(1/3)*(1-(1/7))=12
{1,2,4,5,8,10,11,13,16,17,19,20}
Or (21)= (3.7)= (3). (7)= 2.6 = 12
12
Total
Keys
Keys
Stored
10
15
21
28
36
10
45
11
55
10
12
66
11
13
78
12
14
91
13
15
105
14
Non-repudiation
I didnt sign it. You did since you also have the key
14
It is computationally easy to
It is computationally infeasible to
determine the private key from the public key.
recover the message from the ciphertext and the public key.
forge a signature.
15
Plaintext
Encryption
Algorithm
16
Ciphertext
INSECURE CHANNEL
Decryption
Algorithm
A
A
Plaintext
B
B
B's Public Key
IAB
LE
C
Encryption
Algorithm
Ciphertext
Decryption
Algorithm
Plaintext
Signature
HA
NN
EL
17
A
A
B
B
18
19
20
Digital signature
The sender signs a message with its private key.
Authentication and non-repudiation
Key exchange
Two sides cooperate to exchange a session key.
Secret key cryptosystems are often used with the session key.
21
22
Public-Key Cryptanalysis
Brute-force attack
Try all possible keys
Probable-message attack
The public key is known.
Encrypt all possible messages
Try to find a match between the ciphertext and one of the above
encrypted messages.
Example: Prof. sends encrypted messages of letter grades to his
students based on their public key.
23
24
Revolution in Cryptography
25
26
Published in
W. Diffie and ME Hellman, "New Directions in Cryptography",
in IEEE Transactions on Information Theory, IT-22 no 6
(November 1976) p. 644-654
27
28
Diffie-Hellman Man-in-the-middle
29
30
Diffie-Hellman Example
T = gs mod p
31
32
Diffie-Hellman Scheme
Security factors
Disadvantages:
Expensive exponential operation
Cannot be used to encrypt anything.
No authentication, so you can not sign anything.
33
34
Number Factoring
Published in
R. Rivest, A. Shamir, and L. Adleman, "A Method for Obtaining
Digital Signatures and Public-Key Cryptosystems", CACM 21,
pp. 120--126, Feb. 1978
The first public key encryption and signature system
36
Quantum Computing
A classical computer has a memory made up of bits, where each bit holds either
a one or a zero. The device computes by manipulating those bits, i.e. by
transporting these bits from memory to (possibly a suite of) logic gates and
back. A quantum computer maintains a set of qubits.
Qubits for a quantum computer can be implemented using particles with two
spin states: "up" and "down"; in fact any system, possessing an observable
quantity A which is conserved under time evolution and such that A has at least
two discrete and sufficiently spaced consecutive eigenvalues, is a suitable
candidate for implementing a qubit.
37
38
An Example
39
40
Example: Encryption
Example: Decryption
p = 7, q = 11, n = 77
Alice chooses e = 17, making d = 53
Bob wants to send Alice secret message HELLO
(07 04 11 11 14)
Alice receives 28 16 44 44 42
Alice uses private key, d = 53, to decrypt
message:
0717
mod 77 = 28
0417 mod 77 = 16
1117 mod 77 = 44
1117 mod 77 = 44
1417 mod 77 = 42
2853 mod 77 = 07
1653 mod 77 = 04
4453 mod 77 = 11
4453 mod 77 = 11
4253 mod 77 = 14
Bob sends 28 16 44 44 42
41
42
Plaintext
M
Plaintext
M
e
C mod n
M mod n
Ciphertext C
(signature)
A
A
Plaintext
M
B
B
RELIABLE CHANNEL
43
Plaintext
M
M e mod n
Ciphertext C
44
C d mod n
A
A
A
A
Plaintext
D
B
B
B's Public Key e
B
B
Encrypted
Signed
Plaintext
Signed
Plaintext
Signed
Plaintext
Plaintext
B's Public
Key
B's Private
Key
A's Public
Key
RELIABLE CHANNEL
45
46
Example: Sign
Example: Verify
Take p = 7, q = 11, n = 77
Alice chooses e = 17, making d = 53
Alice wants to send Bob message HELLO (07 04
11 11 14) so Bob knows it is from Alice, and it
has not been modified in transit
Bob receives 35 09 44 44 49
Bob uses Alices public key, e = 17, n = 77, to decrypt
message:
0753 mod 77 = 35
0453 mod 77 = 09
1153 mod 77 = 44
1153 mod 77 = 44
1453 mod 77 = 49
3517 mod 77 = 07
0917 mod 77 = 04
4417 mod 77 = 11
4417 mod 77 = 11
4917 mod 77 = 14
Alice sends 35 09 44 44 49
47
(Assume) only Alice has her private key, so no one else could
have been able to create a correct signature
The (deciphered) signature matches the transmitted plaintext, so
the plaintext is not altered
48
Example: Both
Class Exercise
Alice sends 07 37 44 44 14
What would Bob do upon receiving the message?
49
50
Class Exercise
N=p*q
N=7*3=21
M=C^d mod n
M=4^7 mod 21
M=4
51
52
RSA-155 Number
10263959282974110577205419657399759007165678080380668
334193352190711307779
*
1066034883801684548209272203600187867920795857598929
22270608237193062808643.
=
10941738641570527421809707322040357612003732945449
20599091384213147634998428893478471799725789126733
24976257528997818337970765372440271467435315933543
33897
Good news
Infinite number of prime numbers
Bad news
The prime number ratio decreases as the prime number gets
big
Brute-force
Try to divide n by 2,,n1/2
Impractical for large number!!!
No known practical method to determine if a given large
number is prime
However fast probabilistic primality test exists.
That is, determine if a larger number is likely to be a prime.
53
54
Primality test
Mathematical attacks
Factor n into n=p*q.
Determine (n) directly: equivalent to factoring n.
Determine d directly: at least as difficult as factoring n.
Exist n>0 such that an-1 mod n=1 for all 0<a<n
Implication
We may (with small probability) choose some nonprime numbers for p & q, which would fail RSA
operations (encryption/decryption,
signature/verification)
55
56
57
58
By NIST
Related to El Gamal
Use SHA (SHA-1) to generate the hash value and
Digital Signature Algorithm (DSA) to generate
the digital signature.
Faster for the signer, but not for the verifier:
Potential application: smart cards
59
60
10
62
63
64
263
vs
Plaintext + MAC
280 (theoretically)
Plaintext
Yes/No
MAC
Algorithm M
Verification
Algorithm V
A
A
B
B
K
MAC = MD of plaintext + K
Xiaoyun Wangs webpage: http://www.infosec.sdu.edu.cn/people/wangxiaoyun.htm
65
66
11
HMAC
h : hash function
K : a secret key k padded with extra 0s to the block size of
the hash function
opad=0x5c5c..5c5c (outer padding )and
ipad=0x3636..3636 (inner padding) are two one-block
long hexadecimal constants.
exclusive or, || concatenation
68
Key Points
69
70
12