Unit 4
Unit 4
Unit 4
Name: K.SUDHA
Designation: Lecturer
Department: Electrical and Electronics Engineering
• Objective:
– Confidentiality
– Integrity
– Non-repudiation Authentication
Cryptography
Cryptography
RSA Algorithm
• Generate two large random primes
• p and q, of approximately equal size such that their product n = pq is of the
required bit length
• e.g. 1024 bits.
• Compute n = pq and (φ) phi = (p-1)(q-1).
• Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1.
• Compute the secret exponent d, 1 < d < phi, such that ed ≡ 1 (mod phi)
• The public key is (n, e) and the private key is (n, d).
• n is known as the modulus.
• e is known as the public exponent
• d is known as the secret exponent
Summary of RSA
Encipherment:
L[0]R[0] = IP(plain block)
for 1 <= i <= 16 L[i] = R[i-1]
R[i] = L[i-1]xor f(R[i-1], K[i])
cipher block = FP(R[16]L[16])
Decipherment:
• R[16]L[16] = IP(cipher block)
• for 1 <= i <= 16
• R[i-1] = L[i]
• L[i-1] = R[i] xor f(L[i], K[i])
• plain block = FP(L[0]R[0])
Generating keys
• Key generation requires a good source of random
bits
– Bad key material makes system vulnerable to attacks.
Has been done in practice.
– Hardware generators provide the best source.
– For end-user applications - some user interaction can
be used (mouse movement, key strokes, etc.)
– Using system time for high security requirements is a
bad idea!
• For high-security applications, key generation
should take place in a closed environment.
Individual
key
Session key
Key
generation
ZMK Component 1
ZMK Component 2
ZMK Component 3
Configuration
system Host system
Components
Generation of Zone Master Key
reassembled as the
Zone Master Key sent as components host to give the
to host by security officers same key
System A System B
Key length
Example 1:
Suppose we want to allow inbound mail
(SMTP, port 25) but only to our gateway
machine. Also suppose that mail from some
particular site SPIGOT is to be blocked.
Solution 1:
Example 2:
Now suppose that we want to implement the
policy “any inside host can send mail to the
outside”.
Solution 2:
So why is it wrong?
• Our defined restriction is based solely on the
outside host’s port number, which we have no
way of controlling.
• Now an enemy can access any internal
machines and port by originating his call from
port 25 on the outside machine.
FTP
Telnet proxy SMTP
proxy proxy