Security of Pseudo-Random Number Generators With Input Damien - - PowerPoint PPT Presentation

security of pseudo random number generators with input
SMART_READER_LITE
LIVE PREVIEW

Security of Pseudo-Random Number Generators With Input Damien - - PowerPoint PPT Presentation

Security of Pseudo-Random Number Generators With Input Damien Vergnaud cole normale suprieure INRIA PSL wr0ng April, 30th 2017 (with Yevgeniy Dodis, David Pointcheval, Sylvain Ruhault & Daniel Wichs) Damien Vergnaud (ENS)


slide-1
SLIDE 1

Security of Pseudo-Random Number Generators With Input

Damien Vergnaud

École normale supérieure – INRIA – PSL

wr0ng April, 30th 2017

(with Yevgeniy Dodis, David Pointcheval, Sylvain Ruhault & Daniel Wichs)

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 1 / 36

slide-2
SLIDE 2

About this Talk

examine randomness generation for cryptography give

◮ security definitions ◮ a construction meeting the formalized requirements.

analyze

◮ a previous construction proposed by Barak and Halevi in 2005 ◮ Linux random generators /dev/random and /dev/urandom Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 2 / 36

slide-3
SLIDE 3

Contents

1

Pseudorandom Generators

2

Security Models Barak-Halevi Security Model Dodis et al. Security Model On the Security of Barak-Halevi Construction

3

A Provably Secure Construction

4

Linux PRNG /dev/random and /dev/urandom

5

Conclusion

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 3 / 36

slide-4
SLIDE 4

True Random Number Generators

Natural randomness in real world previous talks Find a regular but random event and monitor but, need special hardware to do this but, often slow but, problems of bias or uneven distribution

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 4 / 36

slide-5
SLIDE 5

True Random Number Generators

Natural randomness in real world previous talks Find a regular but random event and monitor but, need special hardware to do this but, often slow but, problems of bias or uneven distribution

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 4 / 36

slide-6
SLIDE 6

Random Sources and Extractors

What kinds of random sources are useful ?

◮ impredictable must have sufficient entropy ◮ in cryptography: use min-entropy:

H∞(X) = min

x

$

←X

{− log Pr[X = x]}

Build deterministic extractor ?

◮ f : {0, 1}n → {0, 1},

s.t. for X over {0, 1}n with H∞(X) ≥ n − 1, Pr[f(X) = 0] = 1/2

◮ cannot exist

Randomness extractors

◮ use a small family of functions ◮ parametrized by a seed ◮ in cryptography: public or private ? Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 5 / 36

slide-7
SLIDE 7

Random Sources and Extractors

What kinds of random sources are useful ?

◮ impredictable must have sufficient entropy ◮ in cryptography: use min-entropy:

H∞(X) = min

x

$

←X

{− log Pr[X = x]}

Build deterministic extractor ?

◮ f : {0, 1}n → {0, 1},

s.t. for X over {0, 1}n with H∞(X) ≥ n − 1, Pr[f(X) = 0] = 1/2

◮ cannot exist

Randomness extractors

◮ use a small family of functions ◮ parametrized by a seed ◮ in cryptography: public or private ? Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 5 / 36

slide-8
SLIDE 8

Random Sources and Extractors

What kinds of random sources are useful ?

◮ impredictable must have sufficient entropy ◮ in cryptography: use min-entropy:

H∞(X) = min

x

$

←X

{− log Pr[X = x]}

Build deterministic extractor ?

◮ f : {0, 1}n → {0, 1},

s.t. for X over {0, 1}n with H∞(X) ≥ n − 1, Pr[f(X) = 0] = 1/2

◮ cannot exist

Randomness extractors

◮ use a small family of functions ◮ parametrized by a seed ◮ in cryptography: public or private ? Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 5 / 36

slide-9
SLIDE 9

(Deterministic) Pseudorandom Number Generators

