Summary of Lecture 4
Security of RSA: Without , it’s difficult to learn from
- “Factoring is easy” “Plain RSA is not secure”
- “Plain RSA is secure” “Factoring is hard”
- “Factoring is hard” “Plain RSA is secure”? //not proved, likely true
Commitment Scheme:
- hiding:
- binding: and ? Impossible
CONSTRUCTION: based on RSA
- Com:
- Ver:
RSA Implementation:
- choose efficiently? compute efficiently? compute / efficiently?
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 //
- Complexity: bit operations
Big O notation:
Subtraction
Algorithm for Subtraction:
- Input: //
- Output: //
- for to do
- //
- set and such that //
- Complexity: bit operations
Multiplication
Algorithm for Multiplication:
- Input: //
- Output: //
- for to do
- if , then ;
- ;
- Complexity: bit operations
Division
Algorithm for Division:
- Input: //
- Output: and //
- for down to do
- //
- If , then // and
- while do
- output and
- Complexity: bit operations
Example:
Arithmetic Modulo
THEOREM: Let . Then
- can be computed in bit operations
- are computable in bit operations
- : computable in bit operations
- can be computed in bit operations
- is computable in bit operations
- : computable in bit operations.
Modulo exponentiation: For
- Complexity? How to compute efficiently?
EXAMPLE: modulo exponentiation
- 143733911392049898163790620742447116344546040644898141520376037626365007809899615665793895112104794373551079787727363529151277801402630305742433442340983358787394193855033926469913603762712163723160462115649025
- 46310011625494823943446873944318243690297367227688331207962573871391818800156614404181253994785434292576255362553884181998492463297303466464428022018327564723810228367576715525319623371983456905064392494176785
- 245246644900278211976517663573088018467026787678332759743414451715061600830038587216952208399332071549103626827191679864079776723243005600592035631246561218465817904100131859299619933817012149335034875870551067
- 245246644900278211976517663573088018467026787678332759743414451715061600830038587216952208399332071549102628322861627039184220494270313938703906283392288487724394251766892786817697178343799758481228648091667216
- Complexity: multiplications modulo
- ?
–very slow
Square-and-Multiply
ALGORITHM: (200 BC) compute in polynomial time
- Input:; //
- Output:
- Square: this step requires multiplications modulo
- Multiply: this step requires multiplications modulo
- Complexity: multiplications modulo
–fast
EXAMPLE: Compute using square-and-multiply.
- Input:
- Square: multiplications modulo will be done
- Multiply: at most multiplications modulo will be done
Time-Lock Puzzle
Question: The fastest method of computing ? Square-and-multiply?
MIT LCS35 Time Capsule Crypto Puzzle:
- LCS 35th Celebration (April 12-13, 1999)
- By Ronald L. Rivest, Adi Shamir, and David A. Wagner
- Intrinsically Sequential Computations: Can’t be sped up using parallelism
- Creating the Puzzle:
- Create as the product of two primes
- Choose as the number of operations required
- Publish as the puzzle description
- Puzzle: compute
- Method: square-and-multiply (repeated squaring)
- Solution is
New puzzle: 2019-05-14 Expected to be solved in 2034
Modern applications: blockchain (green consensus)
Encrypting to the future
Question: Encrypt a message such that it can be decrypted (w/o key) in 35 years?
Encrypting a message to the future with TLP:
- Create a TLP with the aforementioned scheme. Record the primes .
- Compute quickly with the primes
- // is much smaller that
- Compute very quickly
- // Rivest, Shamir, Wagner, 1996
Analysis:
- With , it is very quick to compute and decrypt to
- With , it may take 35 years to compute and then learn
- Although Bernard Fabrot solved this with 3.5 years of computation
模幂运算这块挺绕的。
同感,需要多练几遍。
RSA那部分看得有点懵,再琢磨琢磨。
同感,那部分确实有点绕
时间锁那个例子,真有人算三年多啊?
这毅力也是没谁了
这算法名字挺酷的,平方乘。
时间锁这概念有点意思,感觉像现实版时光胶囊。
同感,未来感很强。
平方乘算法例子算得挺清楚的
模运算这块,二进制表示看着就头大。
RSA这玩意儿,学一次忘一次😂
反复平方法原来这么早就有了啊
算法历史挺有意思的
量子计算机真来了,时间锁是不是直接变废铁?
commitment scheme那块构造逻辑有点绕,回头再啃。
t设太大怕等几十年,设太小又秒破,难搞。
模幂运算看着简单,实际debug到凌晨😭
我之前调库都调吐了,自己实现根本不敢想。
binding性全靠大数分解撑着,有点悬。
现在谁还敢用plain RSA,不加padding等于裸奔。
除法算法里的while循环感觉容易出bug啊。
那个LCS35谜题真有人跑3年多?佩服耐心😂
反复平方快是快,但缓存小的设备估计扛不住。
手算验证了下例子,确实是8,中间步骤没错。
现在还有人真用plain RSA?不加padding太危险了
反复平方快是快,但缓存不够的设备怕是要卡死
看着2^t mod φ(n)就头皮发麻,不敢想写错一步
除法算法里那个while循环边界容易崩吧
这commitment scheme要是p q泄露就全完了啊
平方乘算法还挺巧妙的。
确实,很巧妙的设计
这模幂运算的复杂度推导看得我头大,有没有人画个流程图?