SlideShare a Scribd company logo
1 of 50
Download to read offline
以橢圓曲線密碼學ECC為例例
淺談非對稱加密
Blog : lamb-mei.com
	羊小咩
E-mail : lamb@lamb-mei.com
FB : https://www.facebook.com/lamb.mei
GitHub:https://github.com/lamb-mei/
Lamb Mei
/ 503
為什麼要說這個題⺫
圖片來來源 http://www.dailycold.tw/wp-content/uploads/2017/06/%E6%9C%AA%E5%91%BD%E5%90%8D-1.jpg
/ 504
想了了解⼀一下
ECC 應⽤用
/ 505
圖片來來源 https://dvblobcdnjp.azureedge.net//Content/Upload/Popular/Images/2018-10/572acefe-45b1-4c70-8aca-5f310d51f50f_m.jpg
/ 506
密碼學
(Cryptography)
圖片來來源 https://www.flaticon.com/authors/surang
/ 507
密碼學 Cryptography
對稱式加密 (Symmetric Encryption)
非對稱式加密 (Asymmetric Encryption)
/ 508
圖片來來源 演算法圖鑑
對稱式加密 (Symmetric Encryption)
DES、3DES、AES
/ 509
非對稱式密碼學
asymmetric cryptography
/ 5010
⼜又稱 公開⾦金金鑰密碼學
Public-key cryptography
/ 5011
圖片來來源 演算法圖鑑
非對稱式加密 (Asymmetric Encryption)
/ 5012
圖片來來源 演算法圖鑑
非對稱式加密 (Asymmetric Encryption)
/ 5013
圖片來來源 演算法圖鑑
非對稱式加密 (Asymmetric Encryption)
/ 5014
圖片來來源 演算法圖鑑
非對稱式加密 (Asymmetric Encryption)
/ 5015
非對稱式加密 (Asymmetric Encryption)
RSA
ECC
著名的演算法
/ 5016
都是利利⽤用數學難題,
正向計算容易易但反推非常困難
非對稱式加密 (Asymmetric Encryption)
/ 5017
橢圓曲線密碼學
Elliptic Curve Cryptography
/ 5018
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 https://www.moedict.tw/%E5%8E%9F%E7%90%86.png
/ 5019
橢圓曲線密碼學 Elliptic Curve Cryptography
y = x + ax + b
32
/ 5020
橢圓曲線密碼學 Elliptic Curve Cryptography
加法定義
/ 5021
橢圓曲線密碼學 Elliptic Curve Cryptography
乘法定義
/ 5022
橢圓曲線密碼學 Elliptic Curve Cryptography
O∞ 定義
/ 5023
橢圓曲線密碼學 Elliptic Curve Cryptography
橢圓曲線是連續的,並不適合⽤用於加密;
所以,我們必須把橢圓曲線變成離散的點
把橢圓曲線定義在有限域上
/ 5024
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 https://www.zhihu.com/question/26662683
/ 5025
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 https://www.zhihu.com/question/26662683
/ 5026
橢圓曲線密碼學 Elliptic Curve Cryptography
{p,a,b,G,n,h}
⼀一條橢圓曲線
p : ⼀一個質數 決定域
a , b : 曲線參參數
G : 基點
n : G的階
h : 商除整數
/ 5027
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 https://www.moedict.tw/%E5%8E%9F%E7%90%86.png

聽完似乎很難的原理理
來來講個 ⼩小故事
/ 5028
如何畫出⼀一隻⾺馬?
/ 5029
如何畫出⼀一隻⾺馬?
/ 5030
如何畫出⼀一隻⾺馬?
/ 5031
如何畫出⼀一隻⾺馬?
/ 5032
如何畫出⼀一隻⾺馬?
/ 5033
如何畫出⼀一隻⾺馬?
就是這麼簡單
/ 5034
橢圓曲線密碼學 Elliptic Curve Cryptography
ECC 應⽤用
ECDSA (Elliptic Curve Digital Signature Algorithm)
數位簽名演算法
ECIES (Elliptic Curve Integrated Encryption Scheme)
集成加密⽅方式
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
⾦金金鑰交換演算法
/ 5035
橢圓曲線密碼學 Elliptic Curve Cryptography
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
/ 5036
橢圓曲線密碼學 Elliptic Curve Cryptography
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
/ 5037
n = 19
h = 1
橢圓曲線密碼學 Elliptic Curve Cryptography
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
/ 5038
橢圓曲線密碼學 Elliptic Curve Cryptography
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
圖片來來源 :https://www.youtube.com/watch?v=F3zzNa42-tQ
/ 5039
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 :https://www.youtube.com/watch?v=F3zzNa42-tQ
會選⽤用⼤大的數字和質數,使其幾乎無法計算
/ 5040
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 :https://www.youtube.com/watch?v=F3zzNa42-tQ
優點
• 安全性能更更⾼高
160位ECC 和 1024位RSA、DSA有相同的安全强度

