1 of 138

20CS17 – INFORMATION SECURITY

LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING

(AUTONOMOUS)

Accredited by NAAC & NBA (Under Tier - I) ISO 9001:2015 Certified Institution

Approved by AICTE, New Delhi. and Affiliated to JNTUK, Kakinada

L.B. REDDY NAGAR, MYLAVARAM, KRISHNA DIST., A.P.-521 230.

DEPARTMENT OF Information Technology

UNIT-2

Program & Semester: B.Tech & VI SEM

Section: CSE-C

Academic Year: 2023 - 24

Mr . M. Vijay Kumar

Sr Assistant Professor

Dept.of IT, LBRCE

2 of 138

Message Authentication

  • Another type of threat that exist for data is the lack of message authentication. In this threat, the user is not sure about the originator of the message. Message authentication can be provided using the cryptographic techniques that use secret keys as done in case of encryption.

3 of 138

Message Authentication

  • message authentication is concerned with:
    • protecting the integrity of a message
    • validating identity of originator
    • non-repudiation of origin (dispute resolution)
  • will consider the security requirements
  • then three alternative functions used:
    • message encryption
    • message authentication code (MAC)
    • hash function

4 of 138

Security Requirements

  • disclosure
  • traffic analysis
  • masquerade
  • content modification
  • sequence modification
  • timing modification
  • source repudiation
  • destination repudiation

5 of 138

Message Encryption

  • message encryption by itself also provides a measure of authentication
  • if symmetric encryption is used then:
    • receiver know sender must have created it
    • since only sender and receiver now key used
    • know content cannot of been altered
    • if message has suitable structure, redundancy or a checksum to detect any changes

6 of 138

7 of 138

8 of 138

Message Encryption

  • if public-key encryption is used:
    • encryption provides no confidence of sender
    • since anyone potentially knows public-key
    • however if
      • sender signs message using their private-key
      • then encrypts with recipients public key
      • have both secrecy and authentication
    • again need to recognize corrupted messages
    • but at cost of two public-key uses on message

9 of 138

Message Authentication Code (MAC)

  • generated by an algorithm that creates a small fixed-sized block
    • depending on both message and some key
    • like encryption though need not be reversible
  • appended to message as a signature
  • receiver performs same computation on message and checks it matches the MAC
  • provides assurance that message is unaltered and comes from sender

10 of 138

11 of 138

12 of 138

MAC

13 of 138

MAC codes

  • as shown the MAC provides authentication
  • can also use encryption for secrecy
    • generally use separate keys for each
    • can compute MAC either before or after encryption
    • is generally regarded as better done before
  • why use a MAC?
    • sometimes only authentication is needed
    • sometimes need authentication to persist longer than the encryption (eg. archival use)
  • note that a MAC is not a digital signature

14 of 138

MAC Properties

  • a MAC is a cryptographic checksum

MAC = CK(M)

    • condenses a variable-length message M
    • using a secret key K
    • to a fixed-sized authenticator
  • is a many-to-one function
    • potentially many messages have same MAC
    • but finding these needs to be very difficult

15 of 138

Requirements for MACs

  • taking into account the types of attacks
  • need the MAC to satisfy the following:
    1. knowing a message and MAC, is infeasible to find another message with same MAC
    2. MACs should be uniformly distributed
    3. MAC should depend equally on all bits of the message

16 of 138

Using Symmetric Ciphers for MACs

  • can use any block cipher chaining mode and use final block as a MAC
  • Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC
    • using IV=0 and zero-pad of final block
    • encrypt message using DES in CBC mode
    • and send just the final block as the MAC
      • or the leftmost M bits (16≤M≤64) of final block
  • but final MAC is now too small for security

17 of 138

Data Authentication Algorithm

18 of 138

HMAC

  • specified as Internet standard RFC2104
  • uses hash function on the message:

HMACK = Hash[(K+ XOR o pad) ||

Hash[(K+ XOR I pad)||M)]]

  • where K+ is the key padded out to size
  • and o pad, I pad are specified padding constants
  • overhead is just 3 more hash calculations than the message needs alone
  • any hash function can be used
    • eg. MD5, SHA-1, RIPEMD-160, Whirlpool

19 of 138

20 of 138

21 of 138

22 of 138

23 of 138

24 of 138

25 of 138

26 of 138

27 of 138

HMAC Overview

28 of 138

  •  

29 of 138

  •  

30 of 138

