L04 – Plain RSA, Factoring, and Commitment Schemes
10,409字
44–66 分钟
Summary of Lecture 3
The set
- Euler’s Phi Function:
Euler’s theorem Let and . Then .
- Fermat’s Little Theorem: If is a prime, then .
RSA:
Example
EXAMPLE: this is a toy example; all numbers are very small
RSA Security
Security: Without , it’s difficult to learn from
- At least, it should be difficult to learn from
Plain RSA and Integer Factoring (given , find ):
- “Factoring is easy”“Plain RSA is not secure”
- : computable with EEA
- “Plain RSA is secure”“Factoring is hard”
- “Factoring is hard” “Plain RSA is secure” //not proved
- It is likely that “Factoring is hard”“Plain RSA is secure”
- The best known method of computing is via factoring
How Large is the in practice?
- is recommended from present to 2030
- is recommended after 2030
Example
EXAMPLE: A sample execution of the RSA public-key encryption.
- 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624225795083
- 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624227077847
- 32317006071311007300714876688669951960444102669715484032130345427524655138867890893197201411522913463688717960921898019494119559150490921095088152386448283120630877367300996091750197750389652106796057638384067568276792218642619756161838094338476170470581645852036305042887575891541065808607552399123931212190742861198666048560131098081430518774846347259215332611759149330725252437276424147817808729273755165527379964561074264587032664709511346018327798373715290148129504141795132314929388992688247440232727539575514688633282447719228530664706520939357878528540284184156513405575872085703420500969966917951381310826301
- 32317006071311007300714876688669951960444102669715484032130345427524655138867890893197201411522913463688717960921898019494119559150490921095088152386448283120630877367300996091750197750389652106796057638384067568276792218642619756161838094338476170470581645852036305042887575891541065808607552399123931212190383322571693585378585237043272713828122751863426871297212289168409787085665422221552391774628940093485139736801331477871715085171882512773342103512436341899373968354945401344376784553485755251993821373671344677095606146354543604901758694718276224054213583162787340809095977593826461068360296205292132857953372
- 15
- 4308934142841467640095316891822660261392547022628731204284046057003287351849052119092960188203055128491829061456253069265882607886732122812678420318193104416084116982306799478900026366718620280906141018451209009103572295819015967488245079245130156062744219446938174005718343452205475441147673653216524161625384443009559144717144698272436361843749700248456916172961638555787971611422056296206985569950525345798018631573510863716228678022917668369778947134991512253249862447326053512583571273798100700265842849822845956946080819513939147320234492629103496540561811088371645441212797012510194809114706160705617714393783
- 10604921754758721445761654694144853008952777608280437615045472365621528740679915569270051503191522500036448557172487959011926112038398359402756573149541644330968641767630622070720630061130259783825355948223371330949158036812742187057045604934546811790948975878200144189048344249873200320299277234465689039409989622319232683984241843711183212001991457793528752812978134072787404790207031482099444968252108690296363773578594703102617386738297675080295774091447240197521221546035459030086538114428516078644733180655540109133778241607260273655335661777894173665137928787960365220712025120785257907244561721692764755210375
- 10526389958138962919595594093411158893099743508465902347128478139908774614311778097354795345791726768384252751637693995592403757856185437083738829836072472243389583367910268799453378039419721345566549516730187308436864460088396611726670050723242080139176080334720294195304048915003805656341816548307249886049027910488249318660062714335703057576576016988513484148308512574950252535463185824865665499749033598201370342142901944632549253564037639312442875039735826909329356840665993783695101447610485922726915969967968584661240430425982194189504400469889762574275824269475495394920107921066723277769226199475558068627049
Commitment Scheme (for SI120)
DEFINITION: A non-interactive commitment scheme consists of three algorithms as follows
- : Takes a security parameter as input, outputs the public parameters of the system;
- : Takes a message as input, outputs a commitment and an opening value ;
- : Takes the commitment , the message , and an opening value as input, and outputs
1(accept) or0(reject).
and satisfies the following properties:
- hiding: the commitment reveals nothing about .
- binding: it is hard for the committer to output a commitment and later output two pairs and such that but .
CONSTRUCTION: a commitment scheme based on RSA encryption
- : Do nothing; the is empty.
- :
- Choose as per ;
- Compute ;
- Output and
- : Outputs
1iff the following equalities are all true:- ;
- ;
Security Analysis:
- hiding: Given , it is hard to learn //this is ensured by RSA’s security
- binding: . Is it possible that but ?
- The above equalities imply that
RSA Implementation
CONSTRUCTION: , the message space is
- choose two -bit primes
- choose s.t. ,
- output
- :
- output
- output
- :
- output
- output
Questions
- Choose efficiently?
- Prime Number Generation
- Compute efficiently?
- Extended Euclidean Algorithm
- Compute / efficiently?
- Square-and-Multiply
1977, Rivest, Shamir and Adleman: A method for obtaining digital signatures and public-key cryptosystems. MIT/LCS/TM-82. (Turing Award 2002)
Addition
Binary Representation of an integer : a 0-1 sequence / binary string such that
Bit Length of Integer :
Algorithm for Addition:
- Input:
- Output:
- for to do
- set and such that
- for to do
- Complexity: bit operations
Big O notation:
© 版权声明
文章版权归作者所有,未经允许请勿转载。