• 處理理速度更更快
在計算速度上,ECC比RSA、DSA快得多

• 頻寬要求更更低
• 儲存空間更更⼩小
ECC的密鑰⼤大⼩小參參數,與RSA、DSA相比要⼩小得多
/ 5041
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 :https://www.youtube.com/watch?v=F3zzNa42-tQ
• 設計困難,實現不容易易
缺點
/ 5042
橢圓曲線密碼學 Elliptic Curve Cryptography
圖片來來源 :https://www.youtube.com/watch?v=F3zzNa42-tQ
• 區塊鏈數位簽名
應⽤用
• 序號產⽣生驗證
• 基於⾝身份加密
• TLS/SSL 數位憑證
• …
這次即便便是⼤大家的聰明才智
還是要DEMO⼀一下
圖片來來源 :http://www.dailycold.tw/wp-content/uploads/
2017/06/%E6%9C%AA%E5%91%BD%E5%90%8D-1.jpg
/ 5044
圖片來來源 :https://github.com/agens-no/EllipticCurveKeyPair
Elliptic Curve Key Pair
https://github.com/agens-no/EllipticCurveKeyPair
推薦很不錯的 ECC套件
/ 5045
Elliptic Curve Key Pair
But !
/ 5046
Elliptic Curve Key Pair
/ 5047
Elliptic Curve Key Pair
改為 public init(config: Config) { self.config = config }
/Sources/EllipticCurveKeyPair.swift
public init() {}將
/ 5048
圖片來來源 :https://blog.udemy.com/wp-content/uploads/2014/05/shutterstock_175331306.jpg
/ 5049
對稱式加密 (Symmetric Encryption)
非對稱式加密 (Asymmetric Encryption)
橢圓曲線密碼學(Elliptic Curve Cryptography)
ECDSA (Elliptic Curve Digital Signature Algorithm)
ECIES (Elliptic Curve Integrated Encryption Scheme)
ECDH (Elliptic Curve Diffie–Hellman key Exchange)
SUMMARY
/ 5050
⽺羊⼩小咩 2019 / 06 / 13 @ Cocoaheads Taipei
其餘的 我們iPlayground⾒見見
密碼學博⼤大精深

More Related Content

What's hot

Debug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpointsDebug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpointsVipin Varghese
 
USENIX Vault'19: Performance analysis in Linux storage stack with BPF
USENIX Vault'19: Performance analysis in Linux storage stack with BPFUSENIX Vault'19: Performance analysis in Linux storage stack with BPF
USENIX Vault'19: Performance analysis in Linux storage stack with BPFTaeung Song
 
Datapath design with control unit
Datapath design with control unitDatapath design with control unit
Datapath design with control unitbabuece
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)Kentaro Ebisawa
 
GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)Netwax Lab
 
게임 서버 성능 분석하기
게임 서버 성능 분석하기게임 서버 성능 분석하기
게임 서버 성능 분석하기iFunFactory Inc.
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesPiotr Król
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersBrendan Gregg
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack monad bobo
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .YEONG-CHEON YOU
 
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석iFunFactory Inc.
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewMoriyoshi Koizumi
 
Kyle Taylor – increasing your security posture using mc afee epo
Kyle Taylor – increasing your security posture using mc afee epoKyle Taylor – increasing your security posture using mc afee epo
Kyle Taylor – increasing your security posture using mc afee epoKyle Taylor
 
How to upgrade ios image on cisco catalyst switch or router
How to upgrade ios image on cisco catalyst switch or routerHow to upgrade ios image on cisco catalyst switch or router
How to upgrade ios image on cisco catalyst switch or routerIT Tech
 
빠른 렌더링을 위한 오브젝트 제외 기술
빠른 렌더링을 위한 오브젝트 제외 기술빠른 렌더링을 위한 오브젝트 제외 기술
빠른 렌더링을 위한 오브젝트 제외 기술YEONG-CHEON YOU
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기Ji Hun Kim
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver艾鍗科技
 

What's hot (20)

Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Debug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpointsDebug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpoints
 
Warmhole routing ppt
Warmhole routing pptWarmhole routing ppt
Warmhole routing ppt
 
USENIX Vault'19: Performance analysis in Linux storage stack with BPF
USENIX Vault'19: Performance analysis in Linux storage stack with BPFUSENIX Vault'19: Performance analysis in Linux storage stack with BPF
USENIX Vault'19: Performance analysis in Linux storage stack with BPF
 
Datapath design with control unit
Datapath design with control unitDatapath design with control unit
Datapath design with control unit
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)
 
게임 서버 성능 분석하기
게임 서버 성능 분석하기게임 서버 성능 분석하기
게임 서버 성능 분석하기
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devices
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF Superpowers
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .
 
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
 
How video codec work
How video codec work How video codec work
How video codec work
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
 
Kyle Taylor – increasing your security posture using mc afee epo
Kyle Taylor – increasing your security posture using mc afee epoKyle Taylor – increasing your security posture using mc afee epo
Kyle Taylor – increasing your security posture using mc afee epo
 