HMAC Security

  • proved security of HMAC relates to that of the underlying hash algorithm
  • attacking HMAC requires either:
    • brute force attack on key used
    • birthday attack (but since keyed would need to observe a very large number of messages)
  • choose hash function used based on speed verses security constraints
  • Iv=to achieve randomization of deterministic primitives

31 of 138

Keyed Hash Functions as MACs

  • want a MAC based on a hash function
    • because hash functions are generally faster
    • code for crypto hash functions widely available
  • hash includes a key along with message
  • original proposal:

KeyedHash = Hash(Key|Message)

    • some weaknesses were found with this
  • eventually led to development of HMAC

32 of 138

Hash Functions

  • condenses arbitrary message to fixed size

h = H(M)

  • usually assume that the hash function is public and not keyed
    • cf. MAC which is keyed
  • hash used to detect changes to message
  • can use in various ways with message
  • most often to create a digital signature

33 of 138

Hash Functions & Digital Signatures

34 of 138

Requirements for Hash Functions

  1. can be applied to any sized message M
  2. produces fixed-length output h
  3. is easy to compute h=H(M) for any message M
  4. given h is infeasible to find x s.t. H(x)=h
    • one-way property
  5. given x is infeasible to find y s.t. H(y)=H(x)
    • weak collision resistance
  6. is infeasible to find any x,y s.t. H(y)=H(x)
    • strong collision resistance

35 of 138

Simple Hash Functions

  • are several proposals for simple functions
  • based on XOR of message blocks
  • not secure since can manipulate any message and either not change hash or change hash also
  • need a stronger cryptographic function (next chapter

36 of 138

Birthday Attacks

  • might think a 64-bit hash is secure
  • but by Birthday Paradox is not
  • birthday attack works thus:
    • opponent generates 2m/2 variations of a valid message all with essentially the same meaning
    • opponent also generates 2m/2 variations of a desired fraudulent message
    • two sets of messages are compared to find pair with same hash (probability > 0.5 by birthday paradox)
    • have user sign the valid message, then substitute the forgery which will have a valid signature
  • conclusion is that need to use larger MAC/hash

37 of 138

Block Ciphers as Hash Functions

  • can use block ciphers as hash functions
    • using H0=0 and zero-pad of final block
    • compute: Hi = EMi [Hi-1]
    • and use final block as the hash value
    • similar to CBC but without a key
  • resulting hash is too small (64-bit)
    • both due to direct birthday attack
    • and to “meet-in-the-middle” attack
  • other variants also susceptible to attack

38 of 138

Hash Functions & MAC Security

  • like block ciphers have:
  • brute-force attacks exploiting
    • strong collision resistance hash have cost 2m/2
      • have proposal for h/w MD5 cracker
      • 128-bit hash looks vulnerable, 160-bits better
    • MACs with known message-MAC pairs
      • can either attack key space (cf key search) or MAC
      • at least 128-bit MAC is needed for security

39 of 138

Hash Functions & MAC Security

  • cryptanalytic attacks exploit structure
    • like block ciphers want brute-force attacks to be the best alternative
  • have a number of analytic attacks on iterated hash functions
    • CVi = f[CVi-1, Mi]; H(M)=CVN
    • typically focus on collisions in function f
    • like block ciphers is often composed of rounds
    • attacks exploit properties of round functions

40 of 138

Hash and MAC Algorithms

  • Hash Functions
    • condense arbitrary size message to fixed size
    • by processing message in blocks
    • through some compression function
    • either custom or block cipher based
  • Message Authentication Code (MAC)
    • fixed sized authenticator for some message
    • to provide authentication for message
    • by using block cipher mode or hash function

41 of 138

Hash Algorithm Structure

42 of 138

Secure Hash Algorithm

  • SHA originally designed by NIST & NSA in 1993
  • was revised in 1995 as SHA-1
  • US standard for use with DSA signature scheme
    • standard is FIPS 180-1 1995, also Internet RFC3174
    • nb. the algorithm is SHA, the standard is SHS
  • based on design of MD4 with key differences
  • produces 160-bit hash values
  • recent 2005 results on security of SHA-1 have raised concerns on its use in future applications

43 of 138

How SHA Works?

  • Digest Length=160 bit
  • I/P Text=512 bit
  • Sub Block size=32bit
  • 512/32=16 total Sub blocks
  • No. Of Rounds=4
  • Iteration per round=20
  • Chaining Variable = 5*32=160
  • K[t] constant= Where t=0 to 79
  • O/P-> four 32 bit blocks

44 of 138

SHA 1

45 of 138

SHA Overview

  1. Padding: Length of the message is 64 bits short of multiple of 512 after padding.
  2. Append a 64-bit length value of original message is taken.
  3. Divide the input into 512-bit blocks
  4. Initialise CV 5-word (160-bit) buffer (A,B,C,D,E) to

(A=01 23 45 67,

B=89 AB CD EF,

C=FE DC BA 98,

D=76 54 32 10,

E=C3 D2 E1 F0)

46 of 138

Continue…

  1. Process Blocks now the actual algorithm begins. message in 16-word (512-bit) chunks:
    • Copy CV into single register for storing temporary intermediate as well as the final results.
    • Divide the current 512-bit blocks into 16 sub-blocks, each consisting of 32 bits.
    • Has No. Of Rounds=4, each round consisting of 20 bit /step iteration operations on message block & buffer
    • expand 16 words into 80 words(20*4) by mixing & shifting.K[t] constant= Where t=0 to 79
    • Form new buffer value by adding output to input.

6. output hash value is the final buffer value

47 of 138

48 of 138

SHA-1 Compression Function

ABCDE=(F[t]+E+S5(A)+W[t]+K[t]),>>>Shift right by 1 bit for next iteration

49 of 138

SHA-1 Compression Function terms

  • each round has 20 steps which replaces the 5 buffer words thus:

(A,B,C,D,E) <-(E+f(t,B,C,D)+(A<<5)+Wt+Kt),A,(B<<30),C,D)

  • ABCDE refer to the 5 words of the buffer
  • t is the step number
  • f(t,B,C,D) is nonlinear function for round
  • Wt is derived from the message block
  • Kt is a constant value
  • S^t circular left shift of 32 bit sub-block by t bits