0110100100101001010110010

  • 01100010111101001010101111110101111010000101110. . .
  • utput determined by a secret initial value
  • utput approximates the properties of random numbers

fast and reproducible

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 6 / 36

slide-10
SLIDE 10

Security of a PRNG

  • 0110001011110100101010111111010111101000010111. . .

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 7 / 36

slide-11
SLIDE 11

Security of a PRNG

  • 0110001011110100101010111111010111101000010111. . .

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 7 / 36

slide-12
SLIDE 12

Security of a PRNG

  • 0110001011110100101010111111010111101000010111. . .

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 7 / 36

slide-13
SLIDE 13

Security of a PRNG

  • 0110001011110100101010111111010111101000010111. . .

What if the key is compromised ?

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 7 / 36

slide-14
SLIDE 14

Pseudorandom Number Generators with Inputs

0110100100101001010110010

  • 01100010111101001010101111110101111010000101110. . .

Examples:

◮ Linux RNG : /dev/random, Yarrow, Fortuna, Havege, . . . Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 8 / 36

slide-15
SLIDE 15

Pseudorandom Number Generators with Inputs

0110100100101001010110010

  • 01100010111101001010101111110101111010000101110. . .

Examples:

◮ Linux RNG : /dev/random, Yarrow, Fortuna, Havege, . . . Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 8 / 36

slide-16
SLIDE 16

Expected Security Properties

Resilience: output looks random w/o knowledge of internal state

◮ Unknown/Known/Chosen input attacks

Security After State Compromise

◮ Forward security:

earlier output looks random with knowledge of current state

◮ Backward security:

future output looks random with knowledge of current state

How to formalize these security notions ?

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 9 / 36

slide-17
SLIDE 17

Expected Security Properties

Resilience: output looks random w/o knowledge of internal state

◮ Unknown/Known/Chosen input attacks

Security After State Compromise

◮ Forward security:

earlier output looks random with knowledge of current state

◮ Backward security:

future output looks random with knowledge of current state

How to formalize these security notions ?

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 9 / 36

slide-18
SLIDE 18

Expected Security Properties

Resilience: output looks random w/o knowledge of internal state

◮ Unknown/Known/Chosen input attacks

Security After State Compromise

◮ Forward security:

earlier output looks random with knowledge of current state

◮ Backward security:

future output looks random with knowledge of current state

How to formalize these security notions ?

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 9 / 36

slide-19
SLIDE 19

Contents

1

Pseudorandom Generators

2

Security Models Barak-Halevi Security Model Dodis et al. Security Model On the Security of Barak-Halevi Construction

3

A Provably Secure Construction

4

Linux PRNG /dev/random and /dev/urandom

5

Conclusion

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 10 / 36

slide-20
SLIDE 20

Barak-Halevi Security Model (2005)

G = (refresh, next) is a PRNG with input

◮ refresh(S, I) = S′ ∈ {0, 1}n. ◮ next(S) = (S′, R) ∈ {0, 1}n × {0, 1}ℓ

Security notion: Robustness

G1 proc. good-refresh(D)

  • proc. bad-refresh(x) proc. set-state(S′) proc. next-ror()

x

$

← D S ← refresh(S, x) OUTPUT S (R, S′) ← next(S) S ← refresh(S, x) S ← S′ S ← S′ OUTPUT R G2 proc. good-refresh(D) proc. bad-refresh(x) proc. set-state(S′)

  • proc. next-ror()

x

$

← D S ← refresh(S, x) IF corrupt (R, S′) ← next(S) S ← refresh(S, x) OUTPUT S S ← S′ corrupt ← false ELSE IF corrupt OUTPUT

$

← {0, 1}m OUTPUT R S ← S′ ELSE corrupt ← true OUTPUT

$

← {0, 1}ℓ

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 11 / 36

slide-21
SLIDE 21

Barak-Halevi Security Model (2005)

G = (refresh, next) is a PRNG with input

