• No results found

lecture 4 Cryptography II .ppt

N/A
N/A
Protected

Academic year: 2020

Share "lecture 4 Cryptography II .ppt"

Copied!
38
0
0

Loading.... (view fulltext now)

Full text

(1)

Computer Security I

Computer Security I

Unit 2: Authorization &

Authentication

(2)

Based on how they are applied to a plaintext message Cryptographic algorithms can be categorized as;

oBlock Cipher

oStream Cipher

(3)

Block Cipher

o Block Ciphers work on a fixed-length segment

of plaintext data, typically a 64-bit or 128-bit block as input, and outputs a fixed length

ciphertext.

oThe message is broken into blocks, and each

block is encrypted through a substitution process.

oWhere there is insufficient data to fill a block, the blank space will be padded prior to

encryption.

oThe resulting ciphertext block is usually the

same size as the input plaintext block.

oBlock ciphers are mostly used in symmetric key encryption.

oExamples - DES, Triple DES, RC2 and AES are

based on the block ciphers.

oColumnar transposition is a block cipher.

(4)

For example

A 150-bit plaintext message provides two blocks of 64 bits each with third block of balance 22 bits. The last block of bits needs to be padded up with

redundant information so that the length of the final block equal to block size of the scheme. In our

example, the remaining 22 bits need to have additional 42 redundant bits added to provide a complete block.

oThe process of adding bits to the last block is referred to as Padding.

oOne method of padding is the PKCS#5 by RSA

(5)

Block Cipher

Advantages:

oHigh diffusion: information from one plaintext

symbol is diffused into several ciphertext symbols.

oImmunity to tampering: difficult to insert symbols without detection.

Disadvantages:

oSlowness of encryption: an entire block must be accumulated before encryption / decryption can begin.

oError propogation: An error in one symbol may

corrupt the entire block.

(6)

Stream Cipher

oStream ciphers convert one bit of plaintext data

directly into a bit of ciphertext data.

oStream ciphers use substitution to encrypt, a cryptographic key is used to generate a pseudo-random stream of digits that are combined with the plaintext digits to create the ciphertext. 

oThis keystream must be of the same length as the plaintext message.

oThe keystream is typically XOR'd with the

plaintext using a bitwise operation on individual bits.

oCan be used in real time communication such as VoIP

(7)

Stream Cipher

Advantages:

oSpeed of transformation: each bit is encrypted alone as soon as it is read

oLow error propagation: an error in encrypting

one bit likely will not affect subsequent bits.

Disadvantages:

oLow diffusion: all information of a plaintext bit is

contained in a single ciphertext bit.

oSusceptibility to insertions/ modifications: an active interceptor who breaks the algorithm might insert spurious text that looks authentic.

(8)
(9)

Block vs Stream Ciphers

Block vs Stream Ciphers

Most symmetric block ciphers are based on a the following scheme;

Feistel Cipher Structure

o Feistel Cipher is not a specific scheme of block cipher.

o It is a design model from which many different block ciphers are derived.

o DES is just one example of a Feistel Cipher.

o A cryptographic system based on Feistel cipher

structure uses the same algorithm for both encryption and decryption.

o Process through multiple rounds which partitions

(10)

Data Encryption Standard

Data Encryption Standard

(DES)

(DES)

1973, NIST published a solicitation

for an encryption standard

Uses a combination of substitution

and permutation methods to

provide confusion and diffusion

respectively

DES was adopted as encryption

(11)

Uses a combination of substitution and

permutation methods to provide confusion and diffusion respectively

Diffusion – dissipates statistical structure of plaintext over bulk of ciphertext.

oDiffusion means that the output bits should depend on the input bits in a very complex way.

oIn a cipher with good diffusion, if one bit of the plaintext is changed, then the ciphertext should change completely, in an unpredictable or pseudorandom manner

Confusion – makes relationship between ciphertext and key as complex as possible

oOne aim of confusion is to make it very hard to find the key even if one has a large number of plaintext-ciphertext pairs produced with the same key.

oTherefore, each bit of the ciphertext should depend on the entire key.

(12)

Data Encryption Standard

Data Encryption Standard

(DES)

(DES)

DES was the encryption standard

until 2001 when it was replaced