50 of 138

Process F(t) in each SHA-1 round

  • where g can be expressed as:��ROUND 1: (b AND c) OR ((NOT b) AND (d)) same as MD5

�ROUND 2: b XOR c XOR d

�ROUND 3: (b AND c) OR (b AND d) OR (c AND d)

�ROUND 4: b XOR c XOR d

51 of 138

Creation of 80-word input Wt

Adds redundancy and interdependence among message blocks

52 of 138

53 of 138

Cryptanalysis and Limitation

  • Key Premises for Hash Functions:

1. Impossible to re-create a message given a fingerprint

2. Collision Free

  • SHA-1 failure using brute force attack in 280 operations
  • Collision failure found in 2005 in 233 operations

54 of 138

Revised Secure Hash Standard

  • NIST issued revision FIPS 180-2 in 2002
  • adds 3 additional versions of SHA
    • SHA-256, SHA-384, SHA-512
    • Different lengths of Message Digest in bits
  • designed for compatibility with increased security provided by the AES cipher
  • structure & detail is similar to SHA-1
  • hence analysis should be similar
  • but security levels are rather higher

55 of 138

SHA-512

  • Aim: To generate fixed length code
  • depends on hash function
  • If output🡪128 bit----SHA1
  • 256 bit----SHA256
  • 512 bit-----SHA512 ….512 bit hash code
  • PT block size =1024 bits
  • No.of rounds/steps =80
  • Each round ”w”(word)=64bit(from PT)
  • Each round use---🡪constant key
  • Buffers =8(stores IR results /store o/p)
  • Each buffer size=64bit
  • O/p of 1st block is I/p to 2nd block

56 of 138

SHA-512

  • Pad the bits 100….so that until length of PT<multiples of 1024 bits>
  • Append 128 bit representation of PT such that length=multiple of 1024(N*1024)
  • 128 bit added I 2nd round/step
  • Initialize the buffer(a , b, c, d ,e , f) 64 bit size in hexadecimal format
  • Process the block of PT in 80 rounds/steps
  • Output in buffers is Hash Code(512)-🡪Fixed length

57 of 138

SHA-512 Overview

1. Padding,2.Append Length,3.Divide the input into 1024- bit blocks

58 of 138

4.Initialization Of Chaining Variable

  • 8*64= 512 bits
  • A,B,C,D,E,F,G,H

59 of 138

5.Process Blocks

  • heart of the algorithm
  • processing message in 1024-bit blocks
  • consists of 80 rounds
    • updating a 512-bit buffer TEMP CHAINING VARIABLES.
    • using a 64-bit value Wt derived from the current message block
    • and a round constant based on cube root of first 80 prime numbers

60 of 138

Initialize the buffers

61 of 138

SHA-512 Round Function

