Top Banner
Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A. Biryukov, C. Bouillaguet, D. Khovratovich, (talk given by Ivica Nikolic) University of Luxembourg and University of Lille 8 December 2014
29

Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Jul 14, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Cryptographic Schemes Based on the ASASAStructure: Black-box, White-box, and Public-key

A. Biryukov, C. Bouillaguet, D. Khovratovich,

(talk given by Ivica Nikolic)

University of Luxembourg and University of Lille

8 December 2014

Page 2: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

1 White-box cryptographyDefinitionsWhite-boxed AES

2 ASASA designsSecret-keyWhite-boxPublic-key

Page 3: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

White-box cryptography (WBC)Motivation for the ASASA construction in public- and

secret-key schemes

Page 4: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Weak white-box

WBC centers around white-box implementation:1. Pure software implementation of a cipher (encryption or

decryption routine) with embedded key;2. Implementation is assumed available to an adversary.3. Weak white-box: Adversary can not extract the key from

the implementation.

Example: recovering protected media content, which is decoded insoftware:

Page 5: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Weak white-box

WBC centers around white-box implementation:1. Pure software implementation of a cipher (encryption or

decryption routine) with embedded key;2. Implementation is assumed available to an adversary.3. Weak white-box: Adversary can not extract the key from

the implementation.

Example: recovering protected media content, which is decoded insoftware:

Page 6: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Strong white-box

WBC centers around white-box implementation:1. Pure software implementation of a cipher (encryption or

decryption routine) with embedded key;2. Implementation is assumed available to an adversary.3. Strong white-box: adversary can not invert the cipher, i.e.

can not decrypt given the encryption routine.

Similar to public-key cryptography. Why not using it?

• RSA-2048 encryption speed — 1000 cycles per byte.• AES-128 encryption speed — 0.7 cycles per byte.

Impractical for large amount of data (HD movies, etc.).

Page 7: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Strong white-box

WBC centers around white-box implementation:1. Pure software implementation of a cipher (encryption or

decryption routine) with embedded key;2. Implementation is assumed available to an adversary.3. Strong white-box: adversary can not invert the cipher, i.e.

can not decrypt given the encryption routine.

Similar to public-key cryptography. Why not using it?• RSA-2048 encryption speed — 1000 cycles per byte.• AES-128 encryption speed — 0.7 cycles per byte.

Impractical for large amount of data (HD movies, etc.).

Page 8: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Failure to build weak white-box with AES

Page 9: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Generic approach to white-boxing

How to white-box a cipher:• Replace key-dependent transformations with lookup tables;• Encode the encryption as a sequence of lookups.

plaintext

ciphertext

key

Page 10: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

AES

AES-128 (designed in 1997, adopted in 2001): 10-round cipherwith 16-byte state.

One round of AES:

• Four 32-bit blocks:• AddRoundKey (simple XOR);• SubBytes (bytewise

nonlinear);• MixColumns (linear).

• ShiftRows (byte permutation).

S S S S

MixColumn

Ksubkey

injection

nonlinear

linear

S32 S32 S32 S32K1 round

Page 11: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

White-boxing AES round

S S S S

MixColumn

K

linear

S32 S32 S32 S32K

A secret

linearsecret

I1I2

I232

· · ·

O1

O2

O232

· · ·

lookup tablekey-dependent

Table 1 Table 2 Table 3 Table 4

S S S S

MixColumn

K

Original

S1 S2 S3 S4

S−11 S−1

2 S−13 S−1

4

secretnonlinear

A2

S′1

A

S′2 S′

3 S′4

A1 A3 A4

SASstructure

S−11 S−1

2 S−13 S−1

4

• Wrap the key addition and S-boxes with redundant linear andnonlinear transformations;

• The secret layers collapse to the SAS structure.• Replace every 32-bit block with a lookup table;• Store everything in memory.

Actual proposal used smaller and weaker tables.

Page 12: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Attacks

The SAS structure has some exploitable properties:

S′1

A

S′2 S′

3 S′4

const*all valuesS′1

A

S′2 S′

3 S′4

SASstructure

S−11 S−1

2 S−13 S−1

4

: const*

D D D Dall values

or every occurseven times

S′1 S′

2 S′3 S′

4

D D D D

• For instance, set (∗,C ,C ,C ) transforms to (D,D,D,D).• This led way to various sorts of attacks, including differentialand algebraic ones.

