GCM-SIV: Full Nonce Mis isuse-Resistant Authenticated Encry - - PowerPoint PPT Presentation

gcm siv
SMART_READER_LITE
LIVE PREVIEW

GCM-SIV: Full Nonce Mis isuse-Resistant Authenticated Encry - - PowerPoint PPT Presentation

` GCM-SIV: Full Nonce Mis isuse-Resistant Authenticated Encry ryption at t Under One Cycle per Byt yte Shay Gueron Yehuda Lindell Bar-Ilan University Haifa Univ. and Intel Appeared at ACM CCS 2015 ` How to Encry rypt wit ith a Blo


slide-1
SLIDE 1

`

GCM-SIV:

Full Nonce Mis isuse-Resistant Authenticated Encry ryption at t Under One Cycle per Byt yte

Shay Gueron

Haifa Univ. and Intel

Yehuda Lindell

Bar-Ilan University

Appeared at ACM CCS 2015

slide-2
SLIDE 2

`

How to Encry rypt wit ith a Blo lock Cip ipher

slide-3
SLIDE 3

`

CBC vs CT CTR

  • Efficiency:
  • CBC – encryption is strictly sequential
  • CTR – encryption can be parallelized
  • Does this matter?
  • The Intel AES-NI instruction is fully pipelineable
  • AES-CTR encryption with AES-NI is 7 times faster!
slide-4
SLIDE 4

`

CBC vs CT CTR

slide-5
SLIDE 5

`

CBC vs CT CTR – Security

  • Security bounds
  • CTR has better security bounds – the counter is a nonce

and security is preserved as long as it doesn’t repeat

  • CBC breaks at the birthday bound since ”random” values

are input to the block cipher

  • Integrity
  • CBC is harder to tamper with
  • IV/nonce reuse
  • CBC – reveals common prefix
  • CTR – completely broken
slide-6
SLIDE 6

`

IV IV/Nonce Reuse

slide-7
SLIDE 7

`

Why Should an IV IV Repeat?

  • Randomness is much harder than it should be
  • Intel has RDRAND and RDSEED on all new chips
  • Not used inside Linux /dev/random
slide-8
SLIDE 8

`

Bad Randomness

  • In 2008, a bug in Debian Linux was found
  • In 2006, code that was crucial for RNG reseeding was

commented out

slide-9
SLIDE 9

`

Bad Randomness

  • PlayStation 3
  • In 2010, the ECDSA private key used by Sony to sign

software for PlayStation 3 was recovered because Sony failed to generate a new random nonce for each signature

slide-10
SLIDE 10

`

RSA Keys – Lenstra et al. . 2012 2012

  • Collected 6.4 million RSA keys from the web
  • 71,052 occurred more than once
  • Different owners can decrypt each other’s traffic
  • Some of the moduli repeated thousands of times (no entropy)
  • 12,934 had a common factor
  • Computed 𝐻𝐷𝐸(𝑂, 𝑂’) where 𝑂 = 𝑞𝑟 and 𝑂’ = 𝑞’𝑟
  • Factor both moduli
  • We use this for entropy estimation
slide-11
SLIDE 11

`

Entropy Estimation via RSA Keys

  • The expected number of collisions in q samples

from a domain of size N is ൗ

𝒓 𝟑

𝑶 ≈

𝒓𝟑 𝟑𝑶

  • We have 𝒓 = 𝟐𝟑, 𝟗𝟏𝟏, 𝟏𝟏𝟏 (number of primes is

double)

  • We have number of collisions = 12,934
  • So,

𝟐𝟑,𝟗𝟏𝟏,𝟏𝟏𝟏𝟑 𝟑𝑶

= 𝟐𝟑, 𝟘𝟒𝟓 giving 𝑶 ≈ 𝟑𝟒𝟑.𝟔𝟕

  • Conclusion: an “average” of 33 bits of entropy
slide-12
SLIDE 12

`

Bad Randomness

  • Given that randomness can repeat and does

repeat, what should we do?

  • CBC still reveals common prefixes, but is better

than CTR…

  • Can we do better? Efficiently?
slide-13
SLIDE 13

`

What About Authenticated Encry ryption?

  • CCM:
  • CBC-MAC followed by CTR encryption: slow due to CBC-

MAC and vulnerable due to CTR encryption

  • GCM:
slide-14
SLIDE 14

`

What About Authenticated Encry ryption?

  • GCM – if the nonce repeats, then:
  • As with CTR plaintexts can be recovered
  • Much more seriously – H can be recovered
  • This means that integrity is lost forever!
slide-15
SLIDE 15

`

Preliminaries: : IV IV vs Nonce Encry ryption

  • IV (initial vector) encryption:
  • IV must be randomly chosen
  • Nonce-based encryption:
  • Only require that nonce is unique
  • CBC encryption: need random IV; nonce not good

enough

  • CTR encryption: suffices to have a unique nonce
  • In AES-CTR, use a nonce of length 96 bits and counter of

length 32 bits

slide-16
SLIDE 16

`

Nonce Misuse Resistance [Rogaway-Shrimpton]

  • Denote nonce by N
  • Security property
  • If N is same and message is same – the result is the

same ciphertext

  • This is inherent
  • Otherwise – full security (authenticated encryption):
  • Even if N is the same and the message is not
  • Even if N is different and the message the same
  • This cannot be achieved for online encryption
  • If two long messages differ only in the last bit, when

same N is used, must have same prefix in online

slide-17
SLIDE 17