commitment scheme的params为空是不是意味着不用额外参数?
模运算那里确实跳得快,得自己推一遍才明白
e=5在实际中肯定不会用吧,太小了容易被攻击
之前做密码学作业差点被RSA搞疯,生成素数太折磨了
绑定性质那边多看两遍就懂了,画个图更好理解
平方乘算法是不是就是不断平方然后相乘?
平方乘不就是把指数拆成二进制,边平方边乘?比如2^13=2^8*2^4*2^1这样?
这些大数例子,除了让人晕还有啥用?
大数例子确实看着头疼,但理解原理挺重要的
感觉数论基础差的话,看这个确实费劲。
模运算那里跳得有点快,一下子没跟上。
这文章是不是缺了点实际应用的例子?
3072位的N,现在的电脑算起来也费劲吧?
3072位现在普通服务器能跑,就是慢点
e=5也太小了吧,实际用不怕被攻击吗?
绑定性质那部分确实绕,感觉需要画个流程图才清楚。
之前搞过RSA实验,光生成大素数就卡半天。
那个平方乘算法具体咋操作啊?没太明白。
其实就是把指数二进制拆位,遇1就乘当前结果,代码网上一搜就有
平方乘就是先平方再选择乘,具体步骤网上有视频讲解
平方乘就是把指数转二进制,边平方边乘,比如算a^13就按1101来
这些数学符号看得我头疼,根本读不下去。
那个commitment scheme的验证过程,params为空是啥意思?
params为空就是不用传额外参数,直接用RSA那套就行
感觉数论不行看这个确实费劲,得先补补模运算
模运算那块跳得我脑壳疼,得翻书补欧拉定理才行
这大数例子是直接复制粘贴的吧,谁看得完啊😂
e=5这种小公钥指数是不是有已知攻击来着?
3072位密钥,普通电脑跑一次加密要多久?
3072位密钥现在跑起来应该还行吧,再过几年就难说了
普通电脑跑3072位加密?我笔记本风扇先炸了
普通电脑跑3072位加密也就几毫秒吧,别被数字吓到
绑定性质那个证明看晕了,有没有更直白的解释?
感觉数论基础不行看这个好吃力
这些大数看着像天书,完全看不懂
这大数堆得跟乱码似的,眼睛都花了
模运算那里跳得太快了,怎么就从2^145变成2了
e=5在实际中肯定不会用,太小容易被攻击
RSA直接加密确实有问题,实际都用OAEP吧
OAEP是必须的,不然确定性加密直接完蛋
commitment那个绑定性质有点绕,需要多看几遍
3072位的N看着就头大,这得算到啥时候
手算2^145 mod 91?我直接放弃hhh
手算那个例子其实可以试试,数字小反而好理解
ϕ(N)算出来就能解密,那保护p,q真关键
p和q要是泄露了,整个RSA就白搭,太致命了
感觉plain RSA直接加密不太安全吧
平方乘算法讲得太简略了,具体咋实现的?
平方乘不就是反复平方和乘法么,具体实现要看模数大小
那个commitment scheme是不是依赖RSA安全性啊?
这例子p=7 q=13也太小了,用来理解倒是挺直观
平方乘算法能展开讲讲吗?光看名字不懂啊
e=5也太随意了吧,实际会这么选吗?
这例子数字小得我都想手算了😂
之前搞过RSA实验,光生成大素数就卡半天
大素数生成确实折腾,我当时跑了一晚上才出来一个
大数分解真就这么难?3072位看着就头大
模运算那块例子举得挺清楚。
例子确实通俗易懂。
RSA的例子看着像天书。
绑定性和隐藏性这俩概念还挺绕的。
我也经常搞混这两个概念。
平方乘算法那块挺实用。
确实实用,经常用到
承诺方案那段没太看明白,能再展开讲讲吗?
RSA的安全性主要靠大数分解难吗?
我也一直有这个疑问
例子里的p和q选得也太小了,7和13真的能安全吗?
我也觉得,例子就是演示用的
大N2048位,现在够用吗?
绑定性和隐藏性讲得蛮清楚。
这篇的符号太多,直接看成天书
例子里的N也太大了,看着都晕
同感,数字太大看着累
之前密码学课大作业就是实现RSA,调那个扩展欧几里得调了一晚上
手算2^145 mod 91?我直接放弃,这谁顶得住啊
这RSA例子数字小得我都想手算了😂
小数字例子确实适合理解原理,手算也没问题