0% found this document useful (0 votes)
6 views20 pages

Lecture 6 - Asymmetric Cryptography

Asymmetric cryptography, or public-key cryptography, utilizes a pair of keys (public and private) to secure communications, addressing key distribution challenges. It was introduced by Whitfield Diffie and Martin Hellman in 1976 and has since become foundational for internet security protocols. Key algorithms include RSA, Elliptic Curve Cryptography (ECC), and the Diffie-Hellman key exchange, each with unique features and applications in secure communication, email security, and digital signatures.

Uploaded by

OSELU NYALIK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views20 pages

Lecture 6 - Asymmetric Cryptography

Asymmetric cryptography, or public-key cryptography, utilizes a pair of keys (public and private) to secure communications, addressing key distribution challenges. It was introduced by Whitfield Diffie and Martin Hellman in 1976 and has since become foundational for internet security protocols. Key algorithms include RSA, Elliptic Curve Cryptography (ECC), and the Diffie-Hellman key exchange, each with unique features and applications in secure communication, email security, and digital signatures.

Uploaded by

OSELU NYALIK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Murang’a University of Technology

Innovation for Prosperity


Lecture 6

Asymmetric Cryptography
Preview
• Asymmetric cryptography, also known as public-key
cryptography, is a type of encryption that uses a pair of
keys: a public key and a private key.
• Asymmetric cryptography revolutionized the field of
cryptography by solving one of the biggest challenges in
secure communication: key distribution.
• It is widely used for securing communication in untrusted
networks, digital signatures, and key exchange
mechanisms.

3
History of Asymmetric Cryptography
• Whitfield Diffie and Martin Hellman published their groundbreaking
paper, "New Directions in Cryptography", introducing the concept of
public-key cryptography in 1976.
• They proposed the Diffie-Hellman key exchange, which allowed two
parties to securely exchange keys over an insecure channel.
• The first practical implementation was the RSA algorithm, developed in
1977 by Ron Rivest, Adi Shamir, and Leonard Adleman.
• Neal Koblitz and Victor Miller independently proposed using elliptic curves
(ECC) for cryptography, which provided the same security as RSA but with
much smaller key sizes.
• Asymmetric cryptography gained widespread adoption and became the
backbone of internet security protocols like SSL/TLS, PGP, and SSH.

4
Intro to Asymmetric Cryptography
• Unlike symmetric cryptography, which uses a single key
for both encryption and decryption, asymmetric
cryptography uses two distinct keys:
• Public Key: Shared openly and used for encryption.
• Private Key: Kept secret and used for decryption.
• The two keys are mathematically linked, but it is
computationally infeasible to derive the private key
from the public key.

5
Asymmetric Cryptography

6
Key Features
• Key Pair: Each user has a unique public-private key
pair.
• One-Way Functions: Easy to compute in one
direction (encryption) but hard to reverse without
the private key (decryption).
• Security: Relies on hard mathematical problems
like integer factorization, discrete logarithms,
or elliptic curve discrete logarithms.

7
Asymmetric Cryptography
• Key Generation: Each user generates a pair of keys for encrypting
and decrypting messages. One of the keys is made public, while the
other key remains private.
i. Encryption: The sender encrypts the message using the public key
of receiver. This transforms the message into an unreadable
format (ciphertext). When Alice wants to send a confidential
message to Bob, Alice encrypts it using Bob’s public key.
ii. Decryption: The recipient uses their private key to decrypt the
ciphertext back to the original message (plaintext). Upon receiving
the message, Bob decrypts it using his private key. Only Bob can
decrypt the message because only he has his private key.

8
Asymmetric Cryptography
• In this setup, all participants possess public keys, while private
keys are locally generated and never distributed.
• As long as a user's private key remains secure and
undisclosed, incoming communications are safe.
• We will cover 3 types of Asymmetric algorithms;
i. RSA (Rivest-Shamir-Adleman)
ii. Elliptic Curve Cryptography (ECC)
iii. Diffie-Hellman Key Exchange

9
RSA (Rivest-Shamir-Adleman)

• The RSA algorithm is a widely used public-key cryptosystem that


