shors algorithmus effiziente faktorisierung. 16. januar 2003 gregor rößle - shors schnelle...

25
Shors Algorithmus Effiziente Faktorisierung

Upload: gerde-schmidlin

Post on 05-Apr-2015

106 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

Shors Algorithmus

Effiziente Faktorisierung

Page 2: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

2

I Motivation

Kryptographie (RSA):• p, q: große Primzahlen, n:• d: relativ prim zu (p-1)(q-1), e aus

• Schlüssel: öffentlich (e, n), geheim (d, n)

• Verschlüsseln Entschlüsseln

npq

)1)(1mod(1 qped

nab e mod nba d mod

Page 3: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

3

Brechen von RSA:• n faktorisierbar:

p,q: geheimer Schlüssel errechenbar

• Allerdings exponentielle Laufzeit!

„Killerapplikation“ für Quantenrechner

)1)(1mod(1 qped

Page 4: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

4

II Der Algorithmus von Shor

1. Klassische Faktorisierung2. Faktorisierung mit

Quantencomputern3. Shors Faktorisierung

Page 5: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

5

1. Klassische Faktorisierung

Mathematische Grundlagen• n groß, soll faktorisiert werden• • Periodisch:

(Periode/Ordnung r)

beliebig ,mod)( anaxf xa

rxnaa x )(mod0

Page 6: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

6

• Besonderheiten:• r gerade!• Teiler können auch 1 und seinni

)(mod0)1)(1( 22 naarr

)(mod0 nni 2 Teiler: )1,ggT( 2 r

an

)(mod01)(mod1)(mod0 nannaa rr

Page 7: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

7

Effizienz• Geeignete a:

• hohe Wahrscheinlichkeit

• Richtige Periode r:• Zufall: raten oder rechnen (alle

Möglichkeiten durchprobieren)• leider exponentiell viele Möglichkeiten!• Worst Case: n ist prim

2

1))(mod1(,

2

1)gerade )(( 2 naPaordrP

r

Page 8: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

8

• Bester klassischer Algorithmus (n: L Bits):• Zeitkomplexität:

3

1

log

9

64),(

3

2

3

1

ceO LcL

Page 9: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

9

2. Faktorisierung mit Quantenrechnern

Wo?• Bestimmung der Periode

Wie?• Superposition:

• alle möglichen Perioden gleichzeitig! rechnen

• Fourier-Transformation:• Extraktion von Frequenzen periodischer

Funktionen

Page 10: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

10

3. Shors Algorithmus

Effizientes Raten von r:

• Lade alle nötigen x (Superposition!)• Anwenden von • Fouriertransformation

• Frequenzen von• Grundfrequenz

• Brauchbares Ergebnis mit hoher Wahrscheinlichkeit

naxf xa mod)(

)(xfa

)(xfa

r

1

Page 11: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

11

Shors Algorithmus

Schritt 1:• Vorbereitung:

• Zahl n (m Bits)• 1<a<n beliebig• q beliebig mit

• Register laden:

qnqn ,32 22 Zweierpotenz

Qubits) lg :(0 0,0,,, nqan

Page 12: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

12

Shors Algorithmus

Schritt 2:• Funktion berechnen:

• Hadamard-Operator auf 4. Register anwenden:

• Superposition aller Werte von 0, 1, ... , q-1 im 4. Register

1

0

0,,,,1 q

x

xqanq

)(xfa

Page 13: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

13

• BerechnungexistiertOperator unitärer reversibel )( xfa

:)(xfa

1

0

mod,,,,1 q

x

x naxqanq

Page 14: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

14

Shors Algorithmus

Schritt 3:• Messung letztes Register

• Ergebnis y uninteressant• Wirkung auf vorderes Register:

Vielfache von r, um Offset l verschoben

• Zustand:

yna x mod

rjlx

ljryljrqan ,,,,

Page 15: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

15

Shors Algorithmus

Schritt 4:• Fourier-Transformation QFT

• Offset l jetzt in Phase, nicht im Zustand

1

0

21

:q

v

q

iuv

veq

uQFT

1

0

21 r

j

ilcq

r

qje

qQFT

Page 16: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

16

Shors Algorithmus

Schritt 5:• Messung 4. Register:

• c aus Messung, q bekannt:r

qjc

r

j

q

c

Page 17: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

17

Shors Algorithmus

Schritt 6:• Errechnen der Periode r aus

• Kettenbruchzerlegung

• Bestimmen der Faktoren:

:r

j

q

c

)(mod1)( 22 naar

r

)(mod01)( 22 nar

)(mod0)1)(1( 22 naarr

)1,ggT(2Faktor ),1,ggT(1Faktor 22 rr

anan

Page 18: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

18

Shors Algorithmus

Mögliche Probleme:• r ungerade• Faktoren sind n und 1• r nicht bestimmbar,

Kettenbruchzerlegung endet nicht

Page 19: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

19

III Anhang

Page 20: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

20

1. Keine Messung

Messung setzt 4. Register auf 0 außer an Werten für x von• periodische Funktion:

• Grundfrequenz + Oberschwingungen (in Superposition):

• Fouriertransformation extrahiert Frequenzspektrum (in Superposition)

Ohne Messung:• QFT auf 5. Register anwenden

rjl

i

t)sin(iaf(t) i

Page 21: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

21

2. QFT

Verwandt mit FFT• Effizienz:

• Hadamard- und X-Gatter

Gatter 2

)1(:2Basis

nnn

)( :QFT ),2( :FFT ),2( :DFT 22 nOnOO nn

j

ij

e 2

2

0

01X ,

2

1

2

12

1

2

1

H

11,222,11,111,01,00 .........QFT nnnnn HXHXXHXXH

Page 22: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

22

Page 23: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

23

3. Kettenbruchzerlegung

Messergebnis:

Genauer (Shor):r

qjv

rjv

m2liegt mit hoher Wahrscheinlichkeit nahe

2

12

rjv

m

22

1

22

1

2 nr

jvmm

,1

2nqq

pqqp

q

p

q

p

2

1

2 :dass so ,mit ein höchstens

nq

pvMq

q

pm

Page 24: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

24

Algorithmus:

r

j

q

p

q

pvm

2

000 2,

2a

vva

mm

n

nn

nn aa

11

1,

1

1, 01100 aapap

21 nnnn ppap 21 nnnn qqaq

110 ,1 aqq

Terminiert, wenn:

Ergebnis:

1 nn qMq

nqr

Page 25: Shors Algorithmus Effiziente Faktorisierung. 16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung2 I Motivation l Kryptographie (RSA): p, q: große

16. Januar 2003 Gregor Rößle - Shors schnelle Faktorisierung

25

4. Komplexität

Für Shors Algorithmus:• 300 lg n Elementargatter• n: 130 Stellen: 2 Wochen bei 1MHz• n: 260 Stellen: 32 Wochen bei 1MHz• Beckman et al. (1996):

• m-Bit Integer: Zeit:Speicher:

)lglglg( 2 mmm15 m