Running compression algorithms in the encrypted domain: a ...

32

Transcript of Running compression algorithms in the encrypted domain: a ...

Page 1: Running compression algorithms in the encrypted domain: a ...

Running compression algorithms in the encrypteddomain: a case-study on the homomorphic

execution of RLE

Donald Nokam Kuate

Sebastien CanardSergiu CarpovRenaud Sirdey

28 avril 2017

Page 2: Running compression algorithms in the encrypted domain: a ...

Agenda

Homomorphic encryptionDe�nitionExemples and applications

Armadillo compilerInfos compilerGeneral structure

Run-Length Encoding (RLE)De�nition RLERegularization of RLEImprovements and results

Page 3: Running compression algorithms in the encrypted domain: a ...

Homomorphic encryption (HE)

Encryption

Page 4: Running compression algorithms in the encrypted domain: a ...

Homomorphic encryption (HE)

HF1: homomorphic concat & scale function

Homomorphic evaluationEncryption

HF1

Page 5: Running compression algorithms in the encrypted domain: a ...

Homomorphic encryption (HE)

HF1: homomorphic concat & scale function

Homomorphic evaluationEncryption

Decryption

HF1

Page 6: Running compression algorithms in the encrypted domain: a ...

Homomorphic encryption (HE)

F1: concatenation & scale functionHF1: homomorphic concat & scale function

Clear evaluation

Homomorphic evaluationEncryption

Decryption

F1 HF1

Page 7: Running compression algorithms in the encrypted domain: a ...

Examples and applications of HE

Examples

I partially HE (∞“ + ” or ∞“× ”) :I RSA, ElGamal, Paillier

I somewhat HE (∞“ + ” and �nite “× ”) :I YASHE, FV, BGV

I fully HE (∞“ + ” and ∞“× ”) : �rst time de�ne in 2009 byCraig Gentry who introduces bootstrapping.Fully HE = somewhat HE+bootstrapping.

Applications

I cloud computing ;

I electronic voting ;

I video transcoding and image processing.

Page 8: Running compression algorithms in the encrypted domain: a ...

Examples and applications of HE

Examples

I partially HE (∞“ + ” or ∞“× ”) :I RSA, ElGamal, Paillier

I somewhat HE (∞“ + ” and �nite “× ”) :I YASHE, FV, BGV

I fully HE (∞“ + ” and ∞“× ”) : �rst time de�ne in 2009 byCraig Gentry who introduces bootstrapping.Fully HE = somewhat HE+bootstrapping.

Applications

I cloud computing ;

I electronic voting ;

I video transcoding and image processing.

Page 9: Running compression algorithms in the encrypted domain: a ...

Agenda

Homomorphic encryptionDe�nitionExemples and applications

Armadillo compilerInfos compilerGeneral structure

Run-Length Encoding (RLE)De�nition RLERegularization of RLEImprovements and results

Page 10: Running compression algorithms in the encrypted domain: a ...

Armadillo compiler

Armadillo

I Compiler developed by CEA ;

I developed in C++ ;

I use the FV homomorphic scheme, but other HE scheme too ;

I the main operations are +, ×, and x = c?a : b

Page 11: Running compression algorithms in the encrypted domain: a ...

General structure of Armadillo

inputbinary input

Enc.binary input

C++code

binarycircuit

opbinary circuit

Enc.output

output

Binarization Encryption

OptimizationExecution

Decryption

Binarization

Output

Figure � General structure of Armadillo

Page 12: Running compression algorithms in the encrypted domain: a ...

Agenda

Homomorphic encryptionDe�nitionExemples and applications

Armadillo compilerInfos compilerGeneral structure

Run-Length Encoding (RLE)De�nition RLERegularization of RLEImprovements and results

Page 13: Running compression algorithms in the encrypted domain: a ...

RLE

RLE

Is a lossless data compression algorithm, which consists intransforming a sequence of symbols where some symbols have aconsecutive repetition, in a sequence of (symbol, counter) muchshorter.

Example

The sequence LLLLLLLUUUUKKKKKKKKEEEEEEEEEE istransformed in (L, 7), (U, 4), (K, 8), (E, 10).

Applications

I loss or lossless image compressing (BMP, JPEG) ;

I MPEG and H26x video compressing.

Page 14: Running compression algorithms in the encrypted domain: a ...

RLE

RLE

Is a lossless data compression algorithm, which consists intransforming a sequence of symbols where some symbols have aconsecutive repetition, in a sequence of (symbol, counter) muchshorter.

Example

The sequence LLLLLLLUUUUKKKKKKKKEEEEEEEEEE istransformed in (L, 7), (U, 4), (K, 8), (E, 10).

Applications

I loss or lossless image compressing (BMP, JPEG) ;

I MPEG and H26x video compressing.

Page 15: Running compression algorithms in the encrypted domain: a ...

RLE

RLE

Is a lossless data compression algorithm, which consists intransforming a sequence of symbols where some symbols have aconsecutive repetition, in a sequence of (symbol, counter) muchshorter.

Example

The sequence LLLLLLLUUUUKKKKKKKKEEEEEEEEEE istransformed in (L, 7), (U, 4), (K, 8), (E, 10).

Applications

I loss or lossless image compressing (BMP, JPEG) ;