◮ refresh(S, I) = S′ ∈ {0, 1}n. ◮ next(S) = (S′, R) ∈ {0, 1}n × {0, 1}ℓ

Security notion: Robustness

G1 proc. good-refresh(D)

  • proc. bad-refresh(x) proc. set-state(S′) proc. next-ror()

x

$

← D S ← refresh(S, x) OUTPUT S (R, S′) ← next(S) S ← refresh(S, x) S ← S′ S ← S′ OUTPUT R G2 proc. good-refresh(D) proc. bad-refresh(x) proc. set-state(S′)

  • proc. next-ror()

x

$

← D S ← refresh(S, x) IF corrupt (R, S′) ← next(S) S ← refresh(S, x) OUTPUT S S ← S′ corrupt ← false ELSE IF corrupt OUTPUT

$

← {0, 1}m OUTPUT R S ← S′ ELSE corrupt ← true OUTPUT

$

← {0, 1}ℓ

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 11 / 36

slide-22
SLIDE 22

Defects in Barak-Halevi Model

Entropy accumulation null or high entropy inputs, but, entropy could be accumulated slowly in S. a PRNG should recover from state compromise (if the amount of accumulated entropy crosses some threshold) Need for a setup procedure deterministic randomness extractors do not exist! Two options:

◮ restrict the family of permitted high-entropy distributions. ◮ add a setup procedure which outputs some public parameters

(used by next and refresh)

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 12 / 36

slide-23
SLIDE 23

Defects in Barak-Halevi Model

Entropy accumulation null or high entropy inputs, but, entropy could be accumulated slowly in S. a PRNG should recover from state compromise (if the amount of accumulated entropy crosses some threshold) Need for a setup procedure deterministic randomness extractors do not exist! Two options:

◮ restrict the family of permitted high-entropy distributions. ◮ add a setup procedure which outputs some public parameters

(used by next and refresh)

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 12 / 36

slide-24
SLIDE 24

Defects in Barak-Halevi Model

State Pseudorandomness BH model ensures that S is indistinguishable from random But technical parameters do not need to be random (e.g. Linux contains (predictable) entropy estimators). Pseudorandomness of the state is not actually a requirement Only pseudorandomness of the output is !

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 13 / 36

slide-25
SLIDE 25

New Model Description

G = (setup, refresh, next) is a PRNG with input

◮ setup output public parameters seed ◮ refresh(S, I) = S′ ∈ {0, 1}n. ◮ next(S) = (S′, R) ∈ {0, 1}n × {0, 1}ℓ

Adversary divided into two parts (A, D) D : σ → (σ′, I, γ, z) is a legitimate distribution sampler

◮ σ = state of D. ◮ I = next input for refresh ◮ γ = entropy estimation of I ◮ z = leakage about I given to A ◮ H∞(Ij | I1, . . . , Ij−1, Ij+1, . . . , IqD, z1, . . . , zqD, γ1, . . . , γqD) ≥ γj

seed is not passed to D but is given to A

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 14 / 36

slide-26
SLIDE 26

Security Games

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

  • proc. get-state

c ← 0, corrupt ← true OUTPUT S

  • proc. set-state(S∗)

c ← 0, corrupt ← true S ← S∗

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 15 / 36

slide-27
SLIDE 27

Security Games

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

  • proc. get-state

c ← 0, corrupt ← true OUTPUT S

  • proc. set-state(S∗)

c ← 0, corrupt ← true S ← S∗

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 15 / 36

slide-28
SLIDE 28

Resilience

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 16 / 36

slide-29
SLIDE 29

Backward Security

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

  • proc. set-state(S∗) (single first call)

c ← 0, corrupt ← true S ← S∗

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 17 / 36

slide-30
SLIDE 30

Forward Security

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

  • proc. get-state (single last call)

c ← 0, corrupt ← true OUTPUT S

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 18 / 36

slide-31
SLIDE 31

