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 ==
=== Ruben ===
N=2290688290035092561
e=2^16+1

Geheimtext:
M=0212462476451503813 # 0279022256428772954 # 0726293796104265093 # 2114811903790655993 # 1906335504232360310

Antwort
0130841604139921959 # 1521198218873171111 # 2078612545551886475 # 2283388222484220557 # 0368871778905622093 # 0185976975208823159 # 1565238859791119523 # 0869487076233718915 # 1189479195690087697 # 1153876874581392703 # 1307609134148021310

=== Leonie ===
N=1842409465748009713
e=2^16+1

Geheimtext:
1168545598385321835 # 0036148981711874247 # 0586194511655934941 # 1542393816097386545 # 0128534568308589811 # 0747839941646094815 # 0694638595198958223 # 1379050199896526745 # 0706773945999946229

=== Jan-Niklas ===
N= 2403979145974083079
e= 2^16+1


Geheimtext: 1144574168890581819 # 1378985832584241735 # 0481305006718517056 # 1219019799248668483 # 2045659868233517824 # 2095097454166360338 # 1428907095981739790 # 1888276514260170453 # 2388039495620387395 # 1829966771082925091 # 0201663210683833497 # 1750427224501664221 # 0013047686796964166

=== Luis ===
N=3688524632749527271

e=2^16+1


C= 0664578975880072542 # 0633246485916237828 # 1473940245361805448 # 1574560087996318050 # 1223164218146377563 # 1510117272592122780 # 0881276524071540826 # 1447294168784865462 # 1862012146810215298 # 1233442595414136819 # 1794284385966534347 # 0396360105925369913 # 1414094914294252972 # 1934796031219107456 # 1555522518726916988 # 0103979780810024275 # 1352953443439557259 # 1931506407254353833 # 1239247601390073597 # 1129241183251994865 # 0584009594208637811 # 1657279466675062884 # 1437974658442389897 # 1897615166902361894 # 1563457577967885048 # 0251614835426078759 # 1555167062696126731 # 1028281041308215836 # 1938435917399536466 # 0816700166763567474 # 1345839015340338866 # 1047257105852374930 # 0504407276052796500 # 1595581706981270536 # 0349725931165836625 # 0508694867505094680 # 1778748005533987465 # 0133707458933182294 # 0353492720748577530 # 1307208415385188692 # 1894636381004623924 # 1101944883841692488 # 1271907038330289232 # 1590095119027161839 # 0818788050474816678 # 0939310725676188537 # 0028590947879848985 # 0387377694726556737 # 1565205904734490467 # 1720539624921755600 # 1670202117033431820 # 0449123592183776579 # 0180787740373888651 # 0703731068263044946 # 0298647858604041723 # 0394462891852807259 # 0412682221917615933 # 0606145558604171787 # 1692691802471136126 # 0923912402351330362 # 1770780044340877163 # 0091698713333343110 # 0203733585887931722 # 1897615166902361894 # 0132010466092706427 # 1175070023115488413 # 0835814388749113020

=== Clemens ===

N= 75294756853
e= 2^16+1

59928078434 # 72589273530 # 16173716565 # 44713393784 # 52737605255 # 17184688515 # 46789022858 # 73855319516 # 59825312824 # 27680072701 # 49113742458 # 34690376144 # 35898905995 # 20022963209 # 51298474478 # 40307260494 # 37964653703 # 03980169672 # 02123950179 # 16710337180 # 04049797956

=== Maximilian ===

N = 3038043574127449361
e = 2^16+1

C= 1191945890916496238 # 0749104075417921294 # 2050920325587402138 # 2033322791783987871 # 2179912618785326176 # 2153547974032296128 # 0956406643232635675 # 1790666851702612133

=== Janine ===
N=2852579451223911293
e=2^16+1



Geheimtext: 1616028400802717015 # 2497530724502264956 # 0608263158308991269 # 0070416642992101753 # 1866989425014299148 # 1729590572269052699 # 1269877043949650330

=== Simon ===
N=2634640713694040663
e=2^16+1

1034836196066802899 # 2163387804459873831 # 2239945373948065010 # 1716904572690322764 # 2061974359428766560 # 2040847074043526100

=== Ben ===

N = 1795709734003242829
e = 2^16+1
Text: 0333378004246563002 # 1136093563807890709 # 0620991995616976189 # 1789808277132306342 # 1748717074485970508 # 0322120309615070086 # 0072878267165740422 # 0253255900752465152 # 1713660336361021332

=== Conrad ===
=== Fhüllybpe ===
N=4125102652534801589
e=2^16+1

Geheimtext: 1815024155428420827 # 3284010809428653411 # 0367427517137291942 # 0504627377733545442 # 1745829803632146976 # 2786027334438664711 # 2352481224462571264 # 2211490466078446646 # 0542925682235426235 # 0291033818027795791 # 2770160186396651385 # 3539585172582904096 # 2716069200541142812 # 1120922036507121308 # 3242417184077934468

c¹: 2861100816995380767 # 1588060076981043803 # 1715334948567646853 # 3197898792589795440 # 2218660437173957464 # 1493760890519279434 # 0597472692900133456 # 2300766234407201140