COMPUTER SECURITY
Ch.6: Other Public-Key
Cryptosystems
Dr. Zeyad Al-Odat
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 1
OVERVIEW
❖ Diffie–Hellman Key Exchange
❖ El-Gamal Cryptographic System
❖ Elliptic Curve Arithmetic
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 2
DIFFIE–HELLMAN KEY EXCHANGE
❑ The first published public-key algorithm appeared in the seminal paper by Diffie and Hellman that defined
public-key cryptography [DIFF76b] and is generally referred to as Diffie–Hellman key exchange.
❑ The purpose of the algorithm is to enable two users to securely exchange a key that can then be used for
subsequent symmetric encryption of messages. The algorithm itself is limited to the exchange of secret
values.
❑ The Diffie–Hellman algorithm depends for its effectiveness on the difficulty of computing discrete
logarithms.
❑ The exponent i is referred to as the discrete logarithm of b for the base a, mod p. We express this value as
dloga,p(b).
❑ a primitive root of a prime number p is one whose powers modulo p generate all the integers from 1 to p - 1.
That is, if a is a primitive root of the prime number p, then the numbers
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 3
DIFFIE
HELLMAN...
THE ALGORITHM
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 4
DIFFIE–HELLMAN KEY EXCHANGE EXAMPLE
❑ In this simple example, it would be possible by brute force to determine the secret key 160. an attacker E
can determine the common key by discovering a solution to the equation 3a mod 353 = 40 or the equation
3b mod 353 = 248. The brute-force approach is to calculate powers of 3 modulo 353, stopping when the
result equals either 40 or 248. The desired answer is reached with the exponent value of 97, which provides
397 mod 353 = 40.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 5
MAN-IN-THE-
MIDDLE ATTACK
➢ Alice sends an encrypted message M: E(K2, M).
➢ Darth intercepts the encrypted message and
decrypts it to recover M.
➢ Darth sends Bob E(K1, M) or E(K1, M=), where M=
is any message. In the first case, Darth simply
wants to eavesdrop on the communication without
altering it. In the second case, Darth wants to
modify the message going to Bob.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 6
ELGAMAL CRYPTOGRAPHIC SYSTEM
❑ In 1984, T. El-Gamal announced a public-key scheme based on discrete logarithms, closely related to the
Diffie–Hellman technique
❑ The El-Gamal cryptosystem is used in some form in several standards including the digital signature
standard (DSS)
❑ As with Diffie–Hellman, the global elements of El-Gamal are a prime number q and α , which is a primitive
root of q.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 7
ELGAMAL CRYPTOGRAPHIC SYSTEM… STEPS
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 8
ELGAMAL
CRYPTOGRAPHIC
SYSTEM
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 9
ELGAMAL CRYPTOGRAPHIC SYSTEM… EXAMPLE
1. Alice chooses XA = 5.
2. Then 𝑌𝐴 = 𝛼 𝑋𝐴 mod q = 𝛼 5 mod 19 = 3.
3. Alice’s private key is 5 and Alice’s public key is {q, a, YA} = {19, 10, 3}.
Suppose Bob wants to send the message with the value M = 17. Then:
1. Bob chooses k = 6.
2. Then K = (YA)k mod q = 36 mod 19 = 729 mod 19 = 7.
3. So
𝐶1 = 𝛼 𝑘 mod 𝑞 = 𝛼 6 mod 19 = 11
C2 = KM mod q = 7 * 17 mod 19 = 119 mod 19 = 5
4. Bob sends the ciphertext (11, 5).
For decryption:
1. Alice calculates K = (C1)XA mod q = 115 mod 19 = 161051 mod 19 = 7.
2. Then K-1in GF(19) is 7-1 mod 19 = 11.
3. Finally, M = (C2K-1) mod q = 5 * 11 mod 19 = 55 mod 19 = 17.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 10
CIPHER BLOCK MODES OF OPERATION
❑ A symmetric block cipher processes one block of data at a time. In the case of DES and 3DES, the block
length is 64 bits. For longer amounts of plaintext, it is necessary to break the plaintext into 64-bit blocks
(padding the last block if necessary).
❑ To apply a block cipher in a variety of applications, five modes of operation have been defined by NIST
SP 800-38A (Recommendation for Block Cipher Modes of Operation: Methods and Techniques,
December 2001).
❑ The five modes are intended to cover virtually all the possible applications of encryption for which a
block cipher could be used.
❑ These modes are intended for use with any symmetric block cipher, including triple DES and AES.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 11
CIPHER BLOCK MODES OF OPERATION
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 12
ELECTRONIC CODEBOOK MODE
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 13
CIPHER BLOCK CHAINING MODE
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 14
CIPHER
FEEDBACK MODE
(CFB)
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 15
COUNTER
MODE
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 16
KEY DISTRIBUTION
❑ For two parties A and B:
➢ A key could be selected by A and physically delivered to B.
➢ A third party could select the key and physically deliver it to A and B.
➢ If A and B have previously and recently used a key, one party could transmit the new key to the
other, encrypted using the old key.
➢ If A and B each have an encrypted connection to a third-party C, C could deliver a key on the
encrypted links to A and B, and comprises two keys:
1. Session key: When two end systems (hosts, terminals, etc.) wish to communicate, they
establish a logical connection (e.g., virtual circuit). For the duration of that logical connection,
all user data are encrypted with a one-time session key. At the conclusion of the session, or
connection, the session key is destroyed.
2. Permanent key: A permanent key is a key used between entities for the purpose of
distributing session keys.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 17
KEY DISTRIBUTION CONFIGURATION FOR CONNECTION-ORIENTED PROTOCOL
➢ Key distribution center: The key distribution center (KDC) determines which systems are allowed to
communicate with each other. When permission is granted for two systems to establish a connection, the
KDC provides a onetime session key for that connection.
➢ Security service module (SSM): This module, which may consist of functionality at one protocol layer,
performs end-to-end encryption and obtains session keys on behalf of users.
❑ When one host wishes to set up a connection to another host,
➢ it transmits a connection request packet (step 1).
➢ The SSM saves that packet and applies to the KDC for permission to establish the connection (step 2).
➢ The communication between the SSM and the KDC is encrypted using a master key shared only by this
SSM and the KDC. If the KDC approves the connection request, it generates the session key and delivers
it to the two appropriate SSMs, using a unique permanent key for each SSM (step 3).
➢ The requesting SSM can now release the connection request packet, and a connection is set up between
the two end systems (step 4).
➢ All user data exchanged between the two end systems are encrypted by their respective SSMs using the
onetime session key.
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 18
AUTOMATIC KEY DISTRIBUTION FOR CONNECTION-ORIENTED PROTOCOL
12/17/2024 DR. ZEYAD A. AL-ODAT, COMPUTER SECURITY, TAFILA TECHNICAL UNIVERSITY , DEPT. OF COMPUTER AND COMMUNICATION ENGINEERING 19