0% found this document useful (0 votes)
14 views

CS#3 - 3

Triple DES (3DES) uses multiple encryption with DES and multiple keys, executing the core algorithm three times to provide enhanced security with a 168-bit key length. It encrypts using K1, decrypts with K2, and encrypts again with K3, with decryption applying the keys in reverse order. As an alternative, two keys can be used by setting K3 equal to K1.

Uploaded by

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

CS#3 - 3

Triple DES (3DES) uses multiple encryption with DES and multiple keys, executing the core algorithm three times to provide enhanced security with a 168-bit key length. It encrypts using K1, decrypts with K2, and encrypts again with K3, with decryption applying the keys in reverse order. As an alternative, two keys can be used by setting K3 equal to K1.

Uploaded by

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

Triple DES (3DES)

 Another alternative, which would preserve the existing investment in


software and equipment, is to use multiple encryption with DES and
multiple keys – Triple DES
 Provides enhanced security by executing the core algorithm three
times and the key length becomes 56*3 = 168-bits.
 With triple length key of three 56-bit keys K1, K2 & K3, encryption
follows an encrypt-decrypt-encrypt (EDE) sequence:
Encrypt with K1 Decrypt with K2 Encrypt with K3
C = E(K3, D(K2, E(K1, P)))
 Decryption requires that the keys be applied in reverse order:

28-Jan-21 Computer Security 1


Triple DES (3DES)…
Decrypt with K3 Encrypt with K2 Decrypt with K1
P = D(K1, E(K2, D(K3, C)))
 As an alternative, we can use only two keys, i.e., setting K3 equal to
K1 gives us a double length key K1, K2
C = E(K1, D(K2, E(K1, P))), P = D(K1, E(K2, D(K1, C)))
 There is no cryptographic significance to the use of decryption for the
second stage; its only advantage is that it allows users of 3DES to
decrypt data encrypted by users of the older single DES by setting K2
= K1
C = E(K1, D(K1, E(K1, P))) = E(K1,P)
P = D(K1, E(K1, D(K1, C))) = D(K1, C)
28-Jan-21 Computer Security 2
Advanced Encryption Standard (AES)
 Because of the drawback of triple DES (3DES), NIST issued a call for
proposals for a new AES.
 Evaluation criteria included: security, computational efficiency,
memory requirements, hardware and software suitability, and
flexibility.
 After a public competition and review, NIST selected an algorithm
named Rijndael as a new advanced encryption system.
 AES uses a block length of 128 bits and a key length that can be 128,
192, or 256 bits.
 NIST estimates that a machine that could crack 56-bit DES in one
second would take approximately 149 trillion years to crack a 128-bit
AES key.

28-Jan-21 Computer Security 3


Other Symmetric Encryption Methods (Blowfish)
 Is a symmetric block cipher.
 It uses a variable-length key ranging from 32 to 448 bits.
 This flexibility in key size allows to use it in various situations.
 It was designed in 1993 by Bruce Schneier.
 It has been analyzed extensively by the cryptography community and
has gained wide acceptance.
 It is also a non-commercial (i.e., free of charge) product, thus making
it attractive to budget-conscious organizations.

28-Jan-21 Computer Security 4


Other Symmetric Encryption Methods (RC4)
 Is the most popular symmetric stream cipher designed in 1987 by Ron
Rivest.
 The RC is an acronym for Ron’s Cipher.
 It is a variable key-size stream cipher with byte-oriented operations.
 It is used in the Secure Sockets Layer/Transport Layer Security
(SSL/TLS) standards.
 It is also used in the Wired Equivalent Privacy (WEP) protocol and
the newer WiFi Protected Access (WPA) protocol.
 There are other RC versions such as RC5 and RC6.

28-Jan-21 Computer Security 5


Asymmetric (Public-Key) Cryptography
֍ It is a form of cryptosystem in which encryption and decryption are
performed using different keys - one public key (KE) and one private
key (KD)-that form a unique pair.
C = (P)
P = (C) P=[(P)]
֍ The use of two keys has profound consequences in the areas of
confidentiality, key distribution, and authentication.
֍ Proposed by Diffie and Hellman in 1976.
֍ It is based on mathematical functions rather than on simple
operations on bit patterns.
֍ It is a revolutionary concept since it avoids the need of using a secure
channel to communicate the key.
28-Jan-21 Computer Security 6
Asymmetric (Public-Key) Cryptography…
֍ It has made cryptography available for the general public and made
many of today’s online applications feasible.
Common Misconceptions Concerning Public-key Encryption
1. Public-key encryption is more secure from cryptanalysis than is
conventional encryption. The security of any encryption scheme
depends on:
i. The length of the key and
ii. The computational work involved in breaking a cipher.
֍ There is nothing in principle about either symmetric or public-key
encryption that makes one superior to another from the point of view
of resisting cryptanalysis.