62 of 138

SHA-512 Round Function

63 of 138

SHA-512 Round Function

Let us look in more detail at the logic in each of the 80 steps of the processing of one 512-bit block (Figure). Each round is defined by the following set of equations:

64 of 138

SHA-512 Round Function

  • where
  • t =step/round number; 0 t 79
  • Ch(e, f, g)= (e AND f) XOR (NOT e AND g)

the conditional function: If e then f else g

  • Maj(a, b,c)= (a AND b) XOR (a AND c) XOR (b AND c)

the function is true only of the majority (two or three) of the arguments are true.

  • Sum (ai)= RORT (ai By 28 Bit) XOR RORT (ai By 34 Bit) XOR

RORT (ai By 39 Bit)

  • Sum (ei)= RORT (ei By 14 Bit) XOR RORT (ei By 18 Bit) XOR

RORT (ei By 41 Bit)

  • ROTRn(x) = circular right shift (rotation) of the 64-bit argument x by n bits
  • Wt = a 64-bit word derived from the current 512-bit input block (i.e:- Message Digest)
  • Kt = a 64-bit additive constant
  • + = addition modulo 2^64

65 of 138

Why Public-Key Cryptography

  • developed to address two key issues:
    • key distribution – how to have secure communications in general without having to trust a KDC with your key
    • digital signatures – how to verify a message comes intact from the claimed sender
  • public invention due to Whitfield Diffie & Martin Hellman at Stanford Uni in 1976
    • known earlier in classified community

66 of 138

Principles of Public-Key Cryptography

  • public-key/two-key/asymmetric cryptography involves the use of two keys:
    • a public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures
    • a private-key, known only to the recipient, used to decrypt messages, and sign (create) signatures
  • is asymmetric because
    • those who encrypt messages or verify signatures cannot decrypt messages or create signatures

67 of 138

Principles Public-Key Cryptography

68 of 138

Public-Key Characteristics

  • Public-Key algorithms rely on two keys where:
    • it is computationally infeasible to find decryption key knowing only algorithm & encryption key

    • it is computationally easy to en/decrypt messages when the relevant (en/decrypt) key is known

    • either of the two related keys can be used for encryption, with the other used for decryption (for some algorithms)

69 of 138

Public-Key Cryptosystems: Secrecy

70 of 138

Public-Key Cryptosystems: Authentication

71 of 138

Public-Key Applications

  • can classify uses into 3 categories:
    • encryption/decryption (provide secrecy)
    • digital signatures (provide authentication)
    • key exchange (of session keys)
  • some algorithms are suitable for all uses, others are specific to one

72 of 138

Security of Public Key Schemes

  • like private key schemes brute force exhaustive search attack is always theoretically possible
  • but keys used are too large (>512bits)
  • security relies on a large enough difference in difficulty between easy (en/decrypt) and hard (cryptanalyse) problems
  • more generally the hard problem is known, but is made hard enough to be impractical to break
  • requires the use of very large numbers
  • hence is slow compared to private key schemes

73 of 138

Difference between symmetric and asymmetric cryptography

  • Basis for Comparison
  • Symmetric Encryption
  • Asymmetric Encryption
  • Basic
  • Symmetric encryption uses a single key for both encryption and decryption.
  • Asymmetric encryption uses a different key for encryption and decryption.
  • Performance
  • Symmetric encryption is fast in execution.
  • Asymmetric Encryption is slow in execution due to the high computational burden
  • Algorithms
  • DES, 3DES, AES, and RC4.
  • Diffie-Hellman, RSA.
  • Purpose
  • The symmetric encryption is used for bulk data transmission.
  • The asymmetric encryption is often used for securely exchanging secret keys.

74 of 138

.

  • Public-Key Cryptosystems Algorithms

  • 1.RSA

  • 2.Diffie-Hellman key exchange

75 of 138

RSA

  • By Rivest, Shamir & Adleman of MIT in 1977
  • best known & widely used public-key scheme
  • based on exponentiation in a finite field over integers modulo a prime
  • uses large integers (eg. 1024 bits)
  • security due to cost of factoring large numbers

76 of 138

RSA Key Setup

  • each user generates a public/private key pair by:
  • selecting two large prime numbers at random p, q
  • computing their product n=p*q
    • note ø(n)=(p-1)(q-1)
  • selecting at random the encryption key e
      • where 1<e<ø(n), gcd(e,ø(n))=1
  • solve following equation to find decryption key d
    • e.d=1 mod ø(n) and 0≤d≤n
  • publish their public encryption key: PU={e,n}
  • keep secret private decryption key: PR={d,n}

