SLIDE 1 Computing Information Flow Using Symbolic Model-Checking
Rohit Chadha 1 Umang Mathur 2 Stefan Schwoon 3
1University of Missouri
Columbia, Missouri, USA
2Indian Institute of Technology - Bombay
Mumbai
3LSV, ENS Cachan
France
December 17, 2014
SLIDE 2
Outline
Introduction Preliminaries Summary Calculation Computing Information Leakage: Symbolic Algorithms Moped-QLeak Demo Conclusions and Future Work Thank You
SLIDE 3 Introduction
◮ Quantifying information leakage - Inferring information about inputs by
SLIDE 4 Introduction
◮ Quantifying information leakage - Inferring information about inputs by
◮ No leakage =
⇒ Outputs independent of inputs
SLIDE 5 Introduction
◮ Quantifying information leakage - Inferring information about inputs by
◮ No leakage =
⇒ Outputs independent of inputs
◮ Full leakage =
⇒ Unique input corresponding to given output
SLIDE 6 Introduction
◮ Quantifying information leakage - Inferring information about inputs by
◮ No leakage =
⇒ Outputs independent of inputs
◮ Full leakage =
⇒ Unique input corresponding to given output
◮ Comparing leakage across programs - less leakage is desirable
SLIDE 7
Measuring Information Leakage
SLIDE 8
Measuring Information Leakage
Several metrics - min-entropy, Shannon’s entropy, etc.,
SLIDE 9 Measuring Information Leakage
Several metrics - min-entropy, Shannon’s entropy, etc.,
- 1. Min-entropy leakage measures vulnerability of the secret inputs to being
guessed correctly in a single attempt of the adversary MEU(P) = log
max
s∈S µ(S = s | O = o).
SLIDE 10 Measuring Information Leakage
Several metrics - min-entropy, Shannon’s entropy, etc.,
- 1. Min-entropy leakage measures vulnerability of the secret inputs to being
guessed correctly in a single attempt of the adversary MEU(P) = log
max
s∈S µ(S = s | O = o).
- 2. Shannon entropy leakage measures expected number of guesses required
to correctly guess the secret input SEU(P) = log |S| − 1 |S|
|P−1(o)| log |P−1(o)|
SLIDE 11
Example
Consider the following example:
SLIDE 12 Example
Consider the following example: def example (input) :
return output
SLIDE 13 Example
Consider the following example: def example (input) :
return output What would be the information leaked by the above program
SLIDE 14 Example
Consider the following example: def example (input) :
return output What would be the information leaked by the above program
◮ using min-entropy ?
SLIDE 15 Example
Consider the following example: def example (input) :
return output What would be the information leaked by the above program
◮ using min-entropy ? ◮ using Shannon entropy ?
SLIDE 16
Dining Cryptographers
SLIDE 17
Dining Cryptographers
◮ Cryptographers A, B and C: Dine out
SLIDE 18
Dining Cryptographers
◮ Cryptographers A, B and C: Dine out
SLIDE 19
Dining Cryptographers
◮ Cryptographers A, B and C: Dine out ◮ Payment done by
SLIDE 20 Dining Cryptographers
◮ Cryptographers A, B and C: Dine out ◮ Payment done by
◮ One of A, B or C, or
SLIDE 21 Dining Cryptographers
◮ Cryptographers A, B and C: Dine out ◮ Payment done by
◮ One of A, B or C, or ◮ NSA
SLIDE 22 Dining Cryptographers
◮ Cryptographers A, B and C: Dine out ◮ Payment done by
◮ One of A, B or C, or ◮ NSA
◮ Determine if the NSA paid or not w/o revealing information about
cryptographers
SLIDE 23
Dining Cryptographers: Protocol
2 stage protocol:
SLIDE 24 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
SLIDE 25 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
SLIDE 26 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
◮ XOR of shared bits, if did not pay
SLIDE 27 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
◮ XOR of shared bits, if did not pay ◮ ¬ (XOR of shared bits), otherwise
SLIDE 28 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
◮ XOR of shared bits, if did not pay ◮ ¬ (XOR of shared bits), otherwise
1 1 ¬XOR(0, 1) = 0 XOR(0, 1) = 1 XOR(1, 1) = 0
SLIDE 29 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
◮ XOR of shared bits, if did not pay ◮ ¬ (XOR of shared bits), otherwise
1 1 ¬XOR(0, 1) = 0 XOR(0, 1) = 1 XOR(1, 1) = 0
Stage-1 (left) and Stage-2 (right)
SLIDE 30 Dining Cryptographers: Protocol
2 stage protocol:
- 1. Every two cryptographers establish a shared one-bit secret : Toss a coin
- 2. Each cryptographer publicly announces a bit, which is
◮ XOR of shared bits, if did not pay ◮ ¬ (XOR of shared bits), otherwise
1 1 ¬XOR(0, 1) = 0 XOR(0, 1) = 1 XOR(1, 1) = 0
Stage-1 (left) and Stage-2 (right)
XOR(AnnouncementA, AnnouncementB, AnnouncementC) = 0 iff NSA paid for the dinner
SLIDE 31
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output
SLIDE 32
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations
SLIDE 33
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations ◮ Program statements : transform global and local variables
SLIDE 34
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations ◮ Program statements : transform global and local variables ◮ For Program P, FP : 2G → 2G ∪ {⊥}
SLIDE 35
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations ◮ Program statements : transform global and local variables ◮ For Program P, FP : 2G → 2G ∪ {⊥} ◮ FP( ¯
g0) = ⊥ iff P does not terminate
SLIDE 36
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations ◮ Program statements : transform global and local variables ◮ For Program P, FP : 2G → 2G ∪ {⊥} ◮ FP( ¯
g0) = ⊥ iff P does not terminate
◮ Summary - Joint probability distribution µ
SLIDE 37
Probabilistic Boolean Programs
◮ Global variablesn G: Input and output ◮ Local variables: Internal calculations ◮ Program statements : transform global and local variables ◮ For Program P, FP : 2G → 2G ∪ {⊥} ◮ FP( ¯
g0) = ⊥ iff P does not terminate
◮ Summary - Joint probability distribution µ
SLIDE 38
Algebraic Decision Diagrams
◮ Set of variables V
SLIDE 39
Algebraic Decision Diagrams
◮ Set of variables V ◮ Algebraic set M (M = [0, 1] for probabilistic statements, M = {0, 1}
implies BDDs)
SLIDE 40
Algebraic Decision Diagrams
◮ Set of variables V ◮ Algebraic set M (M = [0, 1] for probabilistic statements, M = {0, 1}
implies BDDs)
◮ ADD : 2V → M
SLIDE 41
Algebraic Decision Diagrams
◮ Set of variables V ◮ Algebraic set M (M = [0, 1] for probabilistic statements, M = {0, 1}
implies BDDs)
◮ ADD : 2V → M ◮ Efficient reduced representations, similar to BDDs
SLIDE 42 Algebraic Decision Diagrams
◮ Set of variables V ◮ Algebraic set M (M = [0, 1] for probabilistic statements, M = {0, 1}
implies BDDs)
◮ ADD : 2V → M ◮ Efficient reduced representations, similar to BDDs
x y y z z z z 1 1 0.5 0.5 0.5 0.5 x y z z 1 0.5
SLIDE 43 Algebraic Decision Diagrams
◮ Set of variables V ◮ Algebraic set M (M = [0, 1] for probabilistic statements, M = {0, 1}
implies BDDs)
◮ ADD : 2V → M ◮ Efficient reduced representations, similar to BDDs
x y y z z z z 1 1 0.5 0.5 0.5 0.5 x y z z 1 0.5
ADD (up) and its reduced form (bottom)
SLIDE 44
Computing Summaries: Fixed Point Iteration
◮ Program statement l → µl
SLIDE 45
Computing Summaries: Fixed Point Iteration
◮ Program statement l → µl ◮ Can be represented efficiently as MTBBDs
SLIDE 46 Computing Summaries: Fixed Point Iteration
◮ Program statement l → µl ◮ Can be represented efficiently as MTBBDs
x x' 0x2c 0x29 0x2b
1
Stmt: x = !x Stmt
SLIDE 47 Computing Summaries: Fixed Point Iteration
◮ Program statement l → µl ◮ Can be represented efficiently as MTBBDs
x x' 0x2c 0x29 0x2b
1
Stmt: x = !x Stmt
◮ Compose statements
SLIDE 48 Computing Summaries: Fixed Point Iteration
◮ Program statement l → µl ◮ Can be represented efficiently as MTBBDs
x x' 0x2c 0x29 0x2b
1
Stmt: x = !x Stmt
◮ Compose statements ◮ Arrive at a fixed point (Summary µ )
SLIDE 49
Min Entropy : Symbolic Algorithm
For a program P, with
SLIDE 50
Min Entropy : Symbolic Algorithm
For a program P, with
◮ input set S (uniform distribution),
SLIDE 51
Min Entropy : Symbolic Algorithm
For a program P, with
◮ input set S (uniform distribution), ◮ output set O, and,
SLIDE 52
Min Entropy : Symbolic Algorithm
For a program P, with
◮ input set S (uniform distribution), ◮ output set O, and, ◮ joint probability distribution µ,
SLIDE 53 Min Entropy : Symbolic Algorithm
For a program P, with
◮ input set S (uniform distribution), ◮ output set O, and, ◮ joint probability distribution µ,
the min-entropy leakage MEU(P) is MEU(P) = log
max
s∈S µ(S = s | O = o).
SLIDE 54 Min Entropy : Symbolic Algorithm
For a program P, with
◮ input set S (uniform distribution), ◮ output set O, and, ◮ joint probability distribution µ,
the min-entropy leakage MEU(P) is MEU(P) = log
max
s∈S µ(S = s | O = o).
Algorithm 6: Symbolic computation of min-entropy leakage of a probabilistic program Input: G, G′ and TP the summary of P. Output: MEU(P)
1 begin 2
Tout,P ← − abstract(max, G, TP)
3
sumout ← − val(abstract(+, G′, Tout,P))
4
Tterm,P ← − abstract(+, G′, TP)
5
sumout ← − sumout + (1 − val(abstract(min, G, Tterm,P)));
6
return log sumout
SLIDE 55 Shannon Entropy : Symbolic Algorithm
SEU(P) = log |S| − 1 |S|
|P−1(o)| log |P−1(o)|
SLIDE 56 Shannon Entropy : Symbolic Algorithm
SEU(P) = log |S| − 1 |S|
|P−1(o)| log |P−1(o)|
Algorithm 8: Symbolic computation of Shannon entropy leakage of a probabilis- tic program Input: G, G′ and TP the summary of P. Output: SEU(P)
1 Let n be the number of variables in G. 2 begin 3
Tnorm-eq-size,P ← − divide(abstract(+, G, TP), 2n)
4
valout ← − (- val(abstract(⋆, G′, Tnorm-eq-size,P)))
5
Tterm,P ← − abstract(+, G′, TP)
6
probout,non-term ← − (1 −
val(abstract(+,G,Tterm,P )) 2n
)
7
valout,non-term ← − (- probout,non-term log probout,non-term)
8
Tnorm-⋆out,P ← − divide(abstract(⋆, G′, TP), 2n)
9
valcond ← − (-val(abstract(+, G, T⋆out,P)))
10
Tnon-term,P ← − subtract(1, Tterm,P)
11
valcond,non-term ← − (-
val(abstract(⋆,G,Tnon-term-prob,P )) 2n
)
12
return (valout + valout,non-term − valcond − valcond,non-term)
SLIDE 57
Moped-QLeak
◮ Tool Moped-QLeak: extends Moped
SLIDE 58
Moped-QLeak
◮ Tool Moped-QLeak: extends Moped ◮ Source - C/C++
SLIDE 59
Moped-QLeak
◮ Tool Moped-QLeak: extends Moped ◮ Source - C/C++ ◮ Input language Remopla - arrays, integers, struct’s, etc.,
SLIDE 60 Moped-QLeak
◮ Tool Moped-QLeak: extends Moped ◮ Source - C/C++ ◮ Input language Remopla - arrays, integers, struct’s, etc.,
define N 32 define DEFAULT_INT_BITS N unsigned int var1; bool g; module void f(unsigned int v, bool z){ bool k; pchoice :: 0.2 -> label2: k = g && z; :: 0.8 -> var1 = var1 + v; choicep } module void main(){ var1 = 53; pchoice :: 0.3 -> label1: g = true; :: 0.7 -> f(var1, !g); choicep }
SLIDE 61
Moped-QLeak
Modifications/Optimizations made:
SLIDE 62
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations
SLIDE 63
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations ◮ Variable orderings - manual
SLIDE 64
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations ◮ Variable orderings - manual
Salient features:
SLIDE 65
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations ◮ Variable orderings - manual
Salient features:
◮ Handles large number of bits (30 bits)
SLIDE 66
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations ◮ Variable orderings - manual
Salient features:
◮ Handles large number of bits (30 bits) ◮ Time taken in miliseconds
SLIDE 67
Moped-QLeak
Modifications/Optimizations made:
◮ Algebraic operations ◮ Variable orderings - manual
Salient features:
◮ Handles large number of bits (30 bits) ◮ Time taken in miliseconds ◮ Consistently outperforms sqifc (Malacaria et. al)
SLIDE 68
Moped-QLeak
Example Order ME SE Time Data types Illustrative Example I 3 2.03966e-05 0.215 bool Electronic Purse D 2 2 0.009 5 bit integers (Restricted) Mix and Duplicate S 16 16 0.041 bool Binary Search I 16 16 9.307 bool Sanity Check I 4 1.168e-7 0.060 bool Implicit Flow D 2.8074 1.757e-07 0.016 30 bit integers Implicit Flow D 2.8074 0.003 0.010 15 bit integers Implicit Flow D 2.8074 4.67189e-08 0.190 bool Masked Copy I 16 16 0.038 bool Sum Query D 4.80735 4.35132 0.034 5 bit integers (Restricted)
SLIDE 69 Related Work
◮ (K¨
- pf et. al.,) : iteratively refine equivalence classes (deterministic only)
SLIDE 70 Related Work
◮ (K¨
- pf et. al.,) : iteratively refine equivalence classes (deterministic only)
◮ (Klebanov et. al.,) : program to SMT formula, count outputs
(deterministic, loop free only)
SLIDE 71 Related Work
◮ (K¨
- pf et. al.,) : iteratively refine equivalence classes (deterministic only)
◮ (Klebanov et. al.,) : program to SMT formula, count outputs
(deterministic, loop free only)
◮ (Biondi et. al.,) : forward symbolic execution - performance comparable to
sqifc
SLIDE 72 Related Work
◮ (K¨
- pf et. al.,) : iteratively refine equivalence classes (deterministic only)
◮ (Klebanov et. al.,) : program to SMT formula, count outputs
(deterministic, loop free only)
◮ (Biondi et. al.,) : forward symbolic execution - performance comparable to
sqifc
SLIDE 73
Tool demonstration
SLIDE 74
Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage
SLIDE 75
Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool
SLIDE 76
Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool ◮ Summary calculation is the overhead - BDD size (algebraic operations)
and variable orderings
SLIDE 77
Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool ◮ Summary calculation is the overhead - BDD size (algebraic operations)
and variable orderings
◮ Future work:
SLIDE 78 Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool ◮ Summary calculation is the overhead - BDD size (algebraic operations)
and variable orderings
◮ Future work:
◮ Recursive algorithms
SLIDE 79 Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool ◮ Summary calculation is the overhead - BDD size (algebraic operations)
and variable orderings
◮ Future work:
◮ Recursive algorithms ◮ Other symbolic model-checking frameworks - CEGAR
SLIDE 80 Conclusions and Future Work
◮ Symbolic algorithms for measuring information leakage ◮ Interagble in any BDD based reachability analysis tool ◮ Summary calculation is the overhead - BDD size (algebraic operations)
and variable orderings
◮ Future work:
◮ Recursive algorithms ◮ Other symbolic model-checking frameworks - CEGAR
SLIDE 81
Thank You !