28-Jan-21 Computer Security 7


Asymmetric (Public-Key) Cryptography…
2. Public-key encryption has made symmetric encryption obsolete.
3. Finally, there is a feeling that key distribution is trivial when using
public-key encryption, compared to the rather cumbersome
handshaking involved with key distribution centers for symmetric
encryption.
Why Public-Key Cryptography?
֍ The concept of public-key cryptography evolved from an attempt to
attack two of the most difficult problems associated with symmetric
encryption.
a. Key Distribution: The key distribution under symmetric encryption
requires either (1) that two communicants already share a key, which
somehow has been distributed to them; or (2) the use of a key
distribution center.
28-Jan-21 Computer Security 8
Asymmetric (Public-Key) Cryptography…
֍ The second requirement negates the very essence of cryptography:
the ability to maintain total secrecy over your own communication;
“what good would it do after all to develop impenetrable
cryptosystems, if their users were forced to share their keys with a
KDC that could be compromised by either burglary or other means?”
b. Digital Signatures: If the use of cryptography was to become
widespread, then electronic messages and documents would need the
equivalent of signatures used in paper documents.

28-Jan-21 Computer Security 9


Asymmetric (Public-Key) Cryptography…
֍ A public-key encryption scheme has six ingredients:
i. Plaintext: This is the readable message or data that is fed
into the algorithm as input.
ii. Encryption algorithm: The encryption algorithm performs
various transformations on the plaintext.
iii. Public and private key: This is a pair of keys that have been
selected so that if one is used for encryption, the other is used
for decryption.
iv. Ciphertext: This is the scrambled message produced as
output.
v. Decryption algorithm: This algorithm accepts the ciphertext
and the matching key and produces the original plaintext.
28-Jan-21 Computer Security 10
Asymmetric (Public-Key) Cryptography…
Applications for Public-Key Cryptosystems
֍ It can be used for confidentiality, authentication, or both.
֍ Depending on the application, the sender uses either the sender’s
private key, the receiver’s public key, or both to perform some type of
cryptographic function.
֍ The use of public-key cryptosystems can be classified into three:
1. Encryption/decryption: The sender encrypts a message with the
recipient’s public key, and the recipient decrypts the message with the
recipient’s private key.
1. Digital signature: The sender “signs” a message with its private key.
Signing is achieved by a cryptographic algorithm applied to the
message or to a small block of data that is a function of the message.

28-Jan-21 Computer Security 11


Asymmetric (Public-Key) Cryptography…
3. Key exchange: Two sides cooperate to exchange a session key, which
is a secret key for symmetric encryption generated for use for a
particular transaction (or session) and valid for a short period of time.
֍ Some algorithms are suitable for all three applications, whereas others
can be used only for one or two of these applications.

Applications for public-key cryptosystems

28-Jan-21 Computer Security 12


Asymmetric (Public-Key) Cryptography-RSA
֍ RSA is the most widely used public-key cryptosystem developed by
Ron Rivest, Adi Shamir, and Len Adleman at MIT in 1977.
֍ It is a block cipher in which the plaintext and ciphertext are integers
between 0 and n - 1 for some n.
֍ Principle: No mathematical method is yet known to efficiently find
the prime factors of large numbers.
֍ In RSA, the private and public keys are constructed from very large
prime numbers (consisting of hundred of decimal digits).
֍ Breaking RSA is equivalent to finding the prime factors: this is
known to be computationally infeasible, i.e., security is based on the
difficulty of factoring large integers.

28-Jan-21 Computer Security 13


Asymmetric (Public-Key) Cryptography-RSA
֍ It is only the person who has produced the keys from the prime
number who can decrypt messages.
֍ Encryption and decryption are of the following form, for some
plaintext block M and ciphertext block C.
C = Me mod n
M = Cd mod n = (Me)d mod n = Med mod n
֍ Both sender and receiver must know the value of n.
֍ The sender knows the value of e, and only the receiver knows the
value of d.
֍ Thus, this is a public key encryption algorithm with a public key of
PU = {e, n} and a private key of PR = {d, n}.
28-Jan-21 Computer Security 14
Asymmetric (Public-Key) Cryptography-RSA
RSA-Key Generation
1. Choose two large prime numbers, p and q
2. Compute n = pxq
3. Compute (phi) φ = (p-1)(q-1)
4. Choose an integer e, 1 < e < φ, such that GCD(e, φ) = 1
5. Determine the secret exponent d, 1 < d < φ, such that φ divides (ed-1)
6. The public key (PU) is the pair of integers (e, n) and the private key
(PR) is (d, n).
 Keep all the values d, p, q and φ secret
 n is known as the modulus
 e is known as the public exponent or encryption exponent
 d is known as the secret exponent or decryption exponent
