ITHOME 2018 HITCON gasgas 量子時代下的重裝駭客 v3 · 何謂量子霸權?...

Post on 30-Nov-2019

5 views 0 download

Transcript of ITHOME 2018 HITCON gasgas 量子時代下的重裝駭客 v3 · 何謂量子霸權?...

量子時代下的重裝駭客

gasgas@chroot.orggasgas4@gmail.com

科普一下量子力學與量子計算

何謂量子力學?

維基百科:量子力學(quantummechanics)是描述微觀物質(原子,亞原子粒子)行為的物理學理論

• 薛丁格波動方程式• 不確定性原理• 波函數塌縮• 狄拉克方程式

• 量子糾纏

量子特性:量子態疊加(superposition)

量子特性:量子糾纏(quantumentanglement)

Entangledstates===non productstatesoftwoormoreQubit

何謂量子電腦?

維基百科:量子電腦(quantumcomputer)是一種使用量子邏輯進行通用計算的裝置

• 應用:• 物質分子和化學反應的模擬• 快速解決一些傳統電腦需要長時間解決的問題

量子電腦會使用到…..

•量子特性•量子態疊加(superposition)•量子糾纏(quantumentanglement)

•量子Gate• Unitary• 1-Qubitgates,2-Qubitgates.higher-orderquantumgates

何謂量子霸權?

量子霸權(quantumsupremacy):

• 處理器要達到49量子位元(qubit)• 雙量子位元錯誤率低於0.5%• 屆時運算能力將會超越世界上所有電腦,具有解決傳統電腦所解決不了問題的能力。

QuantumComputing

量子電腦那裡找???

•QuantumGate類型的• IBM有提供實驗性的機器與API(5Qubit),QASM+Python• Microsoft有提供語言環境 VS+(Q#,Python)• Rigetti python(Quil)+QuantumVirtualMachine (QVM).

•QuantumAnnealing類型的• D-Wave+quantummachineinstruction(QMI)

商業級

窮人版:Three-bitquantumgate

QuantumGate: single-qubitgate(Paulioperators)

QuantumGate:Hadamard gate

QuantumGate:controlled-NOT(CNOT)

QuantumGate:SWAPGate

混合使用

量子電腦使用小經驗 (其實就是照tutorial做一次)

起手式

•參考QuantumInformationSoftwareKit的教學• https://github.com/QISKit/qiskit-tutorial

安裝 qiskit-sdk

• Install• https://github.com/QISKit/qiskit-sdk-py

• Environmentchecking• /Users/ziv/Downloads/Test_Quantum_Computing• pyenv versions

• pipinstallqiskit

Try‘localsimulator’first

UseIBMrealQuantumComputerMachine

• Createaaccount• https://quantumexperience.ng.bluemix.net/qx/editor

• GetAPItoken• 3835035204750b2a5b5b8f00xxx1d92586df5e5f4f4304f0eba6f5497d9346defe29faf1f9681121872ac357a90a3b8ed21339bb80df2c5eb0636bd1c6f67c6d

Beginplaytutorial

• Fromthis• https://github.com/QISKit/qiskit-tutorial

• PutAPItokeninQconfig.py

Installandrun

• git clonehttps://github.com/QISKit/qiskit-tutorial.git• cd qiskit-tutorial• #CopyQconfig.py tothisdirectory• Copy../Qconfig.py .• jupyter notebookindex.ipynb

• à開始玩http://localhost:8888/notebooks/1_introduction/getting_started.ipynb

http://localhost:8888/notebooks/1_introduction/getting_started.ipynb

Run240seconds

PlayIBMbackend

• http://localhost:8888/notebooks/1_introduction/working_with_backends.ipynb• Backend• realdevices,• onlinesimulators,• localsimulations

駭客如何利用量子電腦/計算來做壞事

量子電腦可以

•質數分解•對稱式演算法攻擊•量子金鑰傳輸(QKD )•量子比特幣(qBitcoin)•量子數位簽章• Quantummachinelearning• TravelingSalesmanProblem

質數分解

•以質數分解困難度為基礎的演算法危險了• Shoralgorithm

RSA

•仰賴質因數分解的困難度•私鑰可以很快被算出•傳統 RSA是 nonquantum-safe.

橢圓曲線密碼系統 (ECC)•仰賴離散對數的困難度•私鑰可以很快被算出•傳統 ECC是 nonquantum-safe.

對稱式演算法攻擊

• Grover’sSearchAlgorithm• 加速目前傳統搜尋演算法

•舉例,• AES-128,key長度是128,但是在量子電腦用Grover演算法的話,強度只有key64的強度,等於減半!!

其實 我從頭到尾只想用量子電腦挖比特幣

量子電腦如果讓比特幣挖礦

proof-of-work可以算快一點

讓授權交易的橢圓曲線簽章可以偽造/取代

晴天霹靂的一篇文章

• Hashfunction!!!

讓大家哭得更大聲的另一篇文章

有興趣也可以參考這個slide

• http://www.math.sinica.edu.tw/www/file_upload/summer/crypt2017/data/2017/%E4%B8%8A%E8%AA%B2%E8%AC%9B%E7%BE%A9/[20170815][Quantum%20Attack%20on%20Cryptography].pdf

感謝大家 明天請早

附錄

另一個平台 Rigetti’s Forest 1.0

• https://medium.com/rigetti/introducing-forest-f2c806537c6d• https://pyquil.readthedocs.io/en/latest/qpu_overview.html• ForestisbuiltontopofQuil™,thefirst instructionlanguageforhybridquantum/classicalcomputing.

• http://demo.rigetti.com/• Codeexample• https://github.com/rigetticomputing/grove

Diracnotation(狄拉克符號)

Diracnotation(狄拉克符號)

• Fromwiki• https://zh.wikipedia.org/wiki/%E7%8B%84%E6%8B%89%E5%85%8B%E7%AC%A6%E5%8F%B7

• 此標記法為狄拉克於1939年將「bracket」(括號)這個詞拆開後所造的

• Morereference:• [1]https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation• [2]https://docs.microsoft.com/en-us/quantum/quantum-concepts-6-diracnotation?view=qsharp-preview

Ket(括量)andbra(包量)括量:N×1階矩陣矩

包量:1×N階矩陣矩

態向量內積(innerproduct)矩

態向量外積(outerproduct)矩

相同的態向量內積矩

Innerproduct

meanoraveragevalue,oftheobservablerepresentedbyoperator A

Outerproduct

Hermitianconjugateoperator

Bra–ket notationProperties1/3

Bra–ket notationProperties2/3

Bra–ket notationProperties3/3

moreProperties

Einsteinsummationconvention

MathematicianVSphysicist

single-qubitcomputationalbasisvsDiracNotation(1/2)

classicalbit0

classicalbit1

quantumstatevectors

quantumstatevectors

DiracNotation

DiracNotation

Hadamard gate H T-gate

single-qubitcomputationalbasisvsDiracNotation(2/2)

theprobabilityofmeasuring 1

ReadbookQuantumComputerScience- AnIntroduction2007.pdf