L4 PublicKeyCrypto v2
L4 PublicKeyCrypto v2
CRYPTOSYSTEM
DR. NOR FADZILAH ABDULLAH
JKEES, FKAB
Contents adopted from William Stallings “Cryptography & Network Security” 6th
Edition (Chapter 9 & 10) & other online sources
COURSE STRUCTURE
No. Topic
1 Security principles and practices
2 Classic Ciphers
3 Symmetric Ciphers
4 Asymmetric Ciphers / Public key crytosystems
5 Authentication / Integrity
6 Security across different communication layers
7 Exam
2
CRYPTOGRAPHIC SYSTEMS
• Characterized along 3 independent dimensions:
• message encrypted using A’s private key, only A could prepare message i.e. the entire
encrypted message serves as a digital signature
• safe from alteration but not from eavesdropping (does not provide confidentiality
because any observer can decrypt the message by using the sender’s public key)
PUBLIC-KEY CRYPTOSYSTEM:
AUTHENTICATION AND SECRECY
authentication confidentiality
PUBLIC-KEY CRYPTANALYSIS
• Vulnerable to a brute-force attack
• Countermeasure: use large keys
• But, key size must be practical for encryption/decryption, else too slow for
general-purpose use
• Limited to: Public key management and signature applications
• Another form of attack is to find some way to compute the private key
given the public key
• not yet mathematically proven that this attack is infeasible for a particular
public-key algorithm
• Vulnerable to a probable-message attack
• adversary could encrypt all possible keys (e.g. 56-bit DES) using the public
key and discover the encrypted key by matching the transmitted ciphertext
• Countermeasure: append random bits to simple messages
RIVEST-SHAMIR-ADLEMAN (RSA)
SCHEME
• Developed in 1977 at MIT by Ron Rivest, Adi Shamir & Len Adleman
• Most widely used general-purpose approach to public-key encryption
• plaintext and ciphertext are integers between 0 and n – 1 for some n
• A typical size for n is 1024 bits, or 309 decimal digits
• RSA is similar to using a symmetric algorithm in ECB mode
• Problem: the same input block gives the same output block
• Solution: some form of chaining is needed for data encryption.
• However, RSA is too slow for encrypting large volumes of data, thus is
widely used for key distribution
• In practice, most RSA-based systems use public-key cryptography for
distributing one-time session keys for use with some symmetric-key algorithm
such as AES or triple DES
RSA ALGORITHM
• Decryption:
20
RSA: EXAMPLE 2
Five
possible
approaches
to attacking
Hardware fault-based RSA are:
attack
Timing attacks
• This involves inducing
hardware faults in the • These depend on the
processor that is running time of the
generating digital decryption algorithm
signatures
ASSIGNMENT: RSA
(10 MARKS)
25
OTHER PUBLIC KEY ALGORITHMS
• Knapsack (Merkle and Hellman, 1978)
• El Gamal (1985)
• Schnorr (1991)
• Elliptic curves (Menezes and Vanstone, 1993)
KEY EXCHANGE PROTOCOLS
27
DIFFIE-HELLMAN KEY EXCHANGE
• q=11 q-1=10
α𝒊𝒊 1 2 3 4 5 6 7 8 9 10
1 1 1 1 1 1 1 1 1 1 1
2 2 4 8 5 10 9 7 3 6 1
3 3 9 5 4 … … … … … …
• α=2 because 2i ={1,2,3,…,10}
• User A: Select XA=8 (PR) 𝑌𝑌𝐴𝐴 = 28 mod 11 = 3 (PU)
• User B: Select XB=4 (PR) 𝑌𝑌𝐵𝐵 = 24 mod 11 =5 (PU)
• 𝐾𝐾 = 𝑌𝑌𝐵𝐵 𝑋𝑋𝐴𝐴 mod q = 58 mod 11 = 390625 mod 11 = 4
33
EL-GAMAL PUBLIC
KEY SCHEME
35
ELLIPTIC-CURVE CRYPTOLOGY (ECC)
• technique is based on the use of a mathematical construct
known as the elliptic curve
• principal attraction of ECC compared to RSA is that it
appears to offer equal security for a far smaller bit size,
thereby reducing processing overhead
• Addition operation in ECC is the counterpart of modular
multiplication in RSA
E(1,1)
40
EXAMPLE: ECC DIFFIE-HELLMAN KEY EXCHANGE
41
EXAMPLE: ECC DIFFIE-HELLMAN KEY EXCHANGE
42
EXAMPLE: ECC DIFFIE-HELLMAN KEY EXCHANGE
43
44
COMPARABLE KEY SIZES IN TERMS OF COMPUTATIONAL
EFFORT
FOR CRYPTANALYSIS (NIST SP-800-57)
If Alice and Bob do not know each other and do not have each other’s public keys to
start the communication process, it is insecure to place the public key on a Web site:
• Alice types in Bob’s URL (her browser then looks up the DNS address of Bob’s
home page and sends it a GET request).
• Unfortunately, a 3rd party (Trudy) intercepts the request and replies with a fake
home page and replacing Bob’s public key with Trudy’s public key.
• When Alice now encrypts her first message with GET, Trudy decrypts it, reads it,
re-encrypts it with Bob’s public key, and sends it to Bob, who is none the wiser that
48
Trudy is reading his incoming messages. Worse yet, Trudy could modify the
messages before re-encrypting them for Bob.
SOLUTION: USE OF CCM
(COUNTER WITH CBC-MAC)
Public keys can be exchanged securely if Bob and Alice has already share
a secret key, but Alice still needs Bob’s public key using nonce:
• Alice encrypts a nonce with the shared key and sends it to Bob
• Bob sends back a message encrypted with the shared key containing the
nonce, his own nonce, and the public key.
• Trudy cannot forge this message, and if she sends random junk, when
decrypted it will not contain Alice’s nonce.
• To complete the protocol, Alice sends back Bob’s nonce encrypted with
Bob’s public key.
49
SOLUTION: CERTIFICATE AUTHORITY
(CA)
• Example: certificate and its signed hash the Certificate can now be
put on one’s website
• Assumption: CA’s public key is well-known
• Advantage: no need for CA to be online!