๐ŸŽ‰ ไปŽ330่ฝฌไธบWashUๅธฎๅŠฉๆ‰‹ๅ†Œๅ•ฆ!

CSE442
ๆจกๅ—
Cse442t L18

Lecture 18

Chapter 5: Authentication

5.1 Introduction

Signatures

private key

Alice and Bob share a secret key kk.

Message Authentication Codes (MACs)

public key

Any one can verify the signature.

Digital Signatures

Definitions 134.1

A message authentication codes (MACs) is a triple (Gen,Tag,Ver)(Gen, Tag, Ver) where

  • kโ†Gen(1k)k\gets Gen(1^k) is a p.p.t. algorithm that takes as input a security parameter kk and outputs a key kk.
  • ฯƒโ†Tagk(m)\sigma\gets Tag_k(m) is a p.p.t. algorithm that takes as input a key kk and a message mm and outputs a tag ฯƒ\sigma.
  • Verk(m,ฯƒ)Ver_k(m, \sigma) is a deterministic algorithm that takes as input a key kk, a message mm, and a tag ฯƒ\sigma and outputs "Accept" if ฯƒ\sigma is a valid tag for mm under kk and "Reject" otherwise.

For all nโˆˆNn\in\mathbb{N}, all mโˆˆMnm\in\mathcal{M}_n.

P[kโ†Gen(1k):Verk(m,Tagk(m))=โ€œAcceptโ€]=1P[k\gets Gen(1^k):Ver_k(m, Tag_k(m))=\textup {``Accept''}]=1

Definition 134.2 (Security of MACs)

Security: Prevent an adversary from producing any accepted (m,ฯƒ)(m, \sigma) pair that they haven't seen before.

  • Assume they have seen some history of signed messages. (m1,ฯƒ1),(m2,ฯƒ2),โ€ฆ,(mq,ฯƒq)(m_1, \sigma_1), (m_2, \sigma_2), \ldots, (m_q, \sigma_q).
  • Adversary A\mathcal{A} has oracle access to TagkTag_k. Goal is to produce a new (m,ฯƒ)(m, \sigma) pair that is accepted but none of (m1,ฯƒ1),(m2,ฯƒ2),โ€ฆ,(mq,ฯƒq)(m_1, \sigma_1), (m_2, \sigma_2), \ldots, (m_q, \sigma_q).

โˆ€\forall n.u.p.p.t. adversary A\mathcal{A} with oracle access to Tagk(โ‹…)Tag_k(\cdot),

Prโก[kโ†Gen(1k);(m,ฯƒ)โ†ATagk(โ‹…)(1k);Aย didย notย queryย mย andย Verk(m,ฯƒ)=โ€œAcceptโ€]<ฯต(n)\Pr[k\gets Gen(1^k);(m, \sigma)\gets\mathcal{A}^{Tag_k(\cdot)}(1^k);\mathcal{A}\textup{ did not query }m \textup{ and } Ver_k(m, \sigma)=\textup{``Accept''}]<\epsilon(n)

MACs scheme

F={fs}F=\{f_s\} is a PRF family.

fs:{0,1}โˆฃSโˆฃโ†’{0,1}โˆฃSโˆฃf_s:\{0,1\}^{|S|}\to\{0,1\}^{|S|}

Gen(1k):sโ†{0,1}nGen(1^k): s\gets \{0,1\}^n

Tagk(m)Tag_k(m) outputs fs(m)f_s(m).

Vers(m,ฯƒ)Ver_s(m, \sigma) outputs "Accept" if fs(m)=ฯƒf_s(m)=\sigma and "Reject" otherwise.

Proof of security (Outline):

Suppose we used Fโ†RFnF\gets RF_n (true random function).

If A\mathcal{A} wants F(m)F(m) for mโˆˆ{m1,โ€ฆ,mq}m\in \{m_1, \ldots, m_q\}. F(m)โ†UnF(m)\gets U_n.

P[Fโ†RFn;(m,ฯƒ)โ†AF(โ‹…)(1k);Aย didย notย queryย mย andย Verk(m,ฯƒ)=โ€œAcceptโ€]=P[Fโ†RFn;(m,ฯƒ)โ†F(m)]=12n<ฯต(n)\begin{aligned} &P[F\gets RF_n; (m, \sigma)\gets\mathcal{A}^{F(\cdot)}(1^k);\mathcal{A}\textup{ did not query }m \textup{ and } Ver_k(m, \sigma)=\textup{``Accept''}]\\ &=P[F\gets RF_n; (m, \sigma)\gets F(m)]\\ &=\frac{1}{2^n}<\epsilon(n) \end{aligned}

Suppose an adversary A\mathcal{A} has 1p(n)\frac{1}{p(n)} chance of success with our PRF-based scheme...

This could be used to distinguish PRF fsf_s from a random function.

The distinguisher runs as follows:

  • Runs A(1n)\mathcal{A}(1^n)
  • Whenever A\mathcal{A} asks for Tagk(m)Tag_k(m), we ask our oracle for f(m)f(m)
  • (m,ฯƒ)โ†AF(โ‹…)(1n)(m, \sigma)\gets\mathcal{A}^{F(\cdot)}(1^n)
  • Query oracle for f(m)f(m)
  • If ฯƒ=f(m)\sigma=f(m), output 1
  • Otherwise, output 0

