caesar encryption with fibunacci numbers.nb
Transcription
caesar encryption with fibunacci numbers.nb
Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb Cryptografy Topic: Ceasar encryption with Fibunacci numbers Caesar with Fibunacci The objective of this group is to create an optimized version of the Caesar-encryption. In order to make our project more special and to put in on a higher level we realized it with the following auxiliaries: - ASCII-Code (American Standard Code or Inormation Interchange) It is a 7 Bit-character-encryption and builds the fundament for further character-sentences, and encryptions with multiple Bits. - Fibonacci This is a recursive mathematic sequence of nonnegative full numbers. That means, that the values zero and one are assigned to the first two numbers; all the following numbers match the sum of the previous two ones. Project-group These are the members of the group, which realized this project: Site: www.deltasoft.at M@th Desktop 1 Thursday, April 26, 2007 Sassmann Mario caesar encryption with fibunacci numbers.nb Siegl Iris Open ê Close Schneider Martin Schestak Manon The improved Caesar-encryption in Mathematica Print In Mathematica our project is structered as followed: * Projectassignment This section includes the detailled assignment of tasks respectively the according text which is going to be encrypted. * The Caesar-encryption in general In order to be able to understand the project, you will get further details about the fundamental functionality of the Caesar-encryption including its history in this chapter. * Development phase 1 + 2 Within the section ‘development phases’ we will try to give you a better view at the different milestones of this project. On the basis of these information you should be able to comprehend our train of thoughts. * The completed project Open ê Close Projectassignment: Encryption of a default text with help of the Caesar-encryption (displaced). The text is the following: Alles ist relativ - oder: was die Relativitätstheorie NICHT sagt Einstein wird nicht nur zum berühmtesten Physiker der Welt, seine Relativitätstheorie ist auch bald in aller Munde - und damit sagt sie oft etwas ganz anderes aus, als Einstein jemals im Sinn hatte. So kennt jeder den Spruch: „Alles ist relativ!“ Interpretiert wird dieser wie folgt: Die Relativitätstheorie hat es bewiesen - man kann nichts sicher wissen! Die naturwissenschaftliche Erklärung der Welt ist auch nur eine Auffassung Site: www.deltasoft.at M@th Desktop 2 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb unter vielen, und wenn das so ist, gibt es natürlich auch keine absoluten Werte. Was falsch und richtig ist, das hängt dann ganz vom Beobachter, von den Umständen und der Situation ab. Eine weitere Interpretation, die oft zu hören ist: „Alles ist mit allem verbunden!“ Auch dafür muss die Relativitätstheorie herhalten: Das Universum ist ein großes Raum-Zeit-Kontinuum, in dem alles mit allem in Verbindung steht - das Universum als erweitertes Bewusstsein. Deshalb muss die westliche Forschung ganzheitlich werden, anstatt nur auf Details zu schauen. Diese Erklärungen gehen an Einsteins Ideen vorbei, denn die Relativitätstheorie sagt nichts darüber aus, ob es eine absolute Wahrheit gibt, und auch nichts über ethische oder spirituelle Fragen. Die Spezielle Relativitätstheorie bezieht sich auf alle Körper in Bewegung. Sobald diese Körper sich mit so einer hohen Geschwindigkeit bewegen, dass diese im Vergleich zur Lichtgeschwindigkeit nicht mehr vernachlässigbar klein ist, weicht die Theorie vom Newton’schen Pendant ab. Das Besondere an der Speziellen Relativitätstheorie ist, dass sie die ganze Physik betrifft. Sie verlangt, dass alle anderen Modelle, in denen Raum und Zeit eine Rolle spielen, auf die neuen Grundlagen gestellt werden. Daher auch Einsteins eigene Bemühungen darum, eine relativistische Variante der Gravitation in der Allgemeinen Relativitätstheorie zu finden. Die Allgemeine Relativitätstheorie selbst bietet eine neue Erklärung dafür, wie Gravitation zu verstehen ist. Sie macht revolutionäre neue Vorhersagen möglich und ist also mehr als nur eine neue Interpretation der Natur. Site: www.deltasoft.at M@th Desktop 3 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb Open ê Close The Caesar-encryption in general The Caesar-encryption is one of the easiest ways to encode a text. Its (among just a view other ones) the oldest cryptograph and related to the Atbash-encryption. The security of this ancient cipher depends on the privacy of the scramblingmethod. But finally it managed the break-through. Though the mathematic process might already be known, it’s not possible to crack the code without the key (amount of the displaced positions). Even if it represents a very significant cornerstone in history of encoding, it is from the nowadays point of view quite insecure. Its name is dedicated to Gaius Julius Caesar. Also the word ‘emperor’ is deflected from his name, as well as the word cesarean does, since he is supposed to be born in this way. Already in school we learned that ‘he came, he saw and he conquered’. He was a roman commander and used ecryptions as a way of secret communication for his military correspondence. Sueton acquaints, that Caesar had sent confidental letters to Markus Tullius Cicero, which was a roman lawyer, philosopher, politician and the most famous orator of Caesars era. Mostly Caesar used a deplacement of three positions and was demonstrably the first person encrypting his messages. Using Caesars example, the movement would look as followed. Let’s pretend he would like to write ‘wir treffen uns morgen’ then he would have written ‘ZLU WUHIIHQ XQV PRUJHQ’ A better demonstration of the movement you’ll get when writing ‘Klartextalphabet’- and ‘Geheimtextalphabet’ on two against each other revolvable slices instead of writing in two lines (figure above). numeric-slice You can find ‚Klartextalphabet’ in the outer, and ‘Geheimtextalphabet’ in the inner slice. The starting position is of course the exact comparison of the identic letters. Now the displacement of random Site: www.deltasoft.at M@th Desktop 4 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb positions can take place. But the numeric-slice is not only important for the Caesar-ecryption; even much more difficult cipherings profit from its ingenuity. For the final encoding every letter of the latin standard-alphabet is periodicly switched for a defined number of positions. The quantity is precised by the key, which stays unmodified during the whole act of scrambling. It is a number between 1 and 25. Thus it is one of the easiest, but - like already mentioned - as well a very insecure way of encrypting. By going through the 25 possible keys, it is comparatively easy to map out the code. Nowadays the Caesar-encrypting is already obsoleted. In the meantime much more extensive cipherings are available. Altough some vestiges of it remained anyhow in these new techniques. As a memento persisted two essential elements of this scramblingmethod. The substitution of a character, which is placed on a certain position in the alphabet, with the character, placed a defined number of letters later. This action is called algorithm. Sowie die Zahl um die verschoben wird ist der Schlüssel. Both is required to de- and encode. On the basis of these facts we can see that basically simple theories and procedures can build the precious fundament for ground-breaking, complex and innovative projects. Who knows… maybe without the Caesar-encryption, which provided the final entrance in cryptography, pioneering and partly uncrackable scramblingtreatments might never have been possible! First idea: Open ê Close text with ASCII-chart Within this text-counterfoil, we like to present you the groundwork, which made the final realization of this project possible. text = "das ist ein sehr kurzer Text"; textinASCII = ToCharacterCode@textD 8100, 97, 115, 32, 105, 115, 116, 32, 101, 105, 110, 32, 115, 101, 104, 114, 32, 107, 117, 114, 122, 101, 114, 32, 84, 101, 120, 116< verschieben = 4; 2. verschluesselt = Mod@textinASCII + verschieben, 255D 8104, 101, 119, 36, 109, 119, 120, 36, 105, 109, 114, 36, 119, 105, 108, 118, 36, 111, 121, 118, 126, 105, 118, 36, 88, 105, 124, 120< verschluesselText = FromCharacterCode@verschluesseltD hew$mwx$imr$wilv$oyv∼iv$Xi»x entschluesselt = Mod@verschluesselt − verschieben, 255D 8100, 97, 115, 32, 105, 115, 116, 32, 101, 105, 110, 32, 115, 101, 104, 114, 32, 107, 117, 114, 122, 101, 114, 32, 84, 101, 120, 116< Site: www.deltasoft.at M@th Desktop 5 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb FromCharacterCode@entschluesseltD das ist ein sehr kurzer Text declaration of the code text = ‘das ist ein sehr kurzer Text’: This is text, going to be encoded. textinASCII = ToCharacterCode[text] Here the transformation of the characters into the ASCII-Code takes place. verschieben = 4; In this case ‘4’ denotes, that the alphabet is deplaced by 4 positions (in numbers). verschluesselt = Mod[textinASCII + verschieben, 255] Since the digits are larger than 255, they get converted (via modulo calculation) and concurrently switched here. verschluesselText = FromCharacterCode[verschluesselt] With this function you get the unreadable and encrypted text. entschluesselt = Mod[verschluesselt - verschieben, 255] Here the decoding takes place (once more via modulo calculation). The alphabet (in numbers) gets adjusted backwards to the source. FromCharacterCode[entschluesselt] Using this function, the encoded text gets readable in numbers . Finished Project Open ê Close text with ASCII-chart and Fibonacci-row Here you can see the encrypted text with the better algoritm with the help of our palette Site: www.deltasoft.at M@th Desktop 6 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb text = "Die Caesar−Verschlüsselung ist eine der einfachsten Formen der Geheimschriften. Für die Verschlüsselung wird jeder Buchstabe des lateinischen Standardalphabets um eine bestimmte Anzahl von Positionen zyklisch verschoben. Die Anzahl bestimmt den Schlüssel, der für die gesamte Verschlüsselung unverändert bleibt."; verschieben = 32; textFib = ToCharacterCode@textD; laenge = Length@textFibD; For@i = 0, i < laenge, textFib@@iDD += Fibonacci@i − 1D, i ++D textFib; textVersch = Mod@textFib + verschieben, 255D; verschl = FromCharacterCode@textVerschD "d BCh ¨£É¦ o\n÷bË® ùíkÅ ÚL8¼èiѨ¦ u\n©hÕ½ ,©Y \\D 2 o8PGÃÀE û ø³$SõÅ Uù½\"dðÉô\"î Ô7 ë Ú çÖ0 ¿1Ócª ¨ pÝ O⋅0\@DiscretionaryHyphenD ºÎ \ tª¦ÜòWÂs¢ rÈûNqx «¸ã máÀ D¥§.Oõ¹ dòÁ; & ¬<u+¸¥ ئCi ¯ ø ëÚ= 2é⋅ ð×5 ïIñ£⋅ü $ ¹Cn'ü Ç2¸Bb õrÙ HWõÈ Võ¶ D⋅ ½ øAÅ © »Ðª+ F\tóÌR ù `B k \"dÜ0 x c 2´ áØë 0=Õ æÕâi ±∗M÷Mê_ì¿0\\ïv4c\nÍN\tNH\tÙ_R_8QD\tÕ " entschl = ToCharacterCode@verschlD; For@i = 0, i < laenge, entschl@@iDD −= Fibonacci@i − 1D, i ++D entschl; textEntschl = Mod@entschl − verschieben, 255D; FromCharacterCode@textEntschlD Die Caesar−Verschlüsselung ist eine der einfachsten Formen der Geheimschriften. Für die Verschlüsselung wird jeder Buchstabe des lateinischen Standardalphabets um eine bestimmte Anzahl von Positionen zyklisch verschoben. Die Anzahl bestimmt den Schlüssel, der für die gesamte Verschlüsselung unverändert bleibt. Explanation of the Codes - Encryption text = "Der zu verschlüsselnde Text"; textFib=ToCharacterCode[text]; laenge=Length[textFib]; Counts the length of the Text. Site: www.deltasoft.at M@th Desktop 7 Thursday, April 26, 2007 caesar encryption with fibunacci numbers.nb For[i=0,i<laenge, textFib[[i]]+=Fibonacci[i-1], i++] For loop which adds the fibonacci numbers to the ascii codes. textVersch=Mod[textFib+verschieben,255]; Due to the fact that the numbers could be greater than 255 they will via modulo calculated and displaced. verschl=FromCharacterCode[textVersch]; With this function you get the unreadable and encrypted text. Explanation of theCodes - Decryption entschl=ToCharacterCode[verschl]; For[i=0,i<laenge, entschl[[i]]-=Fibonacci[i-1], i++] Same loop which subtracts the fibonacci numbers from the list. textEntschl=Mod[entschl-verschieben,255]; Same subraction and again the modulo calculation. FromCharacterCode[textEntschl] This shows the decrypted text. Site: www.deltasoft.at M@th Desktop 8 Thursday, April 26, 2007 Our palette: Open ê Close caesar encryption with fibunacci numbers.nb Print Caesarverschlüsselung Functions Klartext Verschlüsseln Entschlüsseln Tools Elementary Func Plot Alg Symb π ê è!!! Answer Note N@ D Prettify Site: www.deltasoft.at M@th Desktop 9 Thursday, April 26, 2007 Open ê Close caesar encryption with fibunacci numbers.nb The improved Caesar-encryption in C# Print C#: Open ê Close Site: www.deltasoft.at M@th Desktop 10 Thursday, April 26, 2007 My Program Open ê Close caesar encryption with fibunacci numbers.nb Print Open ê Close Site: www.deltasoft.at M@th Desktop Print 11