Robustness

  • proc. initialize

seed

$

← setup; σ ← 0; S

$

← {0, 1}n; c ← n; corrupt ← false; b

$

← {0, 1} OUTPUT seed

  • proc. finalize(b∗)

IF b = b∗ RETURN 1 ELSE RETURN 0

  • proc. D-refresh

(σ, I, γ, z)

$

← D(σ) S ← refresh(S, I) c ← c + γ IF c ≥ γ∗, corrupt ← false OUTPUT (γ, z)

  • proc. next-ror

(S, R0) ← next(S) R1

$

← {0, 1}ℓ IF corrupt = true, c ← 0, RETURN R0 ELSE RETURN Rb

  • proc. get-next

(S, R) ← next(S) IF corrupt = true, c ← 0 OUTPUT R

  • proc. get-state

c ← 0, corrupt ← true OUTPUT S

  • proc. set-state(S∗)

c ← 0, corrupt ← true S ← S∗

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 19 / 36

slide-32
SLIDE 32

Barak-Halevi Construction

Extract : {0, 1}p − → {0, 1}n a randomness extractor G : {0, 1}n − → {0, 1}n+ℓ a (deterministic) PRNG

Barak-Halevi Construction

refresh(S, I) = [G(S ⊕ Extract(I))]n

1

next(S) = G(S) robust in BH model

Simplified Barak-Halevi Construction

refresh(S, I) = S ⊕ Extract(I) next(S) = G(S) robust in BH model (if one drops state pseudorandomness)

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 20 / 36

slide-33
SLIDE 33

Barak-Halevi Construction

Extract : {0, 1}p − → {0, 1}n a randomness extractor G : {0, 1}n − → {0, 1}n+ℓ a (deterministic) PRNG

Barak-Halevi Construction

refresh(S, I) = [G(S ⊕ Extract(I))]n

1

next(S) = G(S) robust in BH model

Simplified Barak-Halevi Construction

refresh(S, I) = S ⊕ Extract(I) next(S) = G(S) robust in BH model (if one drops state pseudorandomness)

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 20 / 36

slide-34
SLIDE 34

Barak-Halevi Construction

Simplified Barak-Halevi Construction

refresh(S, I) = S ⊕ Extract(I) next(S) = G(S) robust in BH model (if one drops state pseudorandomness) but, does not accumulate entropy! is not backward secure in [DPRVW13] model D : σ = ∅ → (σ′, I, γ, z) = (∅, bp, 1, ∅) with b

$

← {0, 1} is a (stateless) legitimate distribution sampler A

◮ calls set-state(0n) (S0 = 0n), ◮ makes γ∗ calls to D-refresh (Sj = D-refresh(Sj−1, bp)) ◮ makes many calls to next-ror.

Y(b) = Extract(bp) S2j ∈ {0n, Y(0) ⊕ Y(1)} and S2j+1 ∈ {Y(0), Y(1)}

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 21 / 36

slide-35
SLIDE 35

Barak-Halevi Construction

Simplified Barak-Halevi Construction

refresh(S, I) = S ⊕ Extract(I) next(S) = G(S) robust in BH model (if one drops state pseudorandomness) but, does not accumulate entropy! is not backward secure in [DPRVW13] model D : σ = ∅ → (σ′, I, γ, z) = (∅, bp, 1, ∅) with b

$

← {0, 1} is a (stateless) legitimate distribution sampler A

◮ calls set-state(0n) (S0 = 0n), ◮ makes γ∗ calls to D-refresh (Sj = D-refresh(Sj−1, bp)) ◮ makes many calls to next-ror.

Y(b) = Extract(bp) S2j ∈ {0n, Y(0) ⊕ Y(1)} and S2j+1 ∈ {Y(0), Y(1)}

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 21 / 36

slide-36
SLIDE 36

Contents

1

Pseudorandom Generators

2

