Chapter 3 - Cryptography Part 2
Chapter 3 - Cryptography Part 2
Chapter 3 – Cryptography
Part 2
Outline
3.1 Introduction
3.2 Terminology
3.2.1 Plain text, cipher text
3.2.2 Encryption, decryption
3.2.3 Key
3.2.3 Symmetric and Asymmetric Cryptosystem
3.2.4 Cryptanalysis & Brute Force Attack
3.4 Cipher Types
3.5 Classical Cryptography
3.5 Symmetric Encryption
3.6 Asymmetric Encryption
3.7 Public Key Cryptosystem (RSA, Key Exchange, Diffie-Hellman)
3.8 Others - Message Authentication, Hash Function, Digital Signature
© Rocheston 2023
© Rocheston 2023
Asymmetric Encryption
Encryption
Alice’s Public
Algorithm Alice transmits the 4 Key
encrypted message Encrypted
2 to Bob Text
Encrypted
Computer Text
3 Computer
Encryption
Algorithm
A B
Alice’s Public Can I get your Public Key please?
Key Here is my Public Key
Encryption
Alice’s Public
Algorithm Alice transmits the 3 Key
encrypted message Encrypted
2 to Bob Text
Encrypted
Computer Text
4 Computer
Encryption
Algorithm
A B
Alice’s Public
Key
Bob can read the message using Alice’s public key
thus, it shows only Alice’s private key was used to
encrypt the message that only Alice knows. By this,
it means Alice cannot deny later that she is the one
who sent the message because no other people
hold Alice’s private key except herself.
Public Key Cryptosystem
© Rocheston 2023
© Rocheston 2023
Public Key Cryptosystem
Public Key Cryptosystem
The essential steps are the following:
1. Each user generates a pair of keys to be used for the encryption and decryption
of messages.
2. Each user places one of the two keys in a public register or other accessible file.
This is the public key. The companion key is kept private. As suggested, each user
maintains a collection of public keys obtained from others.
3. If Bob wishes to send a confidential message to Alice, Bob encrypts the message
using Alice’s public key.
4. When Alice receives the message, she decrypts it using her private key. No
other recipient can decrypt the message because only Alice knows Alice’s
private key.
5. With this approach, all participants have access to public keys, and private
keys are generated locally by each participant and therefore need never be
distributed. As long as a user’s private key remains protected and secret, incoming
communication is secure. At any time, a system can change its private key and
publish the companion public key to replace its old public key.
RSA Algorithm
© Rocheston 2023
© Rocheston 2023
RSA Algorithm
Private Key
computationally easy to
create key pairs
computationally easy
useful if either key can for sender knowing
be used for each role public key to encrypt
messages
computationally
computationally easy
infeasible for
for receiver knowing
opponent to
private key to decrypt
otherwise recover
ciphertext
original message
computationally
infeasible for opponent
to determine private
key from public key
Asymmetric Encryption Algorithms
Let q = 11, α = 7.
Diffie-Hellman Algorithm
Let q = 11, α =7
1 23, 5 1 23, 5
3
2 6 56mod 23 = 8 8
1. Alice and Bob agree to use the same two numbers. For example, the base number g=5 and
prime number p=23
2. Alice now chooses a secret number x=6.
3. Alice performs the DH algorithm: gx modulo p = (56 modulo 23) = 8 (Y) and sends the
new number 8 (Y) to Bob.
Example 2: Diffie-Hellman
Alice Bob
Shared Secret Calc Shared Secret Calc
5, 23 5, 23
6 56mod 23 = 8 8 15 4
19 515mod 23 = 19
5 196mod 23 = 2 6 815mod 23 = 2
4. Meanwhile Bob has also chosen a secret number x=15, performed the DH algorithm: gx
modulo p = (515 modulo 23) = 19 (Y) and sent the new number 19 (Y) to Alice.
protects against
active attacks
• contents have not been
verifies received altered
message is • from an authentic source
• timely and in a correct
authentic sequence
can use
• only the sender & receiver
conventional share a key
encryption
Achieved integrity Message Authentication Codes
Secure Hash
Function
© Rocheston 2023
Security of Hash Function
Signature Confirm
Order 4
Key
____________
Encrypted 0a77b3440…
hash Signature Signature is
2
Algorithm verified with the
The sending device 3 verification
encrypts only the hash key
0a77b3440…
with the private key
of the signer 5
The signature algorithm Verification
generates a digital signature Key
and obtains the public key
Achieved integrity and
authenticated sender at
the same time
Summary
● Symmetric encryption
○ conventional or single-key only
type used prior to public-key
❖ Terminology – plaintext, cipher text,
○ five parts: plaintext, encryption
encryption, decryption, key,
algorithm, secret key, ciphertext,
cryptography, cryptanalysis,
and decryption algorithm
cryptology.
○ two attacks: cryptanalysis and
brute force ❖ Classical cryptography – substitution
and transposition cipher.
○ most used algorithms are block
ciphers (DES, triple DES, AES) ❖ RSA