28-Jan-21 Computer Security 15
Asymmetric (Public-Key) Cryptography-RSA
RSA- Encryption
֍ Sender A does the following:
Obtains the recipient B's public key (e, n)
Represents the plaintext message as a positive integer M
Computes the ciphertext C = Me mod n
Sends the ciphertext C to B
RSA- Decryption
֍ Recipient B does the following:
 Uses his/her private key (d, n) to compute M = Cd mod n
 Extracts the plaintext from the message representative M
Compared to DES, RSA is computationally more complex; encryption is
100-1000 times slower than DES.
28-Jan-21 Computer Security 16
Asymmetric (Public-Key) Cryptography-RSA
RSA Simple Example - Key Generation
1. Choose two prime numbers: p=11, q=3
2. n = pq = 11*3 = 33
3. φ = (p-1)(q-1) = 10*2 = 20
4. Choose e, 1 < e < φ; we choose e=3
Check GCD(e, φ) = GCD(3, 20) = 1 (i.e., 3 and 20 are relatively
prime)
5. Determine d, 1<d<φ, such that φ divides ed-1 (or 20 divides 3d-1)
Simple testing (d = 2, 3 ...) gives d = 7
Check: ed-1 = 3*7 - 1 = 20, which is divisible by φ (20)
6. Public key = (e, n) = (3, 33)
Private key = (d, n) = (7, 33)
28-Jan-21 Computer Security 17
Asymmetric (Public-Key) Cryptography-RSA
RSA- Encryption Example
֍ Now say we want to encrypt the message M = 7
 C = Me mod n = 73 mod 33 = 343 mod 33 = 13
 Hence the ciphertext C = 13
RSA- Decryption Example
֍ To check decryption we compute
 M = Cd mod n = 137 mod 33 = 7

28-Jan-21 Computer Security 18


Asymmetric (Public-Key) Cryptography-RSA
RSA - More Meaningful Example
֍ Message: ATTACKxATxSEVEN
֍ Group the characters into blocks of three and compute a message
representative integer for each block.
 ATT ACK XAT XSE VEN
 We represent our blocks of three characters in base 26 using
A=0, B=1, C=2, ..., Z=25
֍ ATT = 0 x 262 + 19 x 261 + 19 x 260 = 513
ACK = 0 x 262 + 2 x 261 + 10 x 260 = 62
XAT = 23 x 262 + 0 x 261 + 19 x 260 = 15567
XSE = 23 x 262 + 18 x 261 + 4 x 260 = 16020
VEN = 21 x 262 + 4 x 261 + 13 x 260 = 14313
28-Jan-21 Computer Security 19
Asymmetric (Public-Key) Cryptography-RSA
1. Generate two prime numbers: p=137 and q=131
2. n = pq = 137*131 = 17,947
3. φ = (p-1)(q-1) = 136*130 = 17680
4. Choose e = 3 Check GCD(3,17680)=1 (i.e., e and φ are relatively
prime)
5. Determine d, 1<d<φ, such that φ divides ed-1 (or 17680 divides 3d-
1); d = 11787; (11787*3-1)/17680 = 2
6. Public key (e, n) = (3, 17947)
Private key (d, n) = (11787, 17947)

28-Jan-21 Computer Security 20


Asymmetric (Public-Key) Cryptography-RSA
֍ To encrypt the first integer that represents "ATT“ (513), we have
C = Me mod n = 5133 mod 17947 = 8363
֍ We can verify that our private key is valid by decrypting
M = Cd mod n = 836311787 mod 17947 = 513
֍ Overall, our plaintext is represented by the set of integers m
(513, 62, 15567, 16020, 14313)
֍ After decryption, these numbers are converted to their textual
equivalents by successively dividing by 26 and taking the remainders
֍ We compute the corresponding cipher text integers C = M e mod n
(8363, 5017, 11884, 9546, 13366)

28-Jan-21 Computer Security 21