I MPEG and H26x video compressing.

Page 16: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

A pseudo-code of RLE is :

Page 17: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Steps of regularization

I make incrementation of i constant and transform the whileloop ;

Page 18: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Steps of regularization

I make incrementation of i constant and transform the whileloop ;

Page 19: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Steps of regularization

I condition the counter j ;

Page 20: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Steps of regularization

I condition the counter j ;

Page 21: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Steps of regularization

I condition the outputs ;I set a �x rate of compression ;I referencement on encrypted indeces ;

Page 22: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

Page 23: Running compression algorithms in the encrypted domain: a ...

RLE regularization for Armadillo

output_ctr[k] = joutput_chr[k] = input[i-1]

Page 24: Running compression algorithms in the encrypted domain: a ...

First results

First results

# symbols # pairs depth times(min)

10 5 22 7.20

16 5 28 21.0

64 8 75 -

Table � Depth of homomorphic RLE in function of number of symbolsand number of output pairs on 2 core cpu and 3.00GHz machine

Remarks

I k = intput[i] == intput[i-1] ?k :k+1 (line 23)I # symbols = 10 → depth = 17I # symbols = 64 → depth = 70

I j = intput[i] == intput[i-1] ?j+1 :1 (same as for k)

Page 25: Running compression algorithms in the encrypted domain: a ...

First results

First results

# symbols # pairs depth times(min)

10 5 22 7.20

16 5 28 21.0

64 8 75 -

Table � Depth of homomorphic RLE in function of number of symbolsand number of output pairs on 2 core cpu and 3.00GHz machine

Remarks

I k = intput[i] == intput[i-1] ?k :k+1 (line 23)I # symbols = 10 → depth = 17I # symbols = 64 → depth = 70

I j = intput[i] == intput[i-1] ?j+1 :1 (same as for k)

Page 26: Running compression algorithms in the encrypted domain: a ...

Improvements

First improvement

Change linek = intput[i] == intput[i-1] ?k :k+1 byk+=input[i] !=input[i-1] ;the depth down to 8 for 10 symbols and to 10 for 64 symbols

Second improvement

Change linej = intput[i] == intput[i-1] ? j+1 :1 byj = 1 + j&(input[i] !=input[i-1]) and remark that if we setbi = input[i] !=input[i-1] then

j = 1+i∑

l=1

i∏m=l

bm.

The depth down to 11 for 10 symbols and to 14 for 64 symbols

Page 27: Running compression algorithms in the encrypted domain: a ...

Improvements

First improvement

Change linek = intput[i] == intput[i-1] ?k :k+1 byk+=input[i] !=input[i-1] ;the depth down to 8 for 10 symbols and to 10 for 64 symbols

Second improvement

Change linej = intput[i] == intput[i-1] ? j+1 :1 byj = 1 + j&(input[i] !=input[i-1]) and remark that if we setbi = input[i] !=input[i-1] then

j = 1+i∑

l=1

i∏m=l

bm.

The depth down to 11 for 10 symbols and to 14 for 64 symbols

Page 28: Running compression algorithms in the encrypted domain: a ...

Second results

# symbols # pairs depth(old) depth (new) new times(min)

10 5 22 14 2.30

16 5 28 20 10.45

64 8 75 63 -

Table � Second results : depth of homomorphic RLE in function ofnumber of symbols and number of output pairs on 2 core cpu and

3.00GHz machine

Remark

The algorithm depth is reduced, but still not yet enough.This is due to linesoutput_chr[l]=(k==l) ?input[i-1] :output_chr[l] (line 20) ;output_ctr[l] = (k==l) ?j :output_ctr[l] (line 21) ;

Page 29: Running compression algorithms in the encrypted domain: a ...

Second results

# symbols # pairs depth(old) depth (new) new times(min)

10 5 22 14 2.30

16 5 28 20 10.45

64 8 75 63 -

Table � Second results : depth of homomorphic RLE in function ofnumber of symbols and number of output pairs on 2 core cpu and

3.00GHz machine

Remark

The algorithm depth is reduced, but still not yet enough.This is due to linesoutput_chr[l]=(k==l) ?input[i-1] :output_chr[l] (line 20) ;output_ctr[l] = (k==l) ?j :output_ctr[l] (line 21) ;

Page 30: Running compression algorithms in the encrypted domain: a ...

Improvement

Third improvement

The lines 20 and 21 have the same structure which is of the formc(i)l =

(l == k(i)

)?xi−1 : c

i−1l

When we develop, we obtain the following expression

c(i)l = c0 + (c0 + xi−1)b

(i)l

+i−1∑j=1

(c0 + xj−1) b(j)l

1+∑

K∈P(j+1,...,i)

(∏u∈K

b(u)l

)where b

(i)l =

(l == k(i)

), c0 = c

(0)l .

This development allow us to drop the depth to the theoreticalvalue of 12+ log2 (N + 1), N = sequence length.

Page 31: Running compression algorithms in the encrypted domain: a ...

Conclusion

I DOI regularized and executed the RLE algorithm in the

homomorphic domain ;I improved its depth ;

I TO DOI try to reach this theoretical detph ;I improved the other block from either side of RLE in video

compressing.

Page 32: Running compression algorithms in the encrypted domain: a ...

Thanks !

Questions ?