DD will output 1 for PRF with probability 1p(n)\frac{1}{p(n)} and for RF with probability 12n\frac{1}{2^n}.

Definition 135.1(Digital Signature D.S. over {Mn}n\{M_n\}_n)

A digital signature scheme is a triple (Gen,Sign,Ver)(Gen, Sign, Ver) where

  • (pk,sk)โ†Gen(1k)(pk,sk)\gets Gen(1^k) is a p.p.t. algorithm that takes as input a security parameter kk and outputs a public key pkpk and a secret key sksk.
  • ฯƒโ†Signsk(m)\sigma\gets Sign_{sk}(m) is a p.p.t. algorithm that takes as input a secret key sksk and a message mm and outputs a signature ฯƒ\sigma.
  • Verpk(m,ฯƒ)Ver_{pk}(m, \sigma) is a deterministic algorithm that takes as input a public key pkpk, a message mm, and a signature ฯƒ\sigma and outputs "Accept" if ฯƒ\sigma is a valid signature for mm under pkpk and "Reject" otherwise.

For all nโˆˆNn\in\mathbb{N}, all mโˆˆMnm\in\mathcal{M}_n.

P[(pk,sk)โ†Gen(1k);ฯƒโ†Signsk(m);Verpk(m,ฯƒ)=โ€œAcceptโ€]=1P[(pk,sk)\gets Gen(1^k); \sigma\gets Sign_{sk}(m); Ver_{pk}(m, \sigma)=\textup{``Accept''}]=1

Security of Digital Signature

Prโก[(pk,sk)โ†Gen(1k);(m,ฯƒ)โ†ASignsk(โ‹…)(1k);Aย didย notย queryย mย andย Verpk(m,ฯƒ)=โ€œAcceptโ€]<ฯต(n)\Pr[(pk,sk)\gets Gen(1^k); (m, \sigma)\gets\mathcal{A}^{Sign_{sk}(\cdot)}(1^k);\mathcal{A}\textup{ did not query }m \textup{ and } Ver_{pk}(m, \sigma)=\textup{``Accept''}]<\epsilon(n)

For all n.u.p.p.t. adversary A\mathcal{A} with oracle access to Signsk(โ‹…)Sign_{sk}(\cdot).

5.4 One time security: A\mathcal{A} can only use oracle once.

Output (m,ฯƒ)(m, \sigma) if mโ‰ mm\neq m

Security parameter nn

One time security on {0,1}n\{0,1\}^n

One time security on {0,1}โˆ—\{0,1\}^*

Regular security on {0,1}โˆ—\{0,1\}^*

Note: the adversary automatically has access to Verpk(โ‹…)Ver_{pk}(\cdot)

One time security scheme (Lamport Scheme on {0,1}n\{0,1\}^n)

Gen(1k)Gen(1^k): Zn\mathbb{Z}_n random n-bit string

sksk: List 0: x1ห‰0,x2ห‰0,โ€ฆ,xnห‰0\bar{x_1}^0, \bar{x_2}^0, \ldots, \bar{x_n}^0

List 1: x1ห‰1,x2ห‰1,โ€ฆ,xnห‰1\bar{x_1}^1, \bar{x_2}^1, \ldots, \bar{x_n}^1

All xiห‰jโˆˆ{0,1}n\bar{x_i}^j\in\{0,1\}^n

pkpk: For a strong one-way function ff

List 0: f(x1ห‰0),f(x2ห‰0),โ€ฆ,f(xnห‰0)f(\bar{x_1}^0), f(\bar{x_2}^0), \ldots, f(\bar{x_n}^0)

List 1: f(x1ห‰1),f(x2ห‰1),โ€ฆ,f(xnห‰1)f(\bar{x_1}^1), f(\bar{x_2}^1), \ldots, f(\bar{x_n}^1)

Signsk(m):(m1,m2,โ€ฆ,mn)โ†ฆ(x1ห‰m1,x2ห‰m2,โ€ฆ,xnห‰mn)Sign_{sk}(m):(m_1, m_2, \ldots, m_n)\mapsto(\bar{x_1}^{m_1}, \bar{x_2}^{m_2}, \ldots, \bar{x_n}^{m_n})

Verpk(m,ฯƒ)Ver_{pk}(m, \sigma): output "Accept" if ฯƒ\sigma is a prefix of f(m)f(m) and "Reject" otherwise.

Example: When we sign a message 0110001100, Signsk(01100)=(x1ห‰0,x2ห‰1,x3ห‰1,x4ห‰0,x5ห‰0)Sign_{sk}(01100)=(\bar{x_1}^0, \bar{x_2}^1, \bar{x_3}^1, \bar{x_4}^0, \bar{x_5}^0) We only reveal the x10,x21,x31,x40,x50x_1^0, x_2^1, x_3^1, x_4^0, x_5^0 For the second signature, we need to reveal exactly different bits.
The adversary can query the oracle for f(0n)f(0^n) (reveals list0) and f(1n)f(1^n) (reveals list1) to produce any valid signature they want.