Introduction to symmetric cryptography
Joan Daemen
Institute for Computing and Information Sciences Radboud University Šibenik summer school 2016
Page 1 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto
Introduction to symmetric cryptography Joan Daemen Institute for - - PowerPoint PPT Presentation
Introduction to symmetric cryptography Joan Daemen Institute for Computing and Information Sciences Radboud University ibenik summer school 2016 Page 1 of 51 Joan Daemen ibenik summer school 2016 Symmetric Crypto Outline Security
Joan Daemen
Institute for Computing and Information Sciences Radboud University Šibenik summer school 2016
Page 1 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto
Outline
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Page 2 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Confidentiality
◮ To protect:
◮ Data confidentiality
◮ Protection against traffic analysis
Page 3 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Security services
Data integrity and authentication
◮ Basic concepts:
◮ Freshness:
◮ Protection against replay:
Page 4 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Security services
Secure channel
◮ cryptographically secured link between two entities ◮ data confidentiality and data origin authentication ◮ session-level authentication, protection against
◮ can be one-directional or full-duplex ◮ can be online or store-and-forward ◮ can require freshness or just protection against replay ◮ examples: SSH, TLS, GP SCP03, . . .
Page 5 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Security services
Symmetric cryptography operations
◮ Core business
◮ Requires secret key shared between sender and receiver
◮ On the side
Page 6 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Security services
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Encryption: one-time pad
◮ Let P be a plaintext of n bits: P1 to Pn ◮ Assume Z is a shared secret of n bits: Z1 to Zn ◮ Encryption to n-bit cryptogram C
◮ Decryption back to P
◮ Advantages
◮ Disadvantage: requires 1 fresh secret bit per message bit encrypted
Page 7 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Stream cipher
◮ Generates arbitrary-length keystream Z from
◮ Desired properties
Page 8 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Random oracle RO [Bellare-Rogaway 1993]
◮ A random oracle RO maps:
◮ RO supports queries of following type: (P, ℓ)
◮ Response Z
Page 9 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Security notion: Pseudorandom function (PRF)
Distinguishing game (black box version) ◮ Adversary sends queries Q to system that is either:
◮ Then based on responses Z must guess what system is
Page 10 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Security notion: PRF (cont’d)
◮ Black box fails to model public concrete stream cipher ◮ We give additional query access to internal functions ◮ We model query complexity in two parts:
◮ We express Advantage as Adv(M, N)
Page 11 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Implications of PRF property
◮ Informally: a function is a PRF if the advantage is negligible ◮ What really matters is the concrete bound ◮ A bound Adv(M, N) for stream cipher implies:
◮ but for concrete schemes we cannot prove such bounds!
Page 12 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Security claim
◮ Lack of proof leaves following questions on a concrete scheme:
◮ Addressed by a security claim
◮ For cryptanalysts: challenge
◮ For users: security specification
◮ Often claims are missing but implied by size parameters
Page 13 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
How concrete schemes gain assurance
◮ The (open) cryptologic activity (70s - today):
◮ This leads to
◮ Trust in cryptographic scheme depends on
Page 14 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Security strength
◮ Security strength of a cryptographic scheme
◮ Link with bound on distinguishing advantage
significant
◮ Current view on computational complexity
See www.keylength.com
Page 15 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Limit to security strength: exhaustive key search
◮ Single-target: attacker gets couple (IV , Z = SC[K](IV ))
◮ Multi-target: attacker gets m couples (IV , Zi = SC[Ki](IV ))
◮ key length does not equal security strength!
Page 16 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Stream encryption
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Message authentication code (MAC) functions
◮ Generates short tag T from
◮ Desired properties (informally)
Page 17 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
MAC function security
◮ Forgery: generating pair (M, T) without querying MF[K](M) ◮ Limit to forgery security strength: random tag guessing
◮ MAC function security strength bound by sum of two terms
Page 18 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Authenticated encryption (AE) with PRFs only
◮ Wrapping: (C, T) = wrap[K](IV , P)
◮ Unwrapping P = unwrap[K](IV , C, T) or ⊥
◮ Attacker model:
◮ Security strength:
Page 19 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Domain separation
◮ We need one PRF for encryption and one for tag computation ◮ Reduce to one with domain separation
◮ So we can take
◮ Generalization: multi-input PRF PRF′[K](P0, P1, P2, . . .) (1) Compute P = encode(P0, P1, P2, . . .) with injective encoding (2) Compute Z = PRF[K](P)
Page 20 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
AE with associated data
◮ Wrapping: (C, T) = wrap[K](IV , P, AD)
◮ Unwrapping P = unwrap[K](IV , C, AD, T) or ⊥
◮ All you need is one PRF
Page 21 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
The problem with the IV
◮ PRF is deterministic
◮ Stream encryption requires nonce management
◮ Wish for nonce-abuse resilience
Page 22 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
AEAD: Synthetic IV mode [Rogaway, Shrimpton 2006]
AD P PRF1 PRF0 K T C
◮ Tag on plaintext and AD used as IV for encryption ◮ T ′ = T lead to independent keystreams Z and Z ′ ◮ (AD, P) = (AD′, P′) give independent T and T ′
Page 23 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Encryption: wide block encryption
P B C K C P B-1
◮ b-bit message P is subject to permutation ◮ permutation depends on secret key K: we write B[K, b] ◮ decryption: inverse permutation B[K, b]−1 ◮ B: wide block cipher ◮ Limitation: information leakage if repeated messages
Page 24 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Pseudorandom Permutation (PRP) security
◮ Advantage in distinguishing B[K, b] from b-bit random permutation ◮ With b chosen by adversary for each query ◮ Adv(M, N)
Page 25 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
AEAD: wide tweakable block cipher [Rogaway, 2014]
P B C W K C P 0? B-1
◮ additional parameter tweak W can take AD or nonce ◮ no separate tag, reduncancy in plaintext ◮ forgery strength equal to redundancy in plaintext
Page 26 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Wide tweakable block cipher with a PRF
Pʹleft Pʹright K W PRF1 PRF2 PRF3 PRF4 Cleft Cright
◮ e.g., Mr Monster Burrito [Keccak team, 2014] ◮ Based on [Naor Reingold 1997], thanks [DJB, Tenerife 2013]
Page 27 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
On the side: cryptographic hashing
◮ Hash function: maps arbitrary input strings to n-bit digest ◮ Variant: eXtendable Output Function (XOF) [FIPS 202] ◮ Desired property: should behave like an RO
◮ Implications for security strength
More on hashing by Bart Preneel, this Thursday 2PM
Page 28 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Authentication and authenticated encryption
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Building PRFs
◮ PRF can have arbitrary input length and/or arbitrary output length ◮ Two approaches
◮ Primitives we think we can build from scratch
◮ Modes can be applied in multiple layers
◮ some examples follow
Page 29 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Block cipher based stream cipher: counter mode
Advantage in distinguishing from RO: sum of two terms ◮ 2−(b+1)M2
◮ PRP bound of underlying block cipher
Page 30 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Block cipher based AEAD: OCB
figure: thanks Bart Mennink
◮ Offset CodeBook [Rogaway et al. 2001] ◮ Adversary secrecy and forgery advantages: sum of two terms
◮ Parallelizable, requires nonce, block encryption (but not wide)
Page 31 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Permutation-based PRF: keyed duplex
± K f IV Z ¾ f Z ¾ f Z ¾ …
Work in progress ◮ Based on sponge/duplex with |Z| = r = b − c but
◮ More than a PRF
◮ Can be used as stream cipher, MAC function, AE scheme, PRNG
Page 32 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Generic security of keyed duplex: the setup
± K f IV Z ¾ f Z ¾ f Z ¾ … f x y
?
(±, IV) Path ¾ RO Z f x y
◮ Advantage of distinguishing from ideal function
◮ but f cannot be a PRP
Page 33 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Security of keyed duplex: requirements for f
± K f IV Z ¾ f Z ¾ f Z ¾ … f x y
?
(±, IV) Path ¾ RO Z f x y
◮ f cannot be a PRP
◮ Some requirements for f
Pr(succ.) > 1/(2b − N) has about same cost as f (−1)(x)
values si, ti = κ + f (si + κ), finding κ in N queries has Pr(succ.) < NM2−c
Page 34 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Generic security of keyed duplex: the bound
± K f IV Z ¾ f Z ¾ f Z ¾ … f x y
?
(±, IV) Path ¾ RO Z f x y
µN 2k + (L + 2ν)N 2c + L2 2c+1 + M2 2b ◮ with
M r-bit values is negligible
Page 35 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Counter-like stream cipher with keyed duplex
◮ Only init calls with Z keystream block ◮ IV is nonce, so L = 0. We get: µN 2k + 2νN 2c + M2 2b ◮ If global nonce or single key µ = 1 ◮ ν: if r > c this reduces to 2 ◮ For s bits of security we can take k = s + ǫ1 and c = s + ǫ2
Page 36 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
MAC with keyed duplex
◮ Message padded and fed via IV and σ blocks ◮ t-bit tag, capacity is de facto b − t ◮ adversary chooses IV so
mN 2k + MN 2b−t+2 + M2 2b−t+3 ◮ Suggests a minimum width of the permutation: b > s + t + log2(M) ◮ E.g. s = 128, t = 64, M ≤ 264 suggests b ≥ 256
Page 37 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
AE secure channel with keyed duplex: Motorist
SUV 1 T(0) A(1) P(1) C(1) T(1) P(2) C(2) T(2) A(3) T(3)
[Keyak team 2015]
◮ Session: tag authenticates all message history ◮ Plaintext absorbed in outer part, AD in inner part also ◮ SUV = Secret and Unique Value → L = 0 ◮ Used in Keyak with c = 256 and b = 1600 or b = 800: µN 2k + N 2255
Page 38 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building schemes with modes
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
How to build a cryptographic permutation?
◮ Two principles:
◮ Iterated permutation: apply a simple round function repeatedly ◮ Let Ai be the addition of a constant, then: f = Ar ◦ R ◦ Ar−1 ◦ R . . . A1 ◦ R ◦ A0 ◮ Choose round function R and # rounds such that:
Page 39 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building the primitives
How to build a block cipher
◮ Key-alternating: apply a simple round function repeatedly ◮ Let Ki be the addition of a round key, then: B[K] = Kr ◦ R ◦ Kr−1 ◦ R . . . K1 ◦ R ◦ K0 ◮ Round keys Ki derived from K
◮ Additional constraint: R shall have an efficient inverse ◮ Simpler method: Even-Mansour B[K] = K ◦ f ◦ K ◮ Better: Ki = K + Ai with Ai round constant
Page 40 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building the primitives
Building a round function: wide trail strategy
◮ Three layers, sharing the following desired properties
◮ Strongly based on differential (DC) and linear cryptanalysis (LC) ◮ Non-linear layer
◮ Mixing layer (linear)
rare
◮ Transposition (AKA dispersion) layer
Page 41 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Building the primitives
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Noekeon [Daemen, Peeters, Rijmen and Van Assche, 2000]
◮ Block cipher
◮ Pedigree
◮ Design goals:
See http://gro.noekeon.org/
Page 42 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
The Noekeon state
◮ Two-dimensional 4 × ℓ array
◮ Additional partitioning of the state: slices
◮ ℓ = 32
Page 43 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Round transformation
◮ γ: nonlinear layer
◮ θ: combines mixing layer and round key addition
◮ π: dispersion between slices
◮ ι: round constant addition for asymmetry
Page 44 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
The round and its inverse
◮ Round: π2 ◦ γ ◦ π1 ◦ θ[k] ◮ Inverse round:
1
2
◮ θ[k] as final transformation:
◮ Noekeon: 16 rounds and a final transformation
Page 45 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Nonlinear layer γ
◮ Two identical nonlinear steps with a linear step in between ◮ Simple algebraic expression
Page 46 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Mixing layer θ
◮ High average diffusion ◮ Small number of operations thanks to symmetry
Page 47 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Mixing layer θ cont’d
◮ Branch number B only 4 due to symmetry ◮ Invariant sparse states in kernel, e.g.:
Page 48 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Transposition steps π
◮ π1 and π2 are each others inverses
Page 49 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Lightweight aspect
◮ Hardware
◮ Software: e.g. numbers for ARM7:
◮ Cipher and inverse are equal: re-use of circuit and code
Page 50 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Example: Noekeon
Currently we are here...
Security services Stream encryption Authentication and authenticated encryption Building schemes with modes Building the primitives Example: Noekeon
Conclusions
◮ Modern symmetric cryptographic schemes
◮ Modes have certain provable security properties ◮ Primitives cannot be proven secure but there is hope
Thanks for your attention!
Page 51 of 51 Joan Daemen Šibenik summer school 2016 Symmetric Crypto Conclusions