CS-course
, booknote
, security
Textbook: Foundations of cryptography
假設 random function 是隨機的(得出得結果沒辦法用函數式的方式得出)。一般以建 table 得出。
IND : 訊息不可分辨。例如給一個密文與兩個明文,經過多次猜測後,猜對的機率仍是二分之一。
A chosen-plaintext attack (CPA) is an attack model for cryptanalysis which presumes that the attacker can obtain the ciphertexts for arbitrary plaintexts.
定義什麼是安全性,要准許攻擊者有哪些資源。
CCA: 攻擊者給密文,得到明文。挑戰:當得到密文,要能夠分辨明文。
EUF-CMA (Choosen Message Attack)
unforgeable: 對一個簽章,沒辦法在任何訊息下找到一個配對可以通過驗證。
Reduction
證明若 Q 則 P ,以若非 Q ,則非 P 反證。
Seq. of Game
利用多個 Game (假設),其中一個為隨機另一個是要證明的。並驗證要證明的機率減去隨機的機率是小於一定程度(可忽略的)。
作業:用文字描述證明。
在 Introduction to Provable Security 投影片的第 29 頁有 Goldwasser-Micali 的機率式加密系統的簡化描述,請參考前一頁的 ElGamal 加密機制的 IND-CPA 安全性證明,描述一下 Goldwasser-Micali 加密系統滿足 IND-CPA 安全性的證明。
首先,定義 Quadratic Residuosity 為何:
一個整數 X 對另一個整數 p 的二次剩餘(指 X 的平方
已知
若要符合 IND-CPA ,則必須使
Perfect security is for signature
#Keys >= |MsgSp|
For all m1, m2 from MsgSp, for all c from C
Pr{f(m1) = c} = PR{f(m2) = c}
The adversary sees the same distribution of ciphertext, regardless of the message send, i,e, perfect. message indistinguishability (implies computaionally IND)
Perfect secrecy 的話, Key 的個數大小至少 messages 的大小大於或等於。
# of distinct ciphertexts for each key k_i
<= # of distinct ciphertexts for each message m_j
<= # of keys
One-time pad is great, perfect secrecy but is ineffiecent.
Efficiency is important in modern system.
Pr{M = m|Ek(M) = c} = Pr{M = m}
M is a distribution on MsgSp.
An encryption scheme satisfies Shannon Secrecy with respect to M if for all m from MsgSp, for all c from C.
從看到 ciphtext 得到的明文的機率分佈,跟沒有看到 ciphtext 的明文幾率分佈是一樣。
=> shannon Secrecy == Perfect Secrecy
Perfect Secrecy 是很沒有效率。
key 的大小要大於等於 message.
X: nonnegative random variable,
v: real number
Pr{x >= v} <= E(x)/v
NOTE
在 t 倍的標準差以外的機率會是
所以,如果是兩個標準差以外,會是
X: random variable, delta > 0
Pr{|X - E(X)| >= delta} <= Var(X)/(delta)^2
Chebyshev Inequality 的公式延伸。
做越多次 sampling ,他在尾巴的副份的分布機率會越來越小。
Chebyshev Inequality 的公式延伸。
用於 binary distribution 。
Three different theory:
Q is the set of states
is the input alphabet not containing the special blank symbol
is the tape alphabet, where and
只要有個 NTM 他執行結果是 accepted state 的機率不是零,則可為 NP 。
如果機率不是一半 (1/2) ,則會指其為 NP 當中的子集合 BPP 。
NTM 可以在 O(P(n)) 時間轉換成 DTM 。但轉換後時間花費會變成
NP and NP-hard
strong/weak assumption
判斷一個問題是不是 NP ,從理論上來說建立起一個 Non-deterministic Turing Machine (NTM) 並且在 P 時間內走到 accept 就是 NP。
但通常這會很難去建立,因此會以在有解法的情況下,是否可以在 parallel 的驗證情況下,以 P 的時間內做完驗證。
任何一個在 NP-complete set 中,可以找到 Poly 的解。則可拓展到其他問題。
NP-complete: 所有 NP 的問題,例如 searching shortest path,都可轉成 (reduced) 此 set 中的問題 ,而此子集合中問題看起來都是 exponentail time (以驗證 P 時間花費來歸類為 NP),因此要證明此子集合是否為 Polynomial time 。
NP-hard 的問題,不一定是 NP ,但至少跟 NP-complete 一樣難。
Strong/Weak Assumption
只有 perfect securcy (length of key >= length of message) 是不需要 adversary model ,就算 adverser 擁有無權大的計算能力,他依然是
的機率。
在有效率、非 perfect securcy 的安全機制下,需要利用 adversary model 證明安全性。並且敵人的模型不能是擁有無窮大的算力,因為安全機制證明會沒有意義。
Algorithm:
利用機率式的 Turing Machine 定義出來,並且 accept 的機率不能是 1/2 。
目前還不能確定 BPP 在 NP 裡頭,還是只有部分重疊。
我們的加密機制會希望位於 NP 裡頭,但不在 BPP 之中。因 BPP 會是敵人的模型。
在
的右式已經是最小得值了。
Notion of rareness: a rare event should occur rarely even if we repeat the experiment for a feasible number of times p(n). 機率小到重複執行 p(n) 次都還是很小,因此可以忽略。
為 80 年代所常用的表示方法。
|x| 指的是 x 的長度。
The definition of perfect security:
For all m1, m2 from MsgSp, for all c from C
Pr{f(m1) = c} = PR{f(m2) = c}
The adversary sees the same distribution of cipher text, regardless of the message send, i.e, perfect. message indistinguishability (implies computationally IND)
The definition of IND-CPA:
The messages are unrecognizable. e.g., give one cipher text and plain text, the probability of successfully guessing always is 1/2.
Assume that there are the two string of bytes, which one is cipher text and the other is plain text.
Under the perfect security, the adversary sees the same distribution of cipher text, regardless of the plain text.
So, the success guessing probability for each bit is 1/2 (which from the 0/1 bit).
As a result, this kind of distribution is satisfying the IND-CPA secure.
(a) If no one can solve the Decision TSP problem, then system S is secure.
Is NP-Complete.
This assumption is weak.
(b) If no one can solve the Search TSP problem, then system S is secure.
Since this assumption is not NP, but it's difficult level is at least as hard as the hardest problems in NP (so it called NP-hard). Moreover, it assumes that the level they have is at least as same as hardest in NP, it has more assumption that former one. Therefore, this assumption is stronger than (a) statement.
(a)
negligible, Proof:
(b)
negligible: proof:
(c)
negligible, proof:
(d)
noticeable, proof:
Assume that
Afterwards, we need to prove that
Now, replace the
(e)
noticeable, proof:
This equation indicate that when n increased, the
(f)
noticeable, proof:
(g)
negligible, proof:
From the following graph, it indicates that the
(h)
non-negligible, proof:
The second statement will let the
So, it is non-negligible.
for "there exists an n >
" i.e. infinitely man n
The symbol ∃ means “there exists”. Finally we abbreviate the phrases “such that” and “so that” by the symbol or simply “s.t.”. When mathematics is formally written (as in our text), the use of these symbols is often suppressed.
所有函數不是 negligible 就是 non-negligible 。
如果是有限數的超越 1/p(n) ,則可視為 negligible 。因為可以定義在那之後都是。
但如果是無限數量的大於 1/p(n) ,則為 non-negligible 。
而 noticeable 則是在某個數後,全部都大於 1/p(n) 。
中右,第二項會求斜率。這邊是要找,在某一點大於某函數且之後斜率大於 0 ,因此可以判斷這之後都會在那函數之上。
Derivative of log
Three different type of BBP
Addiational
Circuit (or Tree) Representation of TM
Porbabilistic Poly time (PPT)
Ex. Possible candidate: multiplication n=p * q is easy, factoring n when n is huge is an NP problem.
NOTE
沒辦法證明一個函數是 one-way 。因為要把 f(x) 得到 x 的所有可能都驗證,很難。
會希望假設越少越簡單越好。
用機率的形式表示 one-way 的 hard to invert 。
For every probabilistic poly-time TM A' :
會如此表示
,是也想表達除了一對一以外,多對一時也是成立。
為 n 個 1 的字串。
But, for example, A(x) =
如果上述公式不含
every positive polynomial p(.) and all sufficient large n:
這種形式比之前的公式描述還嚴格困難。
f(.) is a strong one-way function if:
non-negligible
給予一個 f(x) ,只有一部分(不可忽略的 ; noticeable)x 集合沒辦法 invert ,則稱此為 weak one-way 。
noticeable
weak one-way:至少有 noticeable 的機率不可 invert 。
Strong one-way:可 invert 的機率是可忽略的。
OWF (One-Way Function)
Additional
One Way Function Exists =>
Some more implications about the “OWF exists” intractability assumption
= Domain
Hardcore Predicate 定義了給予 x 後,到底是什麼東西算不出來?
如果機率等於 1 ,說明 f(x) 不會隱藏 b(x) 。
因為現在數值是以二元方式表示,因此機率最低會是 1/2 。
b(x) 是 f(x) 相關,把 x 藏的最好的部分,並且 polynomial 的敵人在說 1 或 0 時,對或錯的機率都是 1/2 ,稱為 hardcore 。
任意 OWF 都存在 hardcore predicate 。
is important, it means that it is the XOR of a random subset of x's bits.
此說明,在 XOR 後的子集合,要判斷原先子集合有多少個 0 或 1 是很困難的。
此說明了,如果敵人可以在得知 f(x) 以及 random r 計算出 U(x, r) ,表示他的模型上有從 f(x) 得到 x 並在帶進 U(…) 的能力。也就是說,他可以從此模型當中,建立一個 a(…) 函式,得到 f(x) 的 invert (x 得值)。如果在一開始假設從 f(x) 得到 U(x, r) 的值是很困難的,則可稱有 one-way function 。
Q1. Show that the addition function
(where and and are interpreted as natural numbers) is not one-way. Likewise, show that when computed over the integers is not one-way.
For
For
Q2. Prove that if there exist one-way functions, then there exists a one-way function
such that for every , . Provide a full (formal) proof of your answer. This demonstrates that for infinitely many values , the function is easy to invert. Why does this not contradict one-wayness?
If
Then suppose that there have PPT algorithm A' can invert
And,
Therefore, we can get
This means
In addition, with infinitely many value
Q3. Prove that if
is a one-way function, then where is also a one-way function. Note that fully reveals half of its input bits, but is nevertheless still one-way.
Assume that there is an adversary A that, given
Q4. Let
and denote . Prove that if there exist one-way functions, then there exists a one-way function such that for every there exists an algorithm such that for chosen uniformly over ,
(This exercise demonstrates that it is not possible to claim that everyone-way function hides at least one specific bit of the input.)
For
Related to Quantum Algorithm
SVP shortest Vector Problem: Given a basis of L, find the shortest non-zero lattice vector
CVP Closest Vector Problem
SVP is NP-hard, best poly-time algorithm can do sub-exponential approximations: part of the difficulty of SVP comes from the fact that the given basis contains long vectors (much longer than the shortest non0zero vector)
If point t is on the lattice (or is origin point?), it is SVP.
Homomorphic encryption
兩個密文作互相運算後(例如相乘),相對應的明文還是跟計算後的密文有關係,則稱 Homomorphic encryption 。
(開根號 or 分解因式 mod m),是等效的。
能夠開根號就可以分解因式。通常在傳統計算機系統,會是為 one-way function 。
(PRNG) The output sequence is indistinguishable from a true random sequence by any efficient algorithm.
Traditional/statistical PRNG 只能滿足部分 statistical tests ,而 Cryptographic PRNGS 要滿足所有。
1024 bit entropy 等級的 1 Gb 資訊有沒有機率會等效於 1 Gb entropy 的 1 Gb ?
有。
1024 bit entropy 等級的 1 Gb 資訊有種排序,只要能分辨就可以。但 是遠比天文數字還大,沒辦法分辨是哪種。( 約等於全宇宙原子總數)
LFSR (Linear Feed back Shift Register)
Heuristic approaches of PRNG: programs that produce bit sequences that look like irregular and can pass some specific statistical tests, ex. FIPS 140-2 (monobit test, poker test, runs test, and long run test).
是指描述 sequence 的困難度。
或指可以產生 sequence 的 program 的最短長度。
Poly-time indistinguishable proof.
\
means excluding.
統計上不可分辨 => 計算上不可分辨。但不能反證。
1 為可以分辨。此指
可與 分辨與否。
1-indistinguishable <=> m(n)-indistinguishable
如果給你兩個 X, Y 序列,如果給多個 X, Y 序列跟只給一次,兩者的不分辨的機率相同。
此定理從如果不能從看多個序列分辨得出來,那麼只看一次也分辨出來的邏輯,說明如果反過來,從看一次也分辨不出來,那麼看多次會不會也分不出來?(結論,對也分辨不出來)
D 為給予多次序列,全部都是 X 或全部都是 Y 的輸入,D 的行為會有所不同。因此可以分辨。
理論, m 個可以不分辨的,可得 1 個也不分辨。
反推,當 1 個是不能分辨的,可得 m 個也不能分辨。
在 Ploy time 的 algorithm 下,符合 pseudorandom 定義的 pseudorandom generator 可以取代 random 。
Pseudorandom generator 拉長 random ,多一個 bit 他的 statistically not close to uniform U 。
FC07, Page 44
PR (PseudoRandomness)
But how about X is PR <= X is Unpredictable?
證明:Start at FC-ch7, page 56.
結論:計算上來說,Unpredictability 和 Pseudorandomness 相等。
OWF (ony-way function)
Other proof : FC-ch7, page 66
一般來說, public key 的加密的秘文相當於發票。當有脅迫者拿著密文要求加密者給出明文,加密者沒辦法說謊。即使有 random 參數也是,因為脅迫者也可以要求交出 random number 。
註:加密者,通常不會解密。
因此 Deniable encryption 就是為了解決此問題。
如果加密可以挑到右上圖的 x 點也可以是之外的(x 點為 pseudo number generater 的輸出)。
要考量到,解密出來的文跟原先明文不同的機率是多少。 機率為
一般來說,
如果加密是一,可以說我有
可以拿
有人證明,例如 RSA 不只有 LSB 是 hardcore predicate (很難預測),他至少有一段都是 hardcore predicate 。
FC07, page 66 ~ 69, 1 - 4 slide pages are first prove.
如果說想要 random access PRNG 生成的 random sequence ,例如第一百位的數值,就必須要讓 PRNG 從零開始生成到第一百位才可以得知。
例如, x 為 n 的 bit ,就會有
Random function n bit generate n bit need
任意有效率的方式都沒辦法分辨 deterministic function F 和 truly random function H ,則可稱 F 為 Pseudorandom function.
如,就算給予 ploy(n) 的 D
PRF from PRNG proof, FC07, Page 119
在第 k 層的 之後都是 random 。
則是在第 k 層 之後都是 random 。
verifier and proofer.
Three types of zero-lnowledge: perfect (完全不可分辨), statistical (統計上不可分辨), computational.
右手邊的像天使的人,是公正的第三者。
此左右相等的意思是指左偏在證明時,是等效於右圖直接告訴此為正確的證明。並且,左圖在證明過程中是沒有洩漏重要訊息。
非交談式(沒有溝通)ZKP 不是 ZKP ,那已經算是數位簽章。
Zero information proof is not zero knowledge proof.
所有 NP-Assertion 都是 ZKP 。
有條件的:If one-way functions exist.
PPT (Probabilistic Polynomial-Time)
每一次 V 做驗證時,因為 P 會有
One-way permutation 有 1-to-1 的特性,而 one-way function 事 many-to-1 特性。因此,若用 one-way function 會比 one-way permutation 還要來得複雜。
Binding: 間單說,P 傳給 V 的訊息不會被竄改。
Binding: Perfect / Hidding: Computational
Binding 和 Hidding 通常是一個 trade off.
isomorphic