Security Models Barak-Halevi Security Model Dodis et al. Security Model On the Security of Barak-Halevi Construction

3

A Provably Secure Construction

4

Linux PRNG /dev/random and /dev/urandom

5

Conclusion

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 22 / 36

slide-37
SLIDE 37

A Provably Secure Construction

G : {0, 1}m − → {0, 1}n+ℓ a (deterministic) PRNG

Construction

setup(·) = seed = (X, X ′)

$

← {0, 1}2n. refresh(S, I) = S · X + I ∈ F2n. next(S) = G([X ′ · S]m

1 ).

it preserves security it accumulates entropy robust in [DPRVW13] model !

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 23 / 36

slide-38
SLIDE 38

A Provably Secure Construction

Lemma 1

This construction preserves security. if the state S0 starts uniformly random and uncompromised, and is refreshed with (adversarial) samples I1, . . . , Id Sd, (S′, R) = next(Sd) then R looks indistinguishable from uniform Proof. Sd := S · X d + Id−1 · X d−1 + · · · + I1 · X + I0.

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 24 / 36

slide-39
SLIDE 39

A Provably Secure Construction

Lemma 1

This construction preserves security. if the state S0 starts uniformly random and uncompromised, and is refreshed with (adversarial) samples I1, . . . , Id Sd, (S′, R) = next(Sd) then R looks indistinguishable from uniform Proof. Sd := S · X d + Id−1 · X d−1 + · · · + I1 · X + I0.

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 24 / 36

slide-40
SLIDE 40

A Provably Secure Construction

Lemma 2

This construction accumulates entropy. if the state S0 starts is compromised to some arbitrary value and is refreshed with D-refresh samples I1, . . . , Id Sd, (S′, R) = next(Sd) then R looks indistinguishable from uniform Proof. h∗

X,X ′(¯

I) :=  X ′ ·

d−1

  • j=0

Ij · X j  

m 1

. is 2−m(1 + d · 2m−n)-universal.

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 25 / 36

slide-41
SLIDE 41

A Provably Secure Construction

Lemma 2

This construction accumulates entropy. if the state S0 starts is compromised to some arbitrary value and is refreshed with D-refresh samples I1, . . . , Id Sd, (S′, R) = next(Sd) then R looks indistinguishable from uniform Proof. h∗

X,X ′(¯

I) :=  X ′ ·

d−1

  • j=0

Ij · X j  

m 1

. is 2−m(1 + d · 2m−n)-universal.

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 25 / 36

slide-42
SLIDE 42

Contents

1

Pseudorandom Generators

2

Security Models Barak-Halevi Security Model Dodis et al. Security Model On the Security of Barak-Halevi Construction

3

A Provably Secure Construction

4

Linux PRNG /dev/random and /dev/urandom

5

Conclusion

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 26 / 36

slide-43
SLIDE 43

The Linux Random Number Generator

part of the Linux kernel since 1994 from Theodore Ts’o and Matt Mackall

  • nly definition in the code (with comments) :

◮ About 1700 lines

Previous Analysis:

◮ Barak-Halevi, 2005: almost no mentioning of the Linux RNG ◮ Gutterman-Pinkas-Reinman, 2006: some weaknesses ◮ Lacharme-Röck-Strubel-Videau, 2012: detailed description

Two different versions :

◮ /dev/random: limits the number of bits by the estimated entropy ◮ /dev/urandom: generates as many bits as the user asks for Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 27 / 36

slide-44
SLIDE 44

The Linux Random Number Generator

part of the Linux kernel since 1994 from Theodore Ts’o and Matt Mackall

  • nly definition in the code (with comments) :

◮ About 1700 lines

Previous Analysis:

◮ Barak-Halevi, 2005: almost no mentioning of the Linux RNG ◮ Gutterman-Pinkas-Reinman, 2006: some weaknesses ◮ Lacharme-Röck-Strubel-Videau, 2012: detailed description

Two different versions :