provides both encryption and digital signatures. Named after its
inventors Ron Rivest, Adi Shamir, and Leonard Adleman.
• The RSA algorithm was almost not discovered in the US! Rivest,
Shamir, and Adleman were at MIT when they came up with the
idea. However, at the time, there were restrictions on
cryptographic research due to national security concerns.
• RSA’s security is based on the difficulty of factoring large
numbers. Even though 𝑛 is public, finding 𝑝 and 𝑞 from 𝑛
(factorization) is computationally hard, especially for very large
numbers.

10
How RSA Works

11
How RSA Works

12
How RSA Works

• Tutorials on RSA
1. RSA: https://www.youtube.com/watch?v=-
0slxSL9B6A&pp=ygUNcnNhIGFsZ29yaXRobQ%3D%3D
2. RSA: https://youtu.be/LYmb8Adr6Wc?si=R_F6hDm-eb_rJP-i
3. SCS412:https://youtube.com/playlist?list=PLBlnK6fEyqRgJU3EsOYD
TW7m6SUmW6kII&si=V45xOXxWOrH1KbNh

13
Elliptic Curve Cryptography (ECC)
• Elliptic Curve Cryptography (ECC) is a type of asymmetric
cryptography based on the algebraic structure of elliptic curves
over finite fields.
• It provides the same level of security as traditional methods like
RSA but with much smaller key sizes, making it efficient and
ideal for resource-constrained environments like mobile devices
and IoT.
• For example: A 256-bit ECC key is as secure as a 3072-bit RSA
key.
• ECC is used in schemes like the Elliptic Curve Digital Signature
Algorithm (ECDSA) for authenticating messages.

14
Elliptic Curve Cryptography (ECC)
Key Generation
• Select an elliptic curve over a finite field.
• Choose a base point on the curve and a large prime order.
• Select a private key, which is a random integer k.
• Now, Using the elliptic curve scalar multiplication, you need to
find the public key by multiplying the base point by the private
key.
Encryption and Decryption
• ECC is primarily used for key exchange, such as in the Elliptic
Curve Diffie-Hellman (ECDH) algorithm, rather than directly for
encryption/decryption.

15
Diffie-Hellman Key Exchange
• The Diffie-Hellman key exchange doesn't directly encrypt data
but establishes a shared secret key for secure communication.
Two parties can generate a common secret key without ever
exchanging it directly.
• The protocol relies on the Discrete Logarithm Problem, which is
computationally infeasible to solve for large numbers. While 𝑝,
𝑔, 𝐴, and 𝐵 are publicly known, discovering the private keys (𝑎
or 𝑏) from the public keys requires immense computational
effort.
• In essence, Diffie-Hellman allows two strangers to whisper
secrets in a crowded room without anyone else understanding
them!

16
Diffie-Hellman Key Exchange

17
Applications of Asymmetric Cryptography

1. Secure Communication:
– HTTPS uses asymmetric cryptography for establishing secure
connections.
2. Email Security:
– PGP (Pretty Good Privacy) and S/MIME (Secure/Multipurpose
Internet Mail Extensions).
3. Digital Signatures:
– Used in software distribution and electronic documents to verify
authenticity.
4. Blockchain:
– Cryptographic algorithms like ECDSA (Elliptic Curve Digital
Signature Algorithm) are used for transactions.
18
Public-Key Cryptanalysis
a. Brute-Force Attacks: Public-key encryption is vulnerable to brute-
force attacks just like symmetric encryption. The solution is similar:
using large keys. The larger the key, the more difficult it is to guess
correctly.
b. Probable-Message Attacks Suppose a message consists solely of a
56-bit DES key, an adversary could encrypt all possible 56-bit DES
keys using the public key and deduce the encrypted key by
matching ciphertext. Consequently, regardless of the public-key
scheme's key size, the attack reduces to a brute-force assault on a
56-bit key. This attack can be countered by appending random bits
to simple messages.

19
Class Activity
1. Given: p=5, q=11, and e=3.
– Calculate n and z.
– Verify that e and z are coprime.
– Compute the private key d.
– Write down the public and private keys.
2. Given 𝑝=11, 𝑞=13, and 𝑒=7:
– Compute the public key and the private key.
3. Using the public key (e,n)=(3,55), encrypt the message M=10.
4. Using the private key (d,n)=(27,55), decrypt the ciphertext C=35.
5. Using the RSA keys 𝑒=7, 𝑛=33 and the private key 𝑑=3:
– Encrypt the message 𝑚=4.
– Decrypt the ciphertext.

20

You might also like