• Outer layers can be retrieved.

Constructions as large as SASAS are vulnerable[Biryukov-Shamir’01].

Page 13: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

ASASA

However, the ASASA structure is still unbroken:

AS

SA

A

affine

nonlinear

nonlinear

affine

affine

Hints for new designs...

Page 14: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Our contributions

Page 15: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Secret-key ASASA

Page 16: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

ASASA

Symmetric ASASA with secret layers.

AS

SA

A

affine

nonlinear

nonlinear

affine

affine

• Key-dependent affine layers (random invertible matrices);• Key-dependent secret 8-bit S-boxes (random permutations);• We estimate 128-bit security for 128-bit keys and 128-bitblocks;

• Some attacks on other parameters are presented in the paper.

Page 17: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

White-box ASASA

Page 18: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Weak white-box security

Weak white-box: adversary can not extract the key from theimplementation.

We extend the definition: it should be infeasible to derive a key orany other compact secret from the WB implementation.

Adversary can not recover the components =⇒ he has touse/broadcast the implementation "as is".

Page 19: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Weak white-box security

Our solution for weak white-box security: an implementation thatcan not be compressed.

Consider small block (≤32 bits) ASASA cipher and encode it as alookup table.

AS

SA

A

affine

nonlinear

nonlinear

affine

affine

Page 20: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Incompressible implementation

E1,1

L

R subciphers

R iterations

E1,2 E1,R

ER,1 ER,2 ER,R

L

A

SA

SA

• Cipher composed of smaller d-bit subciphers (8 ≤ d ≤ 28).• Parameter d determines the implementation size.• Subcipher invocations alternate with public permutations (L).• Total implementation size can be tuned from 2 MB to 20 GB.

Page 21: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Public-key and strong white-boxASASA

Page 22: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Multivariate cryptography

Public-key cryptography with polynomials (dates back to 1980s):

b = A2 ◦ S ◦ A1, (1)

where A1 and A2 are key-dependent and secret affinetransformations, and S is a public invertible polynomial of degree 2.

• Degree-2 polynomials of 128 boolean variables are compactenough (less than 1 MByte), and there is no generic inversionalgorithm.

• However, virtually all variants of this scheme have been brokenbecause of properties of S: only a few families of invertiblepolynomials are available (even without trapdoors).

Page 23: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Multivariate cryptography

Public-key cryptography with polynomials (dates back to 1980s):

b = A2 ◦ S ◦ A1, (1)

where A1 and A2 are key-dependent and secret affinetransformations, and S is a public invertible polynomial of degree 2.

• Degree-2 polynomials of 128 boolean variables are compactenough (less than 1 MByte), and there is no generic inversionalgorithm.

• However, virtually all variants of this scheme have been brokenbecause of properties of S: only a few families of invertiblepolynomials are available (even without trapdoors).

Page 24: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

How about adding more layers to get ASASA?

Page 25: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Asymmetric scheme

Polynomial-based S-boxes of degree 2?

SA

nonlinear

nonlinear

affine

affine

SA

affineA

The encryption function is a set of degree-4 polynomials.

Page 26: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Asymmetric scheme

First attempt: use Daemen’s nonlinear function(yi = xi ⊕ xi+1xi+2 ⊕ xi+2), used in Keccak/SHA-3.

SA

nonlinear

nonlinear

affine

affine

SA

affineA

Problems:• Broken with Grobner basis attacks in real time;• Also vulnerable to generic decomposition algorithms[Faugere-Perret’10];

Page 27: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Our solution: random S-boxes and noise

Our solution: ASASA with expanding S-boxes and perturbation(noise):

b = U ◦ a2 ◦ T ◦ a1 ◦ S

• Two nonlinear layers (128→ 256 and256→ 512 bits);

• Nonlinear transformations areexpanding and more random-looking;

• Perturbation (a3) added to defeatgeneric decomposition algorithms;

• 24 MBytes of public key.

S

T

U

a3

a1

a2

randomdeg-4 polynomials

Page 28: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Also in the paper

Additional material in the proceedings and on ePrint:• LPN and algebraic attacks on weakened multivariate schemes;• Various attacks on secret-key ASASA.

Page 29: Cryptographic Schemes Based on the ASASA Structure: Black ... · Cryptographic Schemes Based on the ASASA Structure: Black-box, White-box, and Public-key A.Biryukov,C.Bouillaguet,D.Khovratovich,

Questions?