How to upgrade ios image on cisco catalyst switch or router
How to upgrade ios image on cisco catalyst switch or routerHow to upgrade ios image on cisco catalyst switch or router
How to upgrade ios image on cisco catalyst switch or router
 
빠른 렌더링을 위한 오브젝트 제외 기술
빠른 렌더링을 위한 오브젝트 제외 기술빠른 렌더링을 위한 오브젝트 제외 기술
빠른 렌더링을 위한 오브젝트 제외 기술
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 

More from 羊 小咩 (lamb-mei)

使用openCV做影像辨識 @ iplayground
使用openCV做影像辨識 @ iplayground使用openCV做影像辨識 @ iplayground
使用openCV做影像辨識 @ iplayground羊 小咩 (lamb-mei)
 
資訊安全從連線加密開始 workshop 2020/01
資訊安全從連線加密開始 workshop 2020/01資訊安全從連線加密開始 workshop 2020/01
資訊安全從連線加密開始 workshop 2020/01羊 小咩 (lamb-mei)
 
致,第三者 - 從中間人攻擊看Network Debug
致,第三者 - 從中間人攻擊看Network Debug致,第三者 - 從中間人攻擊看Network Debug
致,第三者 - 從中間人攻擊看Network Debug羊 小咩 (lamb-mei)
 
咩星征服計劃 用 Js 征服地球Part VI
咩星征服計劃 用 Js 征服地球Part VI咩星征服計劃 用 Js 征服地球Part VI
咩星征服計劃 用 Js 征服地球Part VI羊 小咩 (lamb-mei)
 
咩星征服計劃 用 Js 征服地球 Part III
咩星征服計劃 用 Js 征服地球 Part III咩星征服計劃 用 Js 征服地球 Part III
咩星征服計劃 用 Js 征服地球 Part III羊 小咩 (lamb-mei)
 
咩星征服計劃 用 Js 征服地球 Part II
咩星征服計劃 用 Js 征服地球 Part II咩星征服計劃 用 Js 征服地球 Part II
咩星征服計劃 用 Js 征服地球 Part II羊 小咩 (lamb-mei)
 
咩星征服計劃 用 Js 征服地球
咩星征服計劃 用 Js 征服地球咩星征服計劃 用 Js 征服地球
咩星征服計劃 用 Js 征服地球羊 小咩 (lamb-mei)
 
主管不會教、自己學不會的 Google analytics
主管不會教、自己學不會的 Google analytics主管不會教、自己學不會的 Google analytics
主管不會教、自己學不會的 Google analytics羊 小咩 (lamb-mei)
 

More from 羊 小咩 (lamb-mei) (12)

使用openCV做影像辨識 @ iplayground
使用openCV做影像辨識 @ iplayground使用openCV做影像辨識 @ iplayground
使用openCV做影像辨識 @ iplayground
 
資訊安全從連線加密開始 workshop 2020/01
資訊安全從連線加密開始 workshop 2020/01資訊安全從連線加密開始 workshop 2020/01
資訊安全從連線加密開始 workshop 2020/01
 
你的APP安全嗎
你的APP安全嗎你的APP安全嗎
你的APP安全嗎
 
致,第三者 - 從中間人攻擊看Network Debug
致,第三者 - 從中間人攻擊看Network Debug致,第三者 - 從中間人攻擊看Network Debug
致,第三者 - 從中間人攻擊看Network Debug
 
Git由超淺入超深
Git由超淺入超深Git由超淺入超深
Git由超淺入超深
 
咩星征服計劃 用 Js 征服地球Part VI
咩星征服計劃 用 Js 征服地球Part VI咩星征服計劃 用 Js 征服地球Part VI
咩星征服計劃 用 Js 征服地球Part VI
 
咩星征服計劃 用 Js 征服地球 Part III
咩星征服計劃 用 Js 征服地球 Part III咩星征服計劃 用 Js 征服地球 Part III
咩星征服計劃 用 Js 征服地球 Part III
 
咩星征服計劃 用 Js 征服地球 Part II
咩星征服計劃 用 Js 征服地球 Part II咩星征服計劃 用 Js 征服地球 Part II
咩星征服計劃 用 Js 征服地球 Part II
 
咩星征服計劃 用 Js 征服地球
咩星征服計劃 用 Js 征服地球咩星征服計劃 用 Js 征服地球
咩星征服計劃 用 Js 征服地球
 
主管不會教、自己學不會的 Google analytics
主管不會教、自己學不會的 Google analytics主管不會教、自己學不會的 Google analytics
主管不會教、自己學不會的 Google analytics
 
重新認識Facebook
重新認識Facebook重新認識Facebook
重新認識Facebook
 
那些年,我們一起做的 App
那些年,我們一起做的 App那些年,我們一起做的 App
那些年,我們一起做的 App
 

非對稱加密-以橢圓曲線密碼學ECC為例