完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 ·...
Transcript of 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 ·...
![Page 1: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/1.jpg)
完善保密加密、计算复杂性
裴士辉
QQ:1628159305
香农(Claude Elwood Shannon,1916年4 月30日-2001年2月26日),美国数学家、
电子工程师和密码学家,被誉为信息论的
创始人。
![Page 2: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/2.jpg)
2
完善保密加密
![Page 3: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/3.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3
离散的随机变量
定义 一个离散的随机变量,比方说 X,由有限集合 X
和定义在 X 上的概率分布组成。我们用 Pr[X=x] 表示
随机变量 X 取 x 时的概率。如果随机变量是固定的,
我 们有 时缩 写成 Pr[x] 。对任 意的 x X , 有
0 Pr[ ] 1x ,并且
Pr[ ] 1x X
x
![Page 4: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/4.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 4
事件的概率
假设我们有定义在集合 X 上随机变量 X,E X 。X 在
子集 E 上的取值的概率可由下式计算:
Pr[ ] Pr[ ]x E
x E x
子集 E 通常称为事件。
![Page 5: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/5.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 5
例
假设随机抛一对骰子。我们可以用一个随机变量 Z 来
刻画这个过程。这个随机变量定义在集合
{1,2,3,4,5,6} {1,2,3,4,5,6}Z
上,并且对于任意的( , )i j Z ,Pr[( , )] 1/ 36i j 。考虑
两个骰子的和。每一可能的和都定义了一个事件,给
出两个骰子的和为 4 对应的事件表示和对应的概率。
![Page 6: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/6.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 6
联合概率和条件概率
定义 假设 X 和 Y 是分别定义在有限集合 X 和 Y
上的随机变量。联合概率Pr[ , ]x y 是 X 取 x 并且 Y
取 y 的概率。条件概率Pr[ | ]x y 表示 Y 取 y 时 X 取 x
的概率。如果对任意的 x X 和 y Y ,都有
Pr[ , ] Pr[ ]Pr[ ]x y x y ,则称随机变量 X 和 Y 是统计
独立的。
![Page 7: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/7.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 7
Bayes定理
定理(Bayes 定理) 如果Pr[ ] 0y ,那么 Pr[ ]Pr[ | ]Pr[ | ]
Pr[ ]x y xx y
y
![Page 8: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/8.jpg)
8
例 假设 { , }a b 满足 Pr[ ] 1/ 4,Pr[ ] 3 / 4a b 。设
1 3 3{ , , }K K K 满 足 1Pr[ ] 1/ 2K ,
2 3Pr[ ] Pr[ ] 1/ 4K K 。设 {1,2,3,4} ,加密函数定义
为1( ) 1Ke a ,
1( ) 2Ke b ,
2( ) 2Ke a ,
2( ) 3Ke b ,
3( ) 3Ke a ,
3( ) 4Ke b 。这个密码体制可以有如下加密
矩阵表示:
1
2
3
1 22 33 4
a bKKK
1、计算的概率分布
2、计算给定密文后,明文空间的条件概率分布。
![Page 9: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/9.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 9
完善保密性
定义 一个密码体制具有完善保密性,如果对于任
意的x和 y,都有Pr[ | ] Pr[ ]x y x 。也就是说,
给定密文 y,明文x的后验概率等于明文x的先验概
率。
![Page 10: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/10.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 10
香农定理
定 理 假 定 密 码 体 制 ( , , , , ) 满 足
。该密码体制是完善保密的,当且仅当
每个密钥被使用的概率是1/ ,并且对于任意的
x和 y,存在唯一的密钥K使得 ( )Ke x y 。
![Page 11: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/11.jpg)
Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 11
一次一密密码体制
定义 一次一密
假设 1n 是正整数, 2( )n 。对于 2( )nK ,
定义 ( )Ke x 为K和x的模 2 的向量和(或者说是两个比
特串的异或)。因此,如果 1 2( , , ..., )nx x x x 并且
1 2( , , ..., )nK K K K ,则
1 1 2 2 2( ) ( , , ..., )modK n ne x x k x k x k
解密和加密是一样的。如果 1 2( , , ..., )ny y y y ,则
1 1 2 2 2( ) ( , , ..., )modK n nd y y k y k y k
![Page 12: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/12.jpg)
12
计算复杂性
![Page 13: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/13.jpg)
维基百科 13
计算复杂性
• 计算复杂性理论(Computational complexity theory)
• 是理论计算机科学和数学的一个分支,
• 它致力于将可计算问题根据它们本身的复杂性进 行分类,同时探讨这些分类之间的关系。
• 计算复杂性理论所研究的资源中最常见的是时间 和空间。对二者的度量分别是时间复杂性和空间 复杂性
![Page 14: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/14.jpg)
维基百科 14
时间复杂性
• 如果一个问题的规模是n,解这一问题的某一算法 所需要的时间为T(n),它是n的某一函数 T(n)称
为这一算法的“时间复杂性”。• 常用大O表示法表示时间复杂性。
![Page 15: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/15.jpg)
15
算法的时间复杂度
sum=0; ①
for(i=1;i<=n;i++) ②
for(j=1;j<=n;j++) ③
sum++; ④
![Page 16: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/16.jpg)
16
算法的时间复杂度
i=1; ①
while (i<=n)
i=i*2; ②
![Page 17: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/17.jpg)
17
算法的时间复杂度
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
for(k=0;k<j;k++)
x=x+2; ①
}
}
![Page 18: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/18.jpg)
18
Name Running time (T(n)) Examples
constant time O(1) 10
logarithmic time O(log n) log n, log(n2)
fractional power O(nc) where 0 < c < 1 n1/2, n2/3
linear time O(n) n
linearithmic time O(n log n) n log n, log n!
quadratic time O(n2) n2
polynomial time 2O(log n) = poly(n) n, n log n, n10
sub-exponential time(first) O( ) for allε > 0
sub-exponential time(second) 2o(n)
factorial time O(n!) n!
exponential time 2poly(n) 2n,
2n132n
2log log logn n
22n
![Page 19: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/19.jpg)
维基百科 19
复杂性类
• P(Polynomial)问题
– 可以在多项式时间解决的决定性问题。
• NP问题(nondeterministic polynomial time)– 可以在多项式时间验证答案的决定性问题。
• NP完全问题(NP-Complete)– 一个决定性问题C 若是为NPC,则代表它对NP是完
备的,这表示:
1. 它是一个NP问题,且
2. 其他属于NP的问题都可归约成它。
• NP-hard问题
– 一个问题是NP-hard问题当且仅当存在一个NP完全问 题可以归约成它。
![Page 20: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/20.jpg)
维基百科 20
复杂性类
![Page 21: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/21.jpg)
维基百科 21
第一个NP完全问题
• 逻辑电路问题是指的这样一个问题:给定一个逻辑电路, 问是否存在一种输入使输出为True。
• 一个逻辑电路由若干个输入,一个输出,若干“逻辑门” 和线组成。
![Page 22: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/22.jpg)
维基百科 22
背包问题
• 背包问题(Knapsack problem):给定一组物 品,每种物品都有自己的重量和价格,在限定的 总重量内,我们如何选择,才能使得物品的总价 格最高。
![Page 23: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/23.jpg)
Jonathan Katz and Yehuda Lindell,Introduction to Modern Cryptography 23
现代密码学的基本准则
1. 形成精确的定义
2. 精确的假设依赖
3. 严格的安全证明
“若给定假设X是正确的,根据给定的定义,构造 方案Y是安全的“
![Page 24: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/24.jpg)
Christof Paar,Jan Pelzl. Understanding Cryptography. 24
针对蛮力攻击对称密钥的长度
密钥长度 安全性评估
56-64位 短期:需要几个小时或几天破解
112-128位 长期:在量子计算出现之前,需
要几十年才能破解
256位长期:即使使用量子计算机运行
目前已知的量子算法,也需要几
十年才能破解
![Page 25: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/25.jpg)
25
现代公钥密码的基本假设
• 假设如下问题没有多项式时间的破解算法:
1. 大整数的因式分解问题
2. 离散对数问题
3. 椭圆曲线离散对数问题
![Page 26: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/26.jpg)
26
量子计算
• 量子计算思想的提出– Richard Feynman 1982
• 量子图灵机模型– David Deutsch 1985
• Shor算法(Peter Shor 1994)– 多项式时间分解大数质因子
![Page 27: 完善保密加密、计算复杂性cc.jlu.edu.cn/Download/20140830184212644.pdf · 2014-11-19 · Douglas R. Stinson,Cryptography Theory and Practice(Third Edition) 3. 离散的随机变量.](https://reader036.fdocuments.net/reader036/viewer/2022081507/5b92026c09d3f204338d02d7/html5/thumbnails/27.jpg)
ir. Bart Preneel,Multivariate Quadratic Polynomials in Public Key Cryptography 27
对抗量子计算的困难问题
• Multivariate Quadratic Polynomials(多元二次多项 式)
1 1 1 1 11 1
, , ,( , , )n
n j k j k j jj k n j
p x x x x x
… …
11 1
, , ,( , , )n
i n i j k j k i j j ij k n j
p x x x x x
… …
11 1
, , ,( , , )n
m n m j k j k m j j mj k n j
p x x x x x