77 of 138

RSA Use

  • to encrypt a message M the sender:
    • obtains public key of recipient PU={e,n}
    • computes: C = Me mod n, where 0≤M<n
  • to decrypt the ciphertext C the owner:
    • uses their private key PR={d,n}
    • computes: M = Cd mod n
  • note that the message M must be smaller than the modulus n.

78 of 138

RSA Example - Key Setup

  1. Select primes: p=17 & q=11
  2. Compute n = pq =17 x 11=187
  3. Compute ø(n)=(p–1)(q-1)=16 x 10=160
  4. Select e: gcd(e,160)=1; choose e=7
  5. Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23x7=161
  6. Publish public key PU={7,187}
  7. Keep secret private key PR={23,187}

79 of 138

Diffie-Hellman Key Exchange

  • a public-key distribution scheme
    • cannot be used to exchange an arbitrary message
    • rather it can establish a common key
    • known only to the two participants
  • value of key depends on the participants (and their private and public key information)
  • based on exponentiation in a finite field (modulo a prime or a polynomial) - easy

80 of 138

Diffie-Hellman Setup

  • all users agree on global parameters:
    • large prime integer or polynomial ‘q’
    • Select α such that α<q and a primitive root of ‘q

  • each user (eg. A) generates their key
    • chooses a secret key/private key (number): xA < q
    • compute their public key: yA = α XA mod q

  • each user makes public that key yA

  • each user (eg. B) generates their key

chooses a secrete/private key: xB < q

Compute public key: yB = α XB mod q

  • If both keys are equal exchange is successful

81 of 138

Key Exchange Protocols

82 of 138

Diffie-Hellman Key Exchange

  • shared session key for users A & B is KAB:

KAB = α xA.xB mod q

K= yAXB mod q (which B can compute/receiver)

K= yBxA mod q (which A can compute/sender)

  • KAB is used as session key in private-key encryption scheme between Alice and Bob
  • if Alice and Bob subsequently communicate, they will have the same key as before, unless they choose new public-keys

83 of 138

Assume xA=97 & xB =233

yA = α XA mod q

yB = α XB mod q

84 of 138

Digital Signatures

  • have looked at message authentication
    • but does not address issues of lack of trust
  • digital signatures provide the ability to:
    • verify author, date & time of signature
    • authenticate message contents
    • be verified by third parties to resolve disputes
  • hence include authentication function with additional capabilities

85 of 138

Digital Signature Properties

  • must depend on the message signed
  • must use information unique to sender
    • to prevent both forgery and denial
  • must be relatively easy to produce
  • must be relatively easy to recognize & verify
  • be computationally infeasible to forge
    • with new message for existing digital signature
    • with fraudulent digital signature for given message
  • be practical save digital signature in storage

86 of 138

.

  • A variety of approaches has been proposed for the digital signature function. These approaches has been fall into two categories.

  • Direct Digital Signature

  • Arbitrated Digital Signature

87 of 138

Direct Digital Signatures

  • involve only sender & receiver
  • assumed receiver has sender’s public-key
  • digital signature made by sender signing entire message or hash with private-key
  • can encrypt using receivers public-key
  • important that sign first then encrypt message & signature
  • security depends on sender’s private-key

88 of 138

Arbitrated Digital Signatures

  • involves use of arbiter A
    • validates any signed message
    • then dated and sent to recipient
  • requires suitable level of trust in arbiter
  • can be implemented with either private or public-key algorithms
  • arbiter may or may not see message

89 of 138

Digital Signature Standard (DSS)

  • US Govt approved signature scheme
  • designed by NIST & NSA in early 90's
  • published as FIPS-186 in 1991
  • revised in 1993, 1996 & then 2000
  • uses the SHA hash algorithm
  • DSS is the standard, DSA is the algorithm
  • FIPS 186-2 (2000) includes alternative RSA & elliptic curve signature variants

90 of 138

Digital Signature Algorithm (DSA)

91 of 138

Digital Signature

92 of 138

DSA Key Generation

  • Global public key Components (p,q,g): g=10
    • choose a large prime p = 2L .....(p=10)
      • where L= 512 to 1024 bits and is a multiple of 64
      • choose q, a 160 bit
      • and q is a prime factor of (p-1) ....(q=19)
    • choose g = h(p-1)/q mod p
      • where h<p-1, h(p-1)/q (mod p) > 1 h=any integer
  • users choose private & compute public key:
    • choose x<q , x->random number x=16
    • compute y = gx (mod p) 1016 mod 19 = 4

