[IT-Security-2] Secure Multi-Party-Computation (SMPC)
Secure Multi-Party-Computation (SMPC)
Notes from RWTH Aachen University course
“IT security 2” Wintersemester 2019/20
professor: Meyer, Ulrike Michaela
Goal
- Traditional
- trust
- insecure channel
- Multi-party computation
- do NOT trust
- distributed
- private
Millionaire Problem
Problem
- if i≥j ?
- {yA=yB=1⟺j≤iyA=yB=0⟺j>i
Solution
- 假設 1<i,j<10
B 有 j million
隨機選擇 N-bit 的 x
計算 EA(x)
把 EA(x)−j+1 傳給A
A 有 i million
對於 u=1,...,10 計算
yu=DA(EA(x)−j+u)若 u=j,則 yu=x
隨機選則 N/2-bit 的質數 p
對於 u=1,...,10 計算
zu=yu mod p若 u=j,zu=x mod p
把 p,z1,...zi,zi+1,...,z10+1 傳給
B
若 zu 的差沒有超過2
重新選擇 p
確保 za+1≠zbB
檢查第 j 個值是否等於 x mod p
如果是: j≤i
else: j>i
告訴A 結果
Note:
{if j in (z1,...,zi),⇒zj=yj=DA(EA(x)) mod p=x mod p⇒j th=x mod p⇒j≤iother zu=yu mod p=DA(EA(x)−j+u) mod p⇒unknown to Bif j in (zi+1+1,...,z10+1),⇒zi+1+1=yi+1+1=DA(EA(x)−j+i+1)+1 mod p⇒unknown to B
可以是 random order,B 只要檢查 x mod p 是否在裡面
Leakage
- 定義
A 的回傳值 wu={zu , if u≤izu+1 , if u>i
- 若存在 u∗ 使得 wu∗,wu∗+1 差剛好 2,且 wu∗<wu∗+1
則B 可以知道 i≠u∗
因為 wi<wi+1 永遠不會相差 2
- 定義
Semi-honest & malicious
Semi-honest (honest-but-curious/ passive)
- follow protocol
- 但想知道更多 information
Malicious
- 違反protocol
- 使違反 unattractive
- 說謊
- 無法避免
- 違反protocol
Correctness & Security
Correctness
- 正確計算 function f
- 像有trusted third party一樣
Security
- 違反者不能得到更多訊息 (從input/ 結果得知)
- example
- 三人投票,一人說no,兩人說yes
- 則說no的會知道其他人說yes
Terms
Distance
- 兩個在 set X 中離散機率分佈 A,B 的 Distance為
- 12×∑x(|Pr(A=x)−Pr(B=x)|)
- 兩個在 set X 中離散機率分佈 A,B 的 Distance為
Probability ensemble
- ensemble Ai,(i∈I) 是一個離散機率分佈的set
negligible
- 一個函數 f(n) 逐漸小於多項式 p 的倒數
- for each p(n), ∃ mp such that
|f(n)|<1p(n),∀n>mp
equal
- ensembles Ai,Bi are equal
statistically close
- dist(Ai,Bi) 對所有 I 中的 i 是 negligible function
computationally indistinguishable Ai≈Bi
- 對所有 probabilistic polynomial-time algorithm D
|Pr(D(Ai)=1)−Pr(D(Bi)=1)| 對 i 是 negligible function
- 對所有 probabilistic polynomial-time algorithm D
SMC definition
First Attemp
- 計算 f(XA,XB) 是安全的
- 如果有 Simulator algorithm SA,SB
- Correctness
- (yA,yB)≈f(xA,xB)
- Security
- viewA(real protocol)≈SA(xA,yA)
viewB(real protocol)≈SB(xB,yB) - corrupt party 的 view 可以由他的 input/output simulate
- viewA(real protocol)≈SA(xA,yA)
- 不能用在 randomized functionaility
- f(b),其中 b 是 random bit
- A 隨機選 random bit
- A 送 b 給 B
- A 輸出 b
- 正確但 insecure 因為 B 不能知道任何訊息
定義
- Security
- viewA(real protocol,yB)≈(SA(xA,yA),yB)
viewB(real protocol,yA)≈(SB(xB,yB),yA)
如果違反者的 view 跟 honest 的人的 output 相關
simulator 可以 capture 此相關性 - viewA(real protocol,yB)≈(SA(xA,yA),yB)
- Security
Homomorphic Encryption
Semantic Secure
- 實驗流程
- A 選擇一組 plaintext (m0,m1)
- 隨機選擇 b∈{0,1}
計算 c=E(mb)
傳給 A - A 猜測 b′∈{0,1}
- return{1,if b′=b0,otherwise
- semantic secure ⟺ 任何 polynomial-time 的 A,存在一個 negligible function μ 使得
Pr[b=b′]−12≤μ(n)需要 E 是 probabilistic
- 實驗流程
Homomorphic Encryption
- plaintext (P,+)
- ciphertext (C,⊗)
- E:P→C
- additively homomorphic
- E(m1+m2)=E(m1)⊗E(m2)
- fully homomorphic encryption
- additively and multiplicatively
Paillier
- public key: (N,g)
- N is a RSA modulus
- g∈Z∗N2
- plaintext (ZN,+)
- ciphertext (Z∗N2,⋅)
- E(m,r)=gmrN mod N2
- r∈Z∗N
- Homomorphic addition
- E(m1)+hE(m2):=E(m1)⋅E(m2)=E(m1+m2)
- Homomorphic scalarm multiplication
- a×hE(m):=(E(m))a=E(a×m) for a∈Z\{0}
- Ciphertext blinding
- Blind(E(m)):=E(m)+hE(0)
Private equality checking
Goal
- B 和 A 想要 A 確認是否 a=b
Protocol
A
計算 E(−a)
B
選擇隨機數 r
計算 E(b)
計算 E(b−a)
計算 E(r(b−a))
計算 E(r(b−a)+b)皆用 additively homomorphic
A
解密 E(r(b−a)+b)
若為 b==a ,則 a=b
反之為一隨機數
Private set intersection
Goal
- B 和 A 想要 A 找出 SA∩SB
Protocol
A
計算多項式 f(X)=Π(X−ai)(i=1,...,k)=Xk+ak−1Xk−1+...+a0
計算 E(ai) 並傳給 BB
選擇隨機數 ri(i=1,...,k)
計算 ci=E(rif(bi)+bi) 並傳給 AA 和 B 的 set 個數相等為 k
A
解密 E(rif(bi)+bi)
看哪個對應到自己的 aif(bi)=0 如果 bi=aj
Binary Less-Than Protocol
Threshold Paillier
- Idea: split the private key
- 用 Shamir’s secret sharing
Less than with shared output
- Goal: A 知道 oA,B 知道 oB
oA⊕oB 隱含 b<b′
(但 A,B 都不知道 b,b′) - Idea: b<b′⟺b′(1−b)=1
- Assumption:
πMult(E(x),E(y))=E(x⋅y)
所有人可以知道結果但不能知道 x,y
- Goal: A 知道 oA,B 知道 oB
Protocol
A
B
input: E(b),E(b′)
計算 πMult(E(1−b),E(b′))=E(c)B
oB←rnd{0,1}
E(c′):={blind(E(c)) , if ob=0blind(E(1−c)) , otherwiseA
B
解密 E(c′)
只有A 知道 c′
設 oA=c′
A output oA
B output oB

留言
張貼留言