◮ /dev/random: limits the number of bits by the estimated entropy ◮ /dev/urandom: generates as many bits as the user asks for Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 27 / 36

slide-45
SLIDE 45

General Overview of LINUX PRNG

dev/urandom dev/random Non Blocking Ouput Pool Blocking Ouput Pool Input Pool Input

|I| = 96, |S| = 6144, |R| = 80 refresh and next uses a Mixing function and a Hash function all transfers between pools rely on Entropy Estimators

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 28 / 36

slide-46
SLIDE 46

dev/urandom Output Request

Input Pool dev/urandom

Is there enough entropy in Non Blocking Output Pool ?

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 29 / 36

slide-47
SLIDE 47

dev/urandom Output Request

Input Pool 00110101101

Is there enough entropy in output pool ? Yes, output the requested bytes !

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 29 / 36

slide-48
SLIDE 48

dev/urandom Output Request

dev/urandom

Is there enough entropy in output pool ? No, ask the input pool !

◮ Is there enough entropy in input pool ? Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 29 / 36

slide-49
SLIDE 49

dev/urandom Output Request

00110101101

Is there enough entropy in output pool ? No, ask the input pool !

◮ Is there enough entropy in input pool ? ◮ Yes, transfer from input pool to output pool and generate! Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 29 / 36

slide-50
SLIDE 50

dev/urandom Output Request

0011010110

Is there enough entropy in output pool ? No, ask the input pool !

◮ Is there enough entropy in input pool ? ◮ No, generate output anyway ! Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 29 / 36

slide-51
SLIDE 51

Difference with dev/random

dev/random

Is there enough entropy in output pool ? No, ask the input pool !

◮ Is there enough entropy in input pool ? ◮ No, do not generate output and wait ! Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 30 / 36

slide-52
SLIDE 52

Defects of LINUX PRNG

if input pool contains enough entropy, don’t refresh (before [DPRVW13]) there exists D0, H∞(D0) = 0, that LINUX estimates high there exists D1, H∞(D1) = 64, that LINUX estimates 0 there exists D2, H∞(D2) = 1, for which LINUX does not accumulate

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 31 / 36

slide-53
SLIDE 53

dev/random was not Robust

first step : get-state

D-refresh with D0 (H∞ = 0), until input pool is full D-refresh with D1 (H∞ = 64), which are ignored next: H∞(R) = 0 0011010110

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 32 / 36

slide-54
SLIDE 54

dev/urandom was not Robust

first step : get-state

D-refresh with D1 (H∞ = 64), which are not transfered next : H∞(R) = 0 0011010110

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 33 / 36

slide-55
SLIDE 55

Contents

1

Pseudorandom Generators

2

Security Models Barak-Halevi Security Model Dodis et al. Security Model On the Security of Barak-Halevi Construction

3

A Provably Secure Construction

4

Linux PRNG /dev/random and /dev/urandom

5

Conclusion

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 34 / 36

slide-56
SLIDE 56

Follow-up Works

Other Attacks (Cornejo-Ruhault – ACM CCS 2014) Security against Premature Next (Dodis, Shamir, Stephens-Davidowitz, Wichs – Crypto 2014) Analysis of Intel’s Secure Key RNG (Shrimpton, Terashima – Eurocrypt 2015) Backdoored PRNGs (Degabriele, Paterson, Schuldt, Woodage – Crypto 2016) Kenny’s talk . . . Sponge-Based PRNGs (Gaži, Tessaro – Eurocrypt 2016) see next talk . . .

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 35 / 36

slide-57
SLIDE 57

Conclusion

Generation of random numbers is too important to be left to chance . . . Analysis of BH model and construction. DPRVW13 security model for PRNG with input. Attacks on LINUX PRNGs

◮ using entropy estimator ◮ using mixing function (see paper)

Construction provably secure and efficient.

Damien Vergnaud (ENS) Security of PRNG with Input April, 30th 2017 36 / 36