`

Abstract SIV Encry ryption [Rogaway-Shrimpton]

  • Input: message 𝑁 and nonce 𝑂
  • Step 1:
  • Apply a PRF 𝐺 with key 𝐿1 to (𝑂, 𝑁); denote result by 𝑈
  • Step 2:
  • Encrypt 𝑁 with key 𝐿2 using nonce 𝑈; denote result by 𝐷
  • Output (𝑂, 𝑁, 𝑈)
  • Decryption: 𝑁 ← 𝐸𝑓𝑑𝐿2 𝐷 with nonce 𝑈; check

𝑈 = 𝐺𝐿1(𝑂, 𝑁)

slide-18
SLIDE 18

`

SIV Encry ryption Security

  • Encryption:

𝑈 = 𝐺𝐿1(𝑂, 𝑁); 𝐷 ← 𝐹𝑜𝑑𝐿2 𝑁 with nonce 𝑈

  • Security
  • If nonce 𝑂 is different, then by PRF the value 𝑈 is

pseudorandom

  • If nonce 𝑂 is the same but 𝑁 is different, then by PRF the

value 𝑈 is pseudorandom

  • The value 𝑈 also serves as a valid MAC and so have

authenticated encryption

slide-19
SLIDE 19

`

Efficient In Instantiations

  • Option 1 – apply a PRF based on AES
  • What PRFs do we have? CBC-MAC
  • Very expensive
  • Option 2 – construct a more efficient PRF using

simpler primitives

  • Let 𝐼 be an 𝜗-XOR universal hash function

∀𝑦, 𝑧, 𝑨 ∶ Pr 𝐼𝐿1 𝑦 ⊕ 𝐼𝐿1 𝑧 = 𝑨 ≤ 𝜗 𝑜

  • Claim: 𝐺𝐿1,𝐿2 𝑂, 𝑁 = 𝐺𝐿2 𝐼𝐿1 𝑁 ⊕ 𝑂 is a PRF
slide-20
SLIDE 20

`

Univ iversal-Hash Based PRF

  • The construction: 𝐺𝐿1,𝐿2 𝑂, 𝑁 = 𝐺𝐿2 𝐼𝐿1 𝑁 ⊕ 𝑂
  • Proof idea:
  • By the PRF property of 𝐺, can distinguish only if it queries

𝑂, 𝑁 , 𝑂′, 𝑁′ where 𝐼𝐿1 𝑁 ⊕ 𝑂 = 𝐼𝐿1 𝑁′ ⊕ 𝑂′

  • Equivalently: if 𝐼𝐿1 𝑁 ⊕ 𝐼𝐿1 𝑁′ = 𝑂 ⊕ 𝑂′
  • By the 𝜗-XOR property, this happens with probability only 𝜗

for each pair

  • Therefore, secure PRF for negligible 𝜗
slide-21
SLIDE 21

`

The GCM-SIV In Instantiation

  • The GHASH function H in GCM is an 𝜗-XOR

universal hash function (for negligible 𝜗) [McGrew-Viega]

  • The PRF used is AES (only need a single block)
  • Encryption is AES-CTR
  • Versions:
  • Three different keys (for GHASH, PRF, CTR-ENC)
  • Two keys: use same key for PRF and CTR-ENC
  • One key: derive the two keys using AES itself
slide-22
SLIDE 22

`

The GCM-SIV In Instantiation

  • A very important property: all the elements here

are identical to the existing AES-GCM

  • We only change the order of operations
  • Why is this important?
  • Efficiency
  • Deployment ease (use existing code bases)
slide-23
SLIDE 23

`

23

3.08 2.75 1.02 0.76 0.65

0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00

Pre AES-NI / PACLMULQDQ Westmere (2010) Sandy bridge (2012) Haswell (2013) Broadwell (2014) Skylake (Sept. 2015)

cycles per byte AES-GCM performance

AES-GCM Across In Intel CPU Generations

(2015) AES- GCM at the cost of CTR!

Use AES-NI for CTR and PCLMULQDQ for GHASH

slide-24
SLIDE 24

`

Efficiency of f GCM vs GCM-SIV

  • Encryption
  • In GCM, CTR-ENC and GHASH are interleaved and run in

parallel

  • In GCM-SIV, GHASH must be finished before CTR-ENC

can begin (cannot be done in parallel)

slide-25
SLIDE 25

`

Efficiency of f GCM vs GCM-SIV

  • Decryption:
  • In GCM, once again CTR-DEC and GHASH interleaved
  • In GCM-SIV, can also interleave (decryption cost “should

be” the same as the original GCM)

slide-26
SLIDE 26

` 1.18 1.10 1.16 0.92 0.77 0.76 0.94 0.65 0.65

  • 0.20

0.40 0.60 0.80 1.00 1.20 1.40

GCM-SIV encrypt (with init) GCM-SIV decrypt (with init) AES-GCM (without init)

Cycles per byte

Haswell Broadwell Skylake

GCM-SIV Performance – Highlights

2-key GCM-SIV over an 8KB message

slide-27
SLIDE 27

`

Time Comparison to AES-GCM

  • GCM-SIV (our implementation) is faster than (OpenSSL’s

best) AES-GCM for short messages, due to a new software

  • ptimization
slide-28
SLIDE 28

`

GCM-SIV Performance Comparison

  • GCM-SIV significantly outperforms all other

implemented nonce-misuse resistant schemes

  • Including all CAESAR round 1 candidates
  • Based on published authors’ optimized

implementations

  • When measured on modern x64 processors
  • The only exception is AEZ, which is based on a

non-standard use of AES

slide-29
SLIDE 29

`

Summary ry

  • Full nonce misuse-resistant authenticated encryption at an

extremely low cost (almost AES-GCM)

  • Full proof of security and full implementation
  • Easily deployable:
  • Utilizes existing hardware
  • Utilize existing code and software (AES-GCM implementations)
  • Detailed specifications, reference code and Open Source
  • ptimized code implementations coming soon
  • Unpatented
  • We hope to see it adopted
slide-30
SLIDE 30

`

Thank You