by AES.

Features:

-

Block size

= 64 bits

-

Key size

= Initially 64bits, reduced to

56 bits where 8 bits are used for

parity, then 48/56 bits are chosen at

random to be used

-

Number of rounds

= 16

(13)

DES Rounds

(14)

DES

DES

After initialization the DES

algorithm operates on blocks of

data

It splits a data block in half,

scrambles each half

independently, combines the key

with one half and swaps the two

halves.

(15)

Concerns About DES

Concerns About DES

The key size was too small (only 56

bits) **concern about brute force

attacks.

Not enough non- linearity. The only

non-linear elements are the S-boxes.

 In cryptography, an S-Box(Substitution-box) is

a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the

relationship between the key and the ciphertext — Claude Shannon's property of confusion.

Two strong attacks against DES:

(16)

Triple DES

Triple DES

Applies the Data Encryption

Standard (DES) cipher algorithm

three times to each data block.

Due to the availability of

(17)

Triple DES was designed to

provide a relatively simple

method of increasing the key size

of DES to protect against such

attacks, without designing a

completely new block cipher

algorithm.

No known practical attacks

(18)

Advanced Encryption Standard

Advanced Encryption Standard

(AES)

(AES)

In 1997, NIST made a formal call for

algorithms stipulating that the AES

would specify an unclassified,

publicly disclosed encryption

algorithm, available royalty-free,

worldwide.

Goal: replace DES for both

(19)

Rijndael Design

Rijndael Design

Design simplicity with rich algebraic

structure and efficiency

Has the option of 3 key lengths: 128

bits, 192 bits or 256 bits

Operates on a 128 bit block with rounds

depending on the key length used.

128 bit key – 10 rounds

192 bit key – 12 rounds

256 bit key – 14 rounds

It is fast in both software and hardware

(20)

Rivest-Shamir-Adelman

Rivest-Shamir-Adelman

(RSA) Encryption

(RSA) Encryption

o Inventors:

◦ Ron Rivest, Adi Shamir and Leonard Adelman

o RSA was introduced in 1978 and is an

asymmetric algorithm

o The RSA cryptosystem is the most widely-used public key cryptography algorithm in the world. o It can be used to encrypt a message without the

need to exchange a secret key separately.

o The RSA algorithm can be used for both public key encryption and digital signatures.

(21)

RSA ENCRYPTION AND DECRYPTION PROCESS

Encryption

Sender Paul does the following;

1.Obtains the recipient Mary’s public key (n,e)

2.Represents the plaintext message as a positive integer m with 1<m<n

3.Compute the ciphertext C=me

4.Send the ciphertext C to the desired recipient Mary.

Decryption

Recipient Mary does the following

1.Mary Uses her private key (n,d) to compute M = Cd mod n

(22)

Determine d (using modular arithmetic) which satisfies the congruence relation e.d

mod(φ(n))= 1

d is kept as the private key exponent.

 The public key (e,n)  The private key (d,n)

Rivest-Shamir-Adelman

Rivest-Shamir-Adelman

(23)

 The keys for the RSA algorithm are generated

the following way:

1. Choose two distinct prime numbers p and q. (Note: p cannot be equal to q)

2. Compute n = pq.

n is used as the modulus for both the public and private keys

