EGE/RSA

Aus ProgrammingWiki

Wiki-Quelltext dieser Seite.

[[Bild:schema_rsa.png]]
== Entwurf öffentlicher Schlüssel (e, N) ==
Lege zwei (große) Primzahlen <math>p</math> und <math>q</math> fest mit <math>p \neq q</math>.

Bilde das Produkt <math>N = p \cdot q</math>.

Suche eine weitere Zahl <math>e</math>, für die gilt:
* <math>e</math> ist Primzahl und größer als <math>p</math> und <math>q</math> <u>oder</u>
* <math>e</math> ist teilerfremd zu <math>(p-1) \cdot (q-1)</math>.
Die Zahlen <math>e</math> und <math>N</math> bilden den ''öffentlichen Schlüssel''.

== Entwurf privater Schlüssel (d) ==
* <math>d \le (p-1) \cdot (q-1)</math> <u>und</u>
* <math>(d \cdot e) \bmod [(p-1) \cdot (q-1)] = 1</math>

== Bob verschlüsselt die Nachricht M ==
Voraussetzung: öffentlicher Schlüssel (e, N)
Ein Klartext-Zeichen mit dem Code <math>M</math> wird mit
<blockquote><math>M^e \bmod N = C</math></blockquote>
zu <math>C</math> ''verschlüsselt''.

== Alice entschlüsselt die Nachricht C ==
Voraussetzung: privater Schlüssel d, öffentlicher Schlüssel N, Code C
Der verschlüsselte Code <math>C</math> wird mit
<blockquote><math>C^d \bmod N = M</math></blockquote>
zum Code <math>M</math> des Klartext-Zeichens ''entschlüsselt''.

== Hausaufgabe ==
RSA-Faktoring-Chalenge (Wikipedia) lesen
* Warum ist das RSA-Verfahren mit kleinen Primzahlen immer noch unsicher? (Wozu benötigt man möglichst große Primzahlen?)
* Was bedeutet 205 Bit?
* Wie groß sollten zwei sichere Primzahlen sein?

<!--[https://vimeo.com/114048258 RSA mit dem Android-Handy] ansehen und versuchen, umzusetzen.-->

== Wir verschlüsseln uns Nachrichten gegenseitig ==
=== Tim ===
N = 2923723657325689753

e = 2^16+1

Aaron: 6109241775432 # 0445619957989 # 2011493422895 # 1753212313778 # 1560560402734 # 4668526465824

Für Tim: 0971158489226418555 # 2043547178206792772 # 0732029136643858939 # 1556005650193041109 # 0377185071036805876 # 1239559758108528165 # 2632998321014479199 # 0615496542965952553 # 1271428267648145280

Sie haben eine neue Nachricht von Theresa und Heidi:
0774675119867086861 # 2550189815429128910 # 0952425257611192653 # 2771040226284978916 # 0214213828173062652 # 1407000110238489289 # 1370936048719826808 # 0169368717175689352 # 1226329469454461222 # 2810237185961487629 # 2241053565050258674 # 2128553322512252893

=== Elise ===
N 2923723657325689753
e 2^16+1
Text 0322250827748490414 # 2472611229660409538

=== Aaron ===


N = 8657171789267

e = 2^16+1

Tim: 2403605539189261130 # 1416580827313331326 # 2408159993458149277 # 2190278437483377366 # 1562642152801134763 # 1560000634633346060 # 2423329647570075338

=== Johannes ===
N= 2185487837714976281
e= 2^16+1

Schlüssel für dich :D 1234120474465912099 # 1230353083399707634 # 0462960430889572536 # 1668559233401989181 # 0558528854443029121 # 0061871616029764787 # 1433346339072452767 # 0197958887340782944
The Witcher ist auf jeden Fall ein ganz toles Spiel.

=== Dandy ===
N = 1688180727500347741

e = 65537

Schlüssel für Josef: 1234120474465912099 # 1230353083399707634 # 0462960430889572536 # 1668559233401989181 # 0558528854443029121 # 0061871616029764787 # 1433346339072452767 # 0197958887340782944

=== Josef ===
N = 3972654221287674281

e = 2^16+1 bzw. (65537)


Für Dandy:

0122301579634764561 # 1138874609656961026 # 1455350204229145620 # 0076053920598175809

Für dich:

0372068089527068742 # 2704354384167637835 # 0859976639556390370 # 2933727468122837164 # 2366356262357904522 # 1217942004898521553 # 3048092893633181704 # 0365519012583822276

=== Theresa ===
N=2189329218283721051
e=2^16+1

1 neue Nachricht von Heidi:0960431449687320593 # 1321373400322207727 # 0782940085349524221 # 0386420003740380966 # 0537310695899918429 # 0873795174461400411 # 1767094842803462446 # 0107150302338772149 # 0332336724158767107 # 1819778149649941543 # 0684844835086246406 # 1646236126423120900 # 2118456125486013924 # 2023364804533987443 # 0975267753970930938

=== Heidi ===
e: 2^16+1

N: 2923723657325689753

verschlüsselte Nachricht:

1136011545364292294 # 1061740183986791317 # 2111626553460064403 # 2368350865761515465 # 1105560748490278701 # 0232785873229391537 # 2094094700269354771 # 0426665001269638855