93 of 138

DSA Signature Creation

  • to sign a message M the sender:
    • generates a random signature key k, k<q k=5
    • k must be random, be destroyed after use, and never be reused
  • then computes signature pair:

r = (gk(mod p))(mod q)

s = (k-1.H(M)+ x.r)(mod q)(S = 105 mod 19 = 3)

The signature is  (r,s)

  • sends signature (r,s) with message M m=14 as (3,4)

94 of 138

DSA Signature Verification

  • having received M & signature (r,s)
  • to verify a signature, recipient computes:
  • Verify that 0<r<q and 0<s<q
    • w = K-1 mod (q-1) = 5-1 mod 18 = 11
    • computing

u1= (H(M).w)(mod q) =>11(14-16.3) mod 18 = 4

u2= (r.w)(mod q)

v = (gu1.yu2(mod p)) (mod q)

    • r = 1014 mod 19 = 16
    • V = 43.34 = 5184 = 16 mod 19

  • if v=r then signature is verified
  • M1,r1, s1----receivers side

95 of 138

Electronic signature is an electronic symbol attached to a contract or other record, used by a person with an intent to sign.

Digital signatures guarantee that an electronic document is authentic.

96 of 138

Digital Certificates

  • Certificates are the framework for identification information, and bind identities with public keys.

They provide a foundation for

      • identification
      • authentication and
      • non-repudiation
      • Nonrepudiation is the assurance that someone cannot deny something.

97 of 138

Sample View of a Certificate

Certificate Types :

1.Private/Personal 2.Server 3.Developer

98 of 138

.

99 of 138

How Digital Certificates work?

  • Generate Public and Private Keys.
  • Get Certificate from the CA
  • certificate authority (CA) is an organization that stores public keys and their owners, and every party in a communication trusts this organization (and knows its public key)
  • Sign the document/page using the private key.
  • Send signed document over open networks along with the CA’s certificate.
  • Recipient verifies using the signing CA’s public key
  • Trust Chain and Fingerprints

100 of 138

Certificate authorities

  • It should be clear that the “creator” of a public key certificate plays an extremely important role.
  • A creator of a public key certificate is normally referred to as a Certificate Authority (or CA).
  • The CA takes responsibility for ensuring that the information on a certificate is correct. The CA creates (or issues) the public key certificate to the owner.
  • Whenever anyone has need of the owner’s public key they request a copy of the public key certificate. The certificate might be made available on a central server, or the owner or even the CA might send the certificate to whoever requires it.
  • The recipient of the public key certificate checks that the certificate is in order, and if they are happy with it then they are free to use the public key contained in the certificate.

101 of 138

Certificate Authority Contd….

  • .

Signer

PUBLIC KEY

PRIVATE KEY

Certificate Authority

PUBLIC KEY

CA Certificate

Request

Certificate

Issue

Plaintext

Plaintext

Sign

(Private Key)

Signature

+

Signature

+

Verify?

Step 1

Step 2

Step 3

Step 5

Step 6

Step 4

This is signer’s

public key

Isl Certificate Authority

102 of 138

Certificate Authority Contd…

  • Step 1: Signer creates its own public key and private key.

  • Step 2: Signer requests certificate from certification authority (CA).

  • Step 3: CA issues a certificate of signer’s public key, signed by CA’s private key.

  • Step 4: Singer uses one-way hash function to create message digest from plaintext (Step 1 from figure) and encrypts message digest with private key to create signature (Step 2 from Figure).

  • Step 5: Signer sends plaintext and signature to recipient (Step 3 from figure).

  • Step 6: Recipient uses one-way hash function to create message digest from plaintext (Step 4 from Figure), decrypts signature with public key to create message digest (Step 5 from Figure), and compares the two message digests (Step 6 from Diagram).

103 of 138

Key Management

  • public-key encryption helps address key distribution problems
  • have two aspects of this:
    • distribution of public keys
    • use of public-key encryption to distribute secret keys

104 of 138

Distribution of Public Keys

  • can be considered as using one of:
    • public announcement
    • publicly available directory
    • public-key authority
    • public-key certificates

105 of 138

Public Announcement

  • users distribute public keys to recipients or broadcast to community at large
    • eg. append PGP keys to email messages or post to news groups or email list
  • major weakness is forgery
    • anyone can create a key claiming to be someone else and broadcast it
    • until forgery is discovered can masquerade as claimed user