3. Compute φ(pq) = (p − 1)(q − 1). (φ is Euler's totient function).

In number theory, Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. ... Euler's totient function is a multiplicative function, meaning that if two numbers m and n are relatively prime, then φ(mn) = φ(m)φ(n).

(24)

(a)      Assume p = 7, q = 13 and e = 29. Using RSA mathematical

techniques, answer the following questions:

(i)  Calculate the RSA modulus n.              

Answer: n = (p*q) = (7*13) = 91  

(ii) Determine the private key d.           

Answer: Choose values for d until it satisfies the equation

 e*d mod Φ(n) = 1. We first calculate Φ(n).

 Φ(n) = (p-1)*(q-1)=(7-1)*(13-1) = 6*12 = 72. We then chose values for d starting from 1 and making single

increments. Once d reached 5, the equation was satisfied, so (29*5) mod 72= 1.Therefore d = 5

 

(iii) Given a message M = 2, calculate the cipher value C.          

Answer: Using the equation C = Me mod n, we can

calculate C.

C = 229 mod 91 = 32

 

(iv) Given a cipher value C = 41, calculate the original message M.

      

Answer: Using the equation M = Cd mod n, and having

(25)

Public Keys and Trust

(26)

Public Key Infrastructure

Public Key Infrastructure

Model

Model

Public-key Infrastructure:

oThe Public key infrastructure (PKI) is the set of

hardware, software, policies, processes, and

procedures required to create, manage, distribute, use, store, and revoke digital certificates and

public-keys.

oPKIs help establish the identity of people, devices,

and services – enabling controlled access to

systems and resources, protection of data, and accountability in transactions through;

o Certificate Authorities (CA’s)

o Digital Certificates

(27)

Digital Certificates

oDigital certificates are electronic credentials that

are used to assert the online identities of individuals, computers, and other entities on a network by

binding a Public key to a user which enables a trust relationship.

oMuch as a passport certifies one’s identity as a

citizen of a country, the digital certificate establishes the identity of users within the ecosystem.

oThey are issued by certification authorities (CAs)

that must validate the identity of the

certificate-holder both before the certificate is issued and when the certificate is used. Common uses include

business scenarios requiring authentication, encryption, and digital signing.

 

Public Key Infrastructure

Public Key Infrastructure

Model

(28)

PKI sets up entities called Certificate Authorities (CA) that implement the PKI policy on

certificates.

In general, a CA is usually trusted and

their actions include:

o Manage public key certificates

o Issue certificates by binding a user's or

system's identity to a public key w/ a digital signature

o Scheduling expiration dates

o Revoke certificates when necessary by

publishing to a Cetificate Revocation List (CRL)

Public Key Infrastructure

Public Key Infrastructure

Model

(29)

The functions of a CA can be done

in-house (openSSL) or by

commercial service (Eg. Verisign,

GlobalSign, RapidSSL )or a

trusted third party.

PKI also involves a registration

authority (RA) – interface between

CA and user. They capture and

(30)
(31)
(32)

X.509 Authentication

X.509 Authentication

Service

Service

Part of X.500 directory service

standards.

Defines framework for

authentication services:

Defines that public keys stored as

certificates

in a public directory.

Certificate are used by numerous

(33)

X.509 Certificates

X.509 Certificates

Certificates contain:

version (1, 2, or 3)

serial number (unique within CA)

identifying certificate

signature algorithm identifier issuer

X.500 name (CA)

(34)

subject X.500 name (name of owner)

subject public-key info (algorithm,

parameters, key)

issuer unique identifier (v2+)

subject unique identifier (v2+)

extension fields (v3)

(35)

Validity of Certificates

Validity of Certificates

Certificates are valid if:

Signature of CA verifies

Dates of the certificate are valid

Certificate was not revoked

Certificates can be revoked

before expiration if

user's private key is compromised

user is no longer certified by this CA

(36)
(37)

CA maintains a list of revoked

certificates: Certificate

Certificate Revocation List (CRL)

Users should check certificates

(38)

References

Related documents

The next step in the postprocessing is to plot the contours of the von Mises stress using the von Mises Stress icon in the Image toolbar.. The von Mises stress is displayed to the

Favor you leave and sample policy employees use their job application for absence may take family and produce emails waste company it discusses email etiquette Deviation from

The purpose of this study was to evaluate the diagnostic utility of real-time elastography (RTE) in differentiat- ing between reactive and metastatic cervical lymph nodes (LN)

3) the traffic performance on the circuit groups to that destination. Indication that circuit congestion loss may occur can be obtained from the status information detailed in §

Methods: A sample of 59 adult high risk males detained in a high secure hospital completed questionnaires at baseline and post treatment to assess violent attitudes, anger,

Wat die gemiddelde SAT vir die klank /d/ met 'n groot nega- tiewe waarde betref, geld dieselfde oorwegings wat vir die vo- rige klanke geld, ook hier, dit wil se dat daar

5 % Local Body Tax + 1500 (SC) will be applicable on Ex-Showroom for Thane (wherever applicable).. For registration in Navi Mumbai, Vashi, Mira-Bhayander, Vasai-Virar or Kalyan,