SlideShare a Scribd company logo
RSA
and Elliptic Curve Cryptography
Kevin Zhuang
RSA 簡介
 RSA加密演算法是一種非對稱加密演算法,在公開金鑰加密和電子商業中被廣泛
使用。
 RSA是由羅納德·李維斯特(Ron Rivest)、阿迪·薩莫爾(Adi Shamir)和倫納德·
阿德曼(Leonard Adleman)在1977年一起提出的。
進入主題前,先介紹歐拉函數
 Φ 函數 歐拉函數 對 正整數 n , φ(n) 表示小於或等於 n 與 n 互質的數的個數。
 Φ(5) = 4
 Φ(8) = 1 3 5 7 = 4
RSA 建立公鑰私鑰流程
 取兩相異質數 p 跟 q
 計算 N=pq
 取 r = Φ(N) = φ(p) φ(q) = (p-1)(q-1)
 取 e , 1<e<r 且 e 跟 r 互質
 (N, e) 為公鑰
 取 d , 使得 de ≡ 1 (mod r) (模反元素)
 (N, d)為私鑰
 銷毀 p 跟 q
加密過程
 公鑰KU=(N, e),私鑰KR=(N, d)。
 加密步驟,
 Alice 做了一把公鑰 KU 跟私鑰 KR,Bob 要傳遞訊息 M 給 Alice,Bob 用Alice 的
公鑰KU 把 M 加密
 C = M^e (mod N) , C 為 Bob 要傳遞給 Alice 的密文
 解密步驟
 Alice 收到 訊息 C 用KR 解密
 M = c^d mod N
實際範例
 取 p = 3, q = 11, N = 33
 取 r = Φ(33) = φ(3) φ(1) = (2)*(10) = 20
 取 e = 3 (3跟20 互質)
 公鑰為 (33, 3)
 取 d = 7 , 使得 de ≡ 1 (mod r) (模反元素)
 私鑰為 (33, 7)
模反元素
d e*d = 3*d (e*d) mod(p-1)(q-1) = (3*d) mod 20
1 3 3
2 6 6
3 9 9
4 12 12
5 15 15
6 18 18
7 21 1
8 24 3
9 27 6
 要傳送訊息 m: key (11, 05,25)
a b c d e f g h i j
01 02 03 04 05 06 07 08 09 10
k l m n o p q r s t
11 12 13 14 15 16 17 18 19 20
u v w x y z
21 22 23 24 25 26
加密中 公鑰 (33,3)
 要傳送訊息 m: key (11, 05,25)
 C1 = (11) ^3 (mod 33) = 11
 C2 = (05) ^3 (mod 33) = 31
 C3 = (25) ^3 (mod 33) = 16
 加密的訊息 (11, 31, 16)
解密中(私鑰 33,7)
 加密的訊息C (11, 31, 16)
 M1 = (11) ^7 (mod 33) = 11
 M2 = (31) ^7 (mod 33) = 05
 M3 = (16) ^7 (mod 33) = 25
 解密訊息( 11, 05, 25 ) = key
RSA 破解的困難度
 N,e 是公鑰,而要從公鑰反推回去私鑰必須要破解 N 是哪兩個質數所組成的
 N = 27928727520532098560054510086934803266769027328779773633
51762493251995978285544035350906266382585272722398629867
67263282027760422651274751164233304322779357458680526177
93594651686619933029730312573799176384081348734718092523
53476550057243981913102899068449856388885987417785575633
66522578044678796800808595716146657069948593436088106761
86674067708949755093039975941211253008157978789036441127
01109572656021257137086334620169063315388954284609394192
32250643688514600699603929824545296848370051254650037973
10139479221307918200583851065828489354285517184240655579
549337386740031302249496379882799360098372401884741329801
參考資料
 費馬小定理的證明
 https://www.youtube.com/watch?v=eYjuqLfJeQc&t=49s
 https://www.youtube.com/watch?v=0Bk1fyvGq3Y&t=1s&pbjreload=101
 素数(六)基于欧拉函数的RSA算法加密原理是什么?RSA算法详解
 https://www.youtube.com/watch?v=xqol4-uziE0
參考資料
 素数(六)基于欧拉函数的RSA算法加密原理是什么?RSA算法详解
 https://www.youtube.com/watch?v=xqol4-uziE0
Why Elliptic Curve Cryptography
橢圓曲線是什麼?
a=-1 b=3
https://www.desmos.com/calculator/ialhd71we3?lang=zh-TW
橢圓曲線的加法特性
橢圓曲線的乘法特性
舉個例子
總結
 RSA 透過 兩大質數相乘不易於反推回去的特性作為加密基礎
 透過取餘數的方式來解密
 ECC 透過曲線公式帶入計算很難反推回去原理來作為加密基礎
 原點G(5,1) (16,4) 是 kG ,求 k
 透過把私鑰隱藏包裹在公開資訊跟乘法原理達成非對稱加密
Reference
 https://www.slideshare.net/lambmei/ecc-149433803
 https://www.youtube.com/watch?v=F3zzNa42-tQ&feature=youtu.be
 http://www.christelbach.com/ECCalculator.aspx
 https://graui.de/code/elliptic2/
 https://segmentfault.com/a/1190000019172260
 https://zhuanlan.zhihu.com/p/36326221

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

RSA and Elliptic Curve Cryptography

Editor's Notes

  1. P 17791143933509595918127954499653383601218835098160342274 21719349464132778400846891474457120589082133325302604179 82181001327467441044697854896458761089076165690493808885 78606941384914032562858753139200694087767527290102835209 36343115102676302117059691295229400834867089684114302209 27632138221540171427701495839 Q 15698106667513592225651910118661853088086996081175911345 49581990193390503622003253143718326860723480921952218366 69795595987275285870475032000847646645415387334949112223 81409068648841957504994872889663428380162653646162371919 71899699949089072105502530930366392712822832371160724348 51400420434671809603239292759