Asymmetric (Public-Key) Cryptography-DS
Digital Signature
֍ Confidentiality ensures that messages cannot be intercepted and read
by eavesdroppers, i.e., encryption protects against passive attack.
֍ A different requirement is to protect against active attack (falsification
of data and transactions). Protection against such attacks is known as
message authentication.
֍ A message, file, document, or other collection of data is said to be
authentic when it is genuine (not altered) and comes from its alleged
source.
֍ A digital signature is not used to ensure the confidentiality of a
message, but rather to guarantee who sent the message, i.e.,
authentication (nonrepudiation).
28-Jan-21 Computer Security 22
Asymmetric (Public-Key) Cryptography-DS
֍ Nonrepudiation can be source repudiation (denial of transmission of
message by source) or destination repudiation (denial of receipt of
message by destination).
֍ Just as with handwritten signatures, digital signing should be done in
a way that is verifiable and nonforgeable.
֍ Digital signature is also used for Data/Message Integrity; it ensures
that messages are protected against modification.
֍ Note: authentication may mean both nonrepudiation and data integrity
and sometimes only data integrity.
֍ Masquerade: The creation of messages by an opponent that are
purported to come from an authorized entity.

28-Jan-21 Computer Security 23


Asymmetric (Public-Key) Cryptography-DS
Digital Signature for Assurance
 Consider the situation where Bob has just sold Alice something for
500 Birr through a deal that is made by e-mail.
 Alice sends an e-mail accepting to pay 500 Birr.
 Two issues need to be taken care of in addition to authentication Alice
needs to be assured that Bob will not modify the amount and show
that Alice promised to pay more than 500 Birr.
 Bob needs to be assured that Alice will not deny that she sends the
message, i.e., source repudiation.
 If Alice signs the message digitally, the two issues will be solved so
that her signature is uniquely tied to its content.
 Bob’s change will be noticed and Alice also cannot deny
28-Jan-21 Computer Security 24
Asymmetric (Public-Key) Cryptography-DS
֍ There are several ways to place digital signatures:
֍ One popular way is to use public-key cryptosystem such as RSA, i.e.,
message encryption by itself can provide measure of authentication.
֍ Digital signature reverses the asymmetric encryption process.
Notation: KX- : Private key of X
KX+ : Public key of X
 Alice encrypts the message using her private key
C = E(KA-, M) –this is Alice’s signature
 Sends the encrypted message to Bob
 Bob then decrypts the signature using Alice’s public key
M = D(KA+, C)
28-Jan-21 Computer Security 25
Asymmetric (Public-Key) Cryptography-DS
֍ If successful, he ensures that it comes from Alice – verifiable.
֍ If Bob can decrypt it with Alice’s public key, the message must have
been encrypted by Alice; No one else has Alice’s private key, and
therefore no one else could have created a ciphertext that could be
decrypted with Alice’s public key – non forgeable.
֍ Therefore, the encrypted message serves as a digital signature.
֍ But anyone can decrypt the message using Alice’s public key if it is
not important that the message be kept secret.

28-Jan-21 Computer Security 26


Asymmetric (Public-Key) Cryptography-DS
֍ To combine both confidentiality and authentication:
 Alice has to first encrypt the message using her private key
 Then encrypt the message with Bob’s public key
C = E(KB+, E(KA-, M))
 Sends the encrypted message to Bob
 Bob decrypts the message using his private key
 Bob then decrypts the message using Alice’s public key
M = D(KA+, D(KB-, C))

28-Jan-21 Computer Security 27


Asymmetric (Public-Key) Cryptography-DS

Public-Key Cryptosystem: Authentication and Confidentiality

 Disadvantage: The public-key algorithm must be applied four times


rather than two in each communication which has an impact on
efficiency
28-Jan-21 Computer Security 28
Hash Functions
֍ A hash function H takes a message m of arbitrary length and produces
a fixed size bit string h, h= H(m).
֍ When the hash value h is sent with the message m, it enables to
determine whether m has been modified or not; the principal objective
of a hash function is data integrity.
֍ The two most common hashing algorithms are MD5 (Message Digest
version 5) which produces a 128-bit hash and Secure Hash Algorithm
or SHA (SHA-1 and later versions like SHA- 256).
֍ h = H(m) is sent along m (not encrypted), where H is a cryptographic
hash function.

28-Jan-21 Computer Security 29


Hash Functions: Properties
֍ One-way function: It is computationally infeasible to find m that
corresponds to a known output of h.
 Or given a hash value h it should be difficult to find the
message m such that h = H(m).
 That means you cannot “un hash” something
֍ Collision resistance: It should be hard to find two different inputs of
any length that result in the same hash.
 Or for a function h, it is hard to find any two different inputs x
and y such that h(x)=h(y).
֍ The output is of fixed-length no matter what input is given. This is
exactly how Windows stores passwords.

28-Jan-21 Computer Security 30

You might also like