AES on Sharemind Riivo Talviste, Jan Willemson - - PowerPoint PPT Presentation

aes on sharemind
SMART_READER_LITE
LIVE PREVIEW

AES on Sharemind Riivo Talviste, Jan Willemson - - PowerPoint PPT Presentation

AES on Sharemind Riivo Talviste, Jan Willemson {riivo,janwil}@cyber.ee Estonian Computer Science Theory Days Kubija, January 27-29, 2012 This research was, in part, funded by the U.S. Government. The views and conclusions contained in this


slide-1
SLIDE 1

AES on Sharemind

Riivo Talviste, Jan Willemson {riivo,janwil}@cyber.ee Estonian Computer Science Theory Days Kubija, January 27-29, 2012

This research was, in part, funded by the U.S. Government. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the U.S. Government. “A” (Approved for Public Release, Distribution Unlimited) This research was supported by European Social Fund’s Doctoral Studies and Internationalisation Programme DoRa.

slide-2
SLIDE 2

Motivation

  • Common benchmarking test
  • Can be used as a cryptographic primitive

– E.g. Database JOIN operation

sharemind

a machine for fast privacy-preserving computations

2

slide-3
SLIDE 3

Advanced Encryption Standard

  • Symmetric block cipher

– Using 128-bit blocks – 128, 192 or 256-bit keys

  • We use 128-bit keys in our implementation

sharemind

a machine for fast privacy-preserving computations

3

slide-4
SLIDE 4

AES-128 on Sharemind

  • Straightforward, following the NIST

specification

  • Plaintext and key are bitwise secret shared

s = s1 ⊕ s2 ⊕ s3, where ⊕ is XOR

  • Four 8-bit bytes are packed into a single 32-bit

integer (word)

  • Most computations are local

– Additions, bitshifts, multiplications by constant in GF(28)

sharemind

a machine for fast privacy-preserving computations

4

slide-5
SLIDE 5

AES-128 on Sharemind (2)

  • S-box: non-linear byte-for-byte substitution

table

– Has algebraic definition

  • Usually pre-computed and given as a 16x16 byte table
  • We use it as a 256-byte vector

– Byte b is replaced with S-box[b] – Requires communication

sharemind

a machine for fast privacy-preserving computations

5

slide-6
SLIDE 6

Computing S-box: characteristic vector

sharemind

a machine for fast privacy-preserving computations

6

S-box …

1 x

s = s

slide-7
SLIDE 7

Computing S-box: characteristic vector (2)

  • Substitute byte b = b7b6b5b4b3b2b1b0
  • S-box[0]

(1-b7)(1-b6)(1-b5)(1-b4)(1-b3)(1-b2)(1-b1)(1-b0)

S-box[1]

(1-b7)(1-b6)(1-b5)(1-b4)(1-b3)(1-b2)(1-b1)b0

S-box[2]

(1-b7)(1-b6)(1-b5)(1-b4)(1-b3)(1-b2)b1(1-b0) ...

S-box[254] b7 b6 b5 b4 b3 b2 b1(1-b0) S-box[255] b7 b6 b5 b4 b3 b2 b1 b0

sharemind

a machine for fast privacy-preserving computations

7

slide-8
SLIDE 8

Characteristic vector: multiplication

Option 1:

sharemind

a machine for fast privacy-preserving computations

b7

256

b6 b5 b4 b3 b2 b1 b0 b7 b3 b6 b2 b5 b1 b4 b0

x

b7,3

x

b6,2 b5,1 b4,0

x

b6,2,4,0 b7,3,5,1

x

1024 Round 1 Round 2 Round 3

Option 2:

Total: 7 rounds of multiplications

8

slide-9
SLIDE 9

Vectorization

  • Several plaintexts (128-bit blocks)

– Each block encrypted separately

  • Sharemind is highly optimized for vector
  • perations
  • Idea: Process several plaintext blocks in

parallel

– Vector lengths increase by the factor of #(blocks), but #(communication rounds) stays the same

sharemind

a machine for fast privacy-preserving computations

10

slide-10
SLIDE 10

Pre-expanded key

  • S-box is used in key expansion phase:

– Cipher key is used to generate ten 128-bit round keys

  • Secret shared cipher key has to be known to

miners before AES can be executed

  • Idea: We can move key expansion to pre-

processing phase and provide miners with the secret shared pre-expanded key instead

sharemind

a machine for fast privacy-preserving computations

11

slide-11
SLIDE 11

Benchmarking

  • 1 Gbit LAN
  • Results:

– 13.9 B/s – 33.2 B/s – 49.5 B/s

  • Hoped for larger

speedup :(

sharemind

a machine for fast privacy-preserving computations

50000 100000 150000 200000 250000 300000 350000 400000 450000 500000 5 10 20 30 50 100 200 400 Time (ms) Vector size (blocks) Sequential Vectorized Vectorized with pre-expanded key

12

slide-12
SLIDE 12

What happened?

  • Vectors are too large for the network layer

– E.g. SubBytes() multiplies vectors of size up to #(blocks)×4096 words – Saturation point for multiplication protocol depends

  • n bandwidth
  • In our scenario, it is ca. 10 000

– Hence, encrypting more than 2 blocks at once, clogs the network layer!

  • Optimizing only communication rounds is wrong

– Large amount of data kills parallelization

sharemind

a machine for fast privacy-preserving computations

13

slide-13
SLIDE 13

S-box with circuits

  • Boyar and Peralta [2010, 2011] have

come up with several circuits for AES S-box

– Using only AND, XOR, XNOR – Minimal depth

  • In multi-party computing, XOR is free

(local), AND (multiplication) costs

– We want minimal number of AND gates

sharemind

a machine for fast privacy-preserving computations

14

slide-14
SLIDE 14

Benchmarking, again

sharemind

a machine for fast privacy-preserving computations

1 10 100 1000 10000 100000 1000000 5 10 20 30 50 100 200 300 400 500 1000 2000 3000 4000 5000 Time (ms) Vector size (blocks) Sequential Vectorized Vectorized with pre-expanded key Circuit Vectorized circuit with pre-expanded key 15

slide-15
SLIDE 15

Benchmarking, again (2)

  • Vectorized circuit with pre-expanded key

– Maximum vector length: #(blocks)×18 words – Reach saturation point with ca. 550 blocks – Average throughput: 12.6 kB/s

sharemind

a machine for fast privacy-preserving computations

16

slide-16
SLIDE 16

Compare to others

Team Model sec/ block Damgård, Keller [2009] 3-party, w/o pre-expanded key, 10 blocks in parallel 2 Huang et al. [2011] 2-party, pre-expanded key 0.06 Launchbury et al. [2011] 3-party, 1 block, no pipelining 0.015 3-party, 64 blocks in parallel, pipelined 0.007 Us [2011] 3-party, pre-expanded key, 10 blocks in parallel 0.07 3-party, pre-expanded key, 100 blocks in parallel 0.007 3-party, pre-expanded key, 1000 blocks in parallel 0.001 3-party, pre-expanded key, 5000 blocks in parallel 0.0005

sharemind

a machine for fast privacy-preserving computations

17

slide-17
SLIDE 17

Conclusions

  • AES on secret shared data can be done
  • Optimizing only communication rounds is

wrong

– Large amount of data kills parallelization

  • Circuits help to lower the amount of data
  • In future, we use it to implement oblivious

database JOIN operation

sharemind

a machine for fast privacy-preserving computations

18