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

Cys505 Lecture05 06

The document discusses various encryption techniques including symmetric encryption, asymmetric encryption, Diffie-Hellman key exchange, RSA encryption, and how RSA encryption works. It explains how a public and private key pair is generated in RSA and how encryption and decryption is performed between two parties.

Uploaded by

Abdirizak Abokar
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 views37 pages

Cys505 Lecture05 06

The document discusses various encryption techniques including symmetric encryption, asymmetric encryption, Diffie-Hellman key exchange, RSA encryption, and how RSA encryption works. It explains how a public and private key pair is generated in RSA and how encryption and decryption is performed between two parties.

Uploaded by

Abdirizak Abokar
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/ 37

CYS505 Network Security

Prepared By: Dr. Ihab ELAFF


Symmetric Encryption
Symmetric Encryption (problem)
Symmetric Encryption

One of the main problems of symmetric


key encryption is it requires a secure &
reliable channel for the shared key
exchange.
Asymmetric Encryption
Asymmetric Encryption (Problem)
Asymmetric Encryption (Problem)
Asymmetric Encryption
 Diffie-Hellman
 RSA
 Elliptic Curve Cryptography (ECC)
 Identify Based Encryption (IBE)
 Content Based Encryption (CBE)
 Attribute Based Encryption (ABE)
 The 1976 publication of “New
Directions in Cryptography,” by
Whitfield Diffie and Martin Hellman, was
epochal in cryptographic history.
 Many regard it as the beginning of
public-key cryptography.
 We will rely on the formula below being an
easy problem one direction and hard in
reverse.
 s = gn mod p
◦ Easy: given g, n, & p, solve for s
◦ Hard: given s, g, & p, solve for n
 And the property of
◦ ga*b mod p = gb*a mod p
 Alice & Bob publicly agree to a large prime
number called the modulus, or p.
 Alice & Bob publicly agree to a number called
the generator, or g, which has a primitive
root relationship with p.
 Eve is aware of the values of p or g.
 For example:
◦ p = 17
◦ g=3
 Alice selects a secret key, which we will call a.
 Alice selects a secret key (Private Key), which
we will call a.
 Bob selects a secret key (Private Key), which
we will call b.
 For our example assume:
◦ a= 54
◦ b = 24
 Eve is unaware of the values of a and b as
they are PRIVATE
 Alice combines her secret key of a with the
public information to compute her public key A.
◦ A = ga mod p
◦ A = 354 mod 17
◦ A = 15
 Bob combines his secret key of b with the public
information to compute his public key B.
◦ B = gb mod p
◦ B = 324 mod 17
◦ B = 16
 Alice shares her combined value, A, with Bob
 Bob shares his combined value, B, with Alice.
 Eve knows both Alice’s and Bob’s public keys
“A” and “B”
 Alice computes the shared secret key.
◦ s = (B mod p)a mod p (s= gb*a mod p)
◦ s = (16 mod 17)24 mod 17
◦ s=1
 Bob computes the shared secret key.
◦ s = (A mod p)b mod p  (s = ga*b mod p)
◦ s = (15 mod 17)54 mod 17
◦ s=1
 Alice & Bob have created a shared secret key,
s, unknown to Eve
 In our example s=1
 The shared secret key can now be used to
encrypt & decrypt messages by both parties.
 A public-key cryptosystem
 Proposed by Rivest, Shamir, and
Adleman in 1977 and a paper was
published in The Communications of
ACM in 1978.
 Security relies on the difficulty of
factoring large composite numbers
 Essentially the same algorithm was
discovered in 1973 by Clifford Cocks,
who works for the British intelligence
 Factorization of integers into their
prime factors is hard: n=p.q, where p
and q are distinct primes.
 Congruent (≡):
X mod Y = Z  X ≡ Z mod Y
 Bob chooses two primes p,q
 Bob compute n = pq, and (n) = (q-1)(p-1)
◦ Ex: if p = 53, q = 59 then
n = 3127, (n) = 52x58 = 3016
 Bob pick an exponent that not shared a factor
with (n) ( this is written as gcd(e, (n))=1).
◦ Ex: e = 3
 Bob solves d.e≡1 (mod (n))
k∗(n)+1 2∗3016+1
d= = = 2011
e 3
k= 1, 2, …
 d is Bob’s Private Key
 Bob send only n and e to Alice
◦ n=3127
◦ e=3
 Eve can see n and e
 Alice uses n and e to encrypt her message “m”
using the formula:
c = me mod n
where “c” is the encrypted message
◦ Ex.: With m=89 and
◦ n=3127
◦ e=3
◦ Then c = 893 mod 3127 = 1394

 Alice send the encrypted message “c” to Bob


 Bob decrypt Alice’s message using the
formula:
m = cd mod n
◦ Ex.: With c=1394 and
◦ n=3127
◦ d=2011  Private key
◦ Then m = 13942011 mod 3127 = 89

You might also like