106 of 138

Public Announcement

107 of 138

Publicly Available Directory

  • can obtain greater security by registering keys with a public directory
  • directory must be trusted with properties:
    • contains {name,public-key} entries
    • participants register securely with directory
    • participants can replace key at any time
    • directory is periodically published
    • directory can be accessed electronically
  • still vulnerable to tampering or forgery

108 of 138

Publicly Available Directory

109 of 138

Public-Key Authority

  • improve security by tightening control over distribution of keys from directory
  • has properties of directory
  • and requires users to know public key for the directory
  • then users interact with directory to obtain any desired public key securely
    • does require real-time access to directory when keys are needed

110 of 138

Public-Key Authority

111 of 138

Public-Key Certificates

  • certificates allow key exchange without real-time access to public-key authority
  • a certificate binds identity to public key
    • usually with other info such as period of validity, rights of use etc
  • with all contents signed by a trusted Public-Key or Certificate Authority (CA)
  • can be verified by anyone who knows the public-key authorities public-key

112 of 138

Public-Key Certificates

113 of 138

Kerberos

  • Provides a centralized authentication server to authenticate users to servers and servers to users.
  • Relies on conventional encryption, making no use of public-key encryption
  • Two versions: version 4 and 5
  • Version 4 makes use of DES
  • trusted key server system from MIT
  • Kerberos is more secure than other authentication methods because it does not send plain text pass- words over the network and instead uses encrypted tickets.

114 of 138

Kerberos Requirements

  • its first report identified requirements as:
    • Secure(Strong)
    • Reliable(highly reliable)
    • Transparent(the user should not be aware that authentication is taking place, not beyond the password)
    • Scalable(capable of supporting large no of clients and servers)
  • implemented using an authentication protocol based on Needham-Schroeder

115 of 138

Kerberos terminology

  • Terms:
    • C = client
    • AS = authentication server
    • V = server
    • IDc = identifier of user on C
    • IDv = identifier of V
    • Pc = password of user on C
    • ADc = network address of C
    • Kv = secret encryption key shared by AS an V
    • TS = timestamp
    • || = concatenation

116 of 138

A simple Authentication Dialogue

  1. C 🡲 AS: IDc || Pc || IDv
  2. AS 🡲 C: Ticket
  3. C 🡲 V: IDc || Ticket

Ticket = EKv[IDc || Pc || IDv]

117 of 138

Problems with the simple dialogue

  • Password in clear text
    • Solution: Encrypt the password
  • Need to authenticate on each request
    • Solution: Let a ticket have a lifetime
  • Need to authenticate to each new server
    • Solution: Split the Kerberos server up in two parts, one Authentication Server (AS) and one Ticket Granting Server (TGS

118 of 138

A better Authentication Dialogue

  • .

Once per user logon session:

(1) C 🡲 AS: IDc || IDtgs

(2) AS 🡲 C: E [Kc , Tickettgs]

Tickettgs =E(Ktgs, [IDc || ADc || IDtgs || TS1 || Lifetime1])

Once per type of service:

(3) C 🡲 TGS: IDc || IDv ||Tickettgs

  1. TGS 🡲 C: Ticketv

Ticketv =E(Kv, [IDc || ADc || IDv || TS2 || Lifetime2])

Once per server session:

(5) C 🡲 V: IDc || Ticketv

119 of 138

Problems with the better dialogue

  • Problem 1, Lifetime associated with the ticket-granting ticket
    • If too short 🡲 repeatedly asked for password
    • If too long 🡲 greater opportunity to replay

The threat is that an opponent will steal the ticket and use it before it expires.

  • Problem 2, a rouge server can give incorrect credentials

120 of 138

Version 4 Authentication Dialogue

Authentication Service Exchange: To obtain Ticket-Granting Ticket

(1) C 🡲 AS: IDc || IDtgs ||TS1

(2) AS 🡲 C: EKc [Kc,tgs|| IDtgs || TS2 || Lifetime2 || Tickettgs]

Tickettgs =E(Ktgs, [Kc,tgs || IDc || ADc || IDtgs || TS2 || Lifetime2])

Ticket-Granting Service Echange: To obtain Service-Granting Ticket

(3) C 🡲 TGS: IDv ||Tickettgs ||Authenticatorc

  1. TGS 🡲 C: E(Kc,tgs,[Kc,v || IDv || TS4 || Ticketv])

Tickettgs =E(Ktgs, [Kc,tgs || IDc || ADc || IDtgs || TS2 || Lifetime2])

Ticketv =E(Kv, [Kc,v || IDc || ADc || IDv || TS4 || Lifetime4])

Authenticatorc =E(Kc,tgs , [IDc || ADc || TS3])

121 of 138

Version 4 Authentication Dialogue

  • Client/Server Authentication Exchange to obtain Service
  • (5) C 🡲 V: Ticketv || Authenticatorc
  • V 🡲 C: EKc,v[TS5 +1]
  • Ticketv =E(Kv, [Kc,v || IDc || ADc || IDv || TS4 || Lifetime4])
  • Authenticatorc =E(Kc,v , [IDc || ADc || TS5])

122 of 138

Kerberos v4 Overview

  • a basic third-party authentication scheme
  • have an Authentication Server (AS)
    • users initially negotiate with AS to identify self
    • AS provides a non-corruptible authentication credential (ticket granting ticket TGT)
  • have a Ticket Granting server (TGS)
    • users subsequently request access to other services from TGS on basis of users TGT

123 of 138

Kerberos v4 Overview

124 of 138

Kerberos Realms

  • a Kerberos environment consists of:
    • a Kerberos server
    • a number of clients, all registered with server
    • application servers, sharing keys with server
  • this is termed a realm
    • typically a single administrative domain
  • if have multiple realms, their Kerberos servers must share keys and trust

125 of 138

Kerberos Realms

126 of 138

Kerberos Version 5

  • developed in mid 1990’s
  • specified as Internet standard RFC 1510
  • provides improvements over v4
    • addresses environmental shortcomings
      • encryption algorithm, network protocol, byte order, ticket lifetime, authentication forwarding, inter realm authentication.
    • and technical deficiencies
      • double encryption, PCBC encryption, session keys, password attacks

127 of 138

.

128 of 138

Difference Between Version 4 and 5

  • Encryption system independence (v4 DES)
  • Internet protocol independence (v4 IP)
  • Message byte ordering (v5 ASN.1)
  • Ticket lifetime (v4 max 21 hours)
  • Authentication forwarding
  • Inter realm authentication

129 of 138

X.509 Authentication Service

  • Distributed set of servers that maintains a database about users.
  • Each certificate contains the public key of a user and is signed with the private key of a CA.
  • Is used in e.g. S/MIME, IP Security, SSL/TLS and SET.
  • RSA is recommended to use

130 of 138

X.509 Certificates

131 of 138

X.509 Certificates Contd...

132 of 138

X.509 Certificates

  • Issued by a certification authority (CA), containing:
    • version (1, 2, or 3)
    • serial number (unique within CA) identifying certificate
    • signature algorithm identifier
    • issuer X.500 name (CA)
    • period of validity (from - to dates)
    • subject (name of owner)
    • subject public-key info (algorithm, parameters, key)
    • issuer unique identifier (v2+)
    • subject unique identifier (v2+)
    • extension fields (v3)
    • signature (of hash of all fields in certificate)
  • Notation CA<<A>> denotes certificate for a signed by CA

133 of 138

Obtaining a Certificate

  • any user with access to CA can get any certificate from it
  • only the CA can modify a certificate
  • certificates can be placed in a public directory

134 of 138

CA Hierarchy Use

135 of 138

CA Hierarchy

  • if both users share a common CA then they are assumed to know its public key
  • otherwise CA's must form a hierarchy
  • use certificates linking members of hierarchy to validate other CA's
    • each CA has certificates for clients (forward) and parent (backward)
  • each client trusts parents certificates
  • enable verification of any certificate from one CA by users of all other CAs in hierarchy

136 of 138

Certificate Revocation

  • certificates have a period of validity
  • may need to revoke before expiry, eg:
  • CA’s maintain list of revoked certificates
    • the Certificate Revocation List (CRL)
  • users should check certificates with CA’s CRL

137 of 138

X.509 Version 3

  • has been recognised that additional information is needed in a certificate
    • email/URL, policy details, usage constraints
  • rather than explicitly naming new fields defined a general extension method
  • extensions consist of:
    • extension identifier
    • criticality indicator
    • extension value

138 of 138

Certificate Extensions

  • key and policy information
    • convey info about subject & issuer keys, plus indicators of certificate policy
  • certificate subject and issuer attributes
    • support alternative names, in alternative formats for certificate subject and/or issuer
  • certificate path constraints
    • allow constraints on use of certificates by other CA’s