diff --git a/.idea/Mysteryhelfer_pyCharm.iml b/.idea/Mysteryhelfer_pyCharm.iml index 74d515a..dc113cd 100644 --- a/.idea/Mysteryhelfer_pyCharm.iml +++ b/.idea/Mysteryhelfer_pyCharm.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 22213f3..a4602ea 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/EinzelfunktionenExperimentierbereich/Cursor-Liste.py b/EinzelfunktionenExperimentierbereich/Cursor-Liste.py new file mode 100644 index 0000000..88a0c73 --- /dev/null +++ b/EinzelfunktionenExperimentierbereich/Cursor-Liste.py @@ -0,0 +1,98 @@ +#! /usr/bin/python +from tkinter import * +hp=Tk() +button= [ + Button(hp, text='X_crusor', cursor='X_cursor'), + Button(hp, text='arrow', cursor='arrow'), + Button(hp, text='based_arrow_down', cursor='based_arrow_down'), + Button(hp, text='based_arrow_up', cursor='based_arrow_up'), + Button(hp, text='boat', cursor='boat'), + Button(hp, text='bogosity', cursor='bogosity'), + Button(hp, text='bottom_left_corner', cursor='bottom_left_corner'), + Button(hp, text='bottom_right_corner', cursor='bottom_right_corner'), + Button(hp, text='bottom_side', cursor='bottom_side'), + Button(hp, text='bottom_tee', cursor='bottom_tee'), + Button(hp, text='box_spiral', cursor='box_spiral'), + Button(hp, text='center_ptr', cursor='center_ptr'), + Button(hp, text='circle', cursor='circle'), + Button(hp, text='clock', cursor='clock'), + Button(hp, text='coffee_mug', cursor='coffee_mug'), + Button(hp, text='cross', cursor='cross'), + Button(hp, text='cross_reverse', cursor='cross_reverse'), + Button(hp, text='crosshair', cursor='crosshair'), + Button(hp, text='diamond_cross', cursor='diamond_cross'), + Button(hp, text='dot', cursor='dot'), + Button(hp, text='dotbox', cursor='dotbox'), + Button(hp, text='double_arrow', cursor='double_arrow'), + Button(hp, text='draft_larg', cursor='draft_large'), + Button(hp, text='draft_small', cursor='draft_small'), + Button(hp, text='draped_box', cursor='draped_box'), + Button(hp, text='exchange', cursor='exchange'), + Button(hp, text='fleur', cursor='fleur'), + Button(hp, text='gobbler', cursor='gobbler'), + Button(hp, text='gumby', cursor='gumby'), + Button(hp, text='hand1', cursor='hand1'), + Button(hp, text='hand2', cursor='hand2'), + Button(hp, text='heart', cursor='heart'), + Button(hp, text='icon', cursor='icon'), + Button(hp, text='iron_corss', cursor='iron_cross'), + Button(hp, text='left_ptr', cursor='left_ptr'), + Button(hp, text='left_side', cursor='left_side'), + Button(hp, text='left_tee', cursor='left_tee'), + Button(hp, text='leftbutton', cursor='leftbutton'), + Button(hp, text='ll_angle', cursor='ll_angle'), + Button(hp, text='lr_angle', cursor='lr_angle'), + Button(hp, text='man', cursor='man'), + Button(hp, text='middlebutton', cursor='middlebutton'), + Button(hp, text='mouse', cursor='mouse'), + Button(hp, text='none', cursor='none'), + Button(hp, text='pencil', cursor='pencil'), + Button(hp, text='pirate', cursor='pirate'), + Button(hp, text='plus', cursor='plus'), + Button(hp, text='question_arrow', cursor='question_arrow'), + Button(hp, text='right_prt', cursor='right_ptr'), + Button(hp, text='right_side', cursor='right_side'), + Button(hp, text='right_tee', cursor='right_tee'), + Button(hp, text='rightbutton', cursor='rightbutton'), + Button(hp, text='rtl_logo', cursor='rtl_logo'), + Button(hp, text='sailboat', cursor='sailboat'), + Button(hp, text='sb_down_arrow', cursor='sb_down_arrow'), + Button(hp, text='sb_v_double_arrow', cursor='sb_v_double_arrow'), + Button(hp, text='sb_h_double_arrow', cursor='sb_h_double_arrow'), + Button(hp, text='sb_left_arrow', cursor='sb_left_arrow'), + Button(hp, text='sb_right_arrow', cursor='sb_right_arrow'), + Button(hp, text='sb_up_arrow', cursor='sb_up_arrow'), + Button(hp, text='shuttle', cursor='shuttle'), + Button(hp, text='sizing', cursor='sizing'), + Button(hp, text='sb_up_arrow', cursor='sb_up_arrow'), + Button(hp, text='spider', cursor='spider'), + Button(hp, text='spraycan', cursor='spraycan'), + Button(hp, text='star', cursor='star'), + Button(hp, text='target', cursor='target'), + Button(hp, text='tcross', cursor='tcross'), + Button(hp, text='top_left_arrow', cursor='top_left_arrow'), + Button(hp, text='top_left_corner', cursor='top_left_corner'), + Button(hp, text='top_right_corner', cursor='top_right_corner'), + Button(hp, text='top_side', cursor='top_side'), + Button(hp, text='top_tee', cursor='top_tee'), + Button(hp, text='trek', cursor='trek'), + Button(hp, text='ul_angle', cursor='ul_angle'), + Button(hp, text='umbrella', cursor='umbrella'), + Button(hp, text='ur_angle', cursor='ur_angle'), + Button(hp, text='watch', cursor='watch'), + Button(hp, text='xterm', cursor='xterm'), + +] + +ro =1 +co =0 +for x in button: + x.grid(row=ro, column=co, + padx=2, pady=2, + ipady=10, ipadx=10,sticky=EW) + co +=1 + if co % 5==0: + co =0 + ro +=1 + +hp.mainloop() \ No newline at end of file diff --git a/EinzelfunktionenExperimentierbereich/jaegerzaun.py b/EinzelfunktionenExperimentierbereich/jaegerzaun.py index 0f3f980..cf2c2b6 100644 --- a/EinzelfunktionenExperimentierbereich/jaegerzaun.py +++ b/EinzelfunktionenExperimentierbereich/jaegerzaun.py @@ -16,17 +16,17 @@ def array_ausgabe(arri: list): def encrypt(plain_text: str, rails: int): - arr = [["_" for x in range(len(plain_text))] for y in range(rails)] + arr = [["_" for _ in range(len(plain_text))] for _ in range(rails)] r = 0 z = 0 plus = True for b in plain_text: arr[r][z] = b z += 1 - if r+1 == rails and plus: + if r + 1 == rails and plus: plus = False r -= 1 - elif r-1 < 0 and not plus: + elif r - 1 < 0 and not plus: plus = True r += 1 elif plus: @@ -40,15 +40,44 @@ def encrypt(plain_text: str, rails: int): out += arr[i][j] print(out) array_ausgabe(arr) - print() def decrypt(cipher: str, rails: int): - arr = [["" for x in range(len(cipher))] for y in range(rails)] - for r in range(rails): - - #arr[r][z] = b - pass + arr = [["_" for _ in range(len(cipher))] for _ in range(rails)] + # cipher ins array reinbasteln + x, y = 0, 0 + first_x = True + for b in cipher: + if x >= len(cipher) and y < rails: + y += 1 + x = y + first_x = True + arr[y][x] = b + if y == 0 or (first_x and y != rails-1): + x = x + (rails - y - 1) * 2 + first_x = False + elif y == rails-1 or first_x is False: + x = x + (y * 2) + first_x = True + array_ausgabe(arr) + # dekodierten Text aus array holen + out = "" + x, y = 0, 0 + down = True + for i in range(len(cipher)): + out += arr[y][x] + x += 1 + if down and y+1 == rails: + down = False + y -= 1 + elif down: + y += 1 + elif down is False and y == 0: + down = True + y += 1 + elif down is False: + y -= 1 + print(out) encrypt(t1r2, 2) diff --git a/HTML/version.txt b/HTML/version.txt new file mode 100644 index 0000000..1792feb --- /dev/null +++ b/HTML/version.txt @@ -0,0 +1 @@ +Version: 1.10 (17. März 2024) \ No newline at end of file diff --git a/Mysteryhelfer-Python-ohne_data.zip b/Mysteryhelfer-Python-ohne_data.zip deleted file mode 100644 index 561ef44..0000000 Binary files a/Mysteryhelfer-Python-ohne_data.zip and /dev/null differ diff --git a/Mysteryhelfer.pyw b/Mysteryhelfer.pyw index d6c875e..4f178da 100644 --- a/Mysteryhelfer.pyw +++ b/Mysteryhelfer.pyw @@ -14,7 +14,7 @@ import webbrowser # für website in Infofenster import binascii # für base64_ascii ####################################### -versionsnummer = "Version: 1.01 (21. Juni 2023)" +versionsnummer = "Version: 1.10 (17. März 2024)" website = "http://mysteryhelfer.tba-tm.bplaced.net" ####################################### @@ -4319,10 +4319,10 @@ def rail_encrypt(plain_text: str, rails: int): for b in plain_text: arr[r][z] = b z += 1 - if r+1 == rails and plus: + if r + 1 == rails and plus: plus = False r -= 1 - elif r-1 < 0 and not plus: + elif r - 1 < 0 and not plus: plus = True r += 1 elif plus: @@ -4344,8 +4344,17 @@ def jaegerzaun_encrypt(): pw = pw.strip() if eingabetext == "": Ausgabe.insert(1.0, """HILFE: [encrypt Jägerzaun] - Jägerzaun (auch Railfence oder ZigZag-Chiffre genannt) - +Jägerzaun (auch Railfence oder ZigZag-Chiffre genannt) +Bei dieser Chiffre wird kodiert, indem man einen Text im Zickzackmuster +in ein Feld aus z.B. 3 Zeilen und so vielen Spalten wie der Text lang ist +schreibt. Man beginnt in Spalte 1 - Zeile 1, dann geht es in Spalte 2 - Zeile 1 +weiter danach Spalte 3 - Zeile 3, dann Spalte 4 - Zeile 2, Spalte 5 - Zeile 1 usw. +Danach werden die Buchstaben einfach Zeile für Zeile hintereinander geschrieben. +Unterschiedliche Varianten entstehen einfach dadurch, dass man mit unterschiedlich +vielen Zeilen arbeitet welche im Schlüsselfeld anzugeben ist. + +Die Funktion erzeugt hierbei einmal eine Ausgabe bei welcher auch Leerzeichen +mitgeschrieben werden und eine Ausgabe wo zuvor die Leerzeichen entfernt werden. """ + "\n\n") elif pw == "" or not pw.isdigit(): Ausgabe.insert(1.0, "Bitte eine Zahl im Schlüsselfeld eingeben!!\n", "re") @@ -4361,6 +4370,86 @@ def jaegerzaun_encrypt(): Ausgabe.insert(1.0, "Schlüsselzahl fehlerhaft oder kleiner als 2.\n", "re") +def rail_decrypt(cipher: str, rails: int): + arr = [["_" for _ in range(len(cipher))] for _ in range(rails)] + # cipher ins array reinbasteln + x, y = 0, 0 + first_x = True + for b in cipher: + if x >= len(cipher) and y < rails: + y += 1 + x = y + first_x = True + arr[y][x] = b + if y == 0 or (first_x and y != rails - 1): + x = x + (rails - y - 1) * 2 + first_x = False + elif y == rails - 1 or first_x is False: + x = x + (y * 2) + first_x = True + # dekodierten Text aus array holen + out = "" + x, y = 0, 0 + down = True + for i in range(len(cipher)): + out += arr[y][x] + x += 1 + if down and y + 1 == rails: + down = False + y -= 1 + elif down: + y += 1 + elif down is False and y == 0: + down = True + y += 1 + elif down is False: + y -= 1 + return out + + +def jaegerzaun_decrypt(): + trennlinie() + eingabetext = Eingabe.get(1.0, END) + eingabetext = eingabetext.strip().replace("\n", " ") + pw = PW_Eingabe.get() + pw = pw.strip() + if eingabetext == "": + Ausgabe.insert(1.0, """HILFE: [decrypt Jägerzaun] +Jägerzaun (auch Railfence oder ZigZag-Chiffre genannt) +Bei dieser Chiffre wird kodiert, indem man einen Text im Zickzackmuster +in ein Feld aus z.B. 3 Zeilen und so vielen Spalten wie der Text lang ist +schreibt. Man beginnt in Spalte 1 - Zeile 1, dann geht es in Spalte 2 - Zeile 1 +weiter danach Spalte 3 - Zeile 3, dann Spalte 4 - Zeile 2, Spalte 5 - Zeile 1 usw. +Danach werden die Buchstaben einfach Zeile für Zeile hintereinander geschrieben. +Unterschiedliche Varianten entstehen einfach dadurch, dass man mit unterschiedlich +vielen Zeilen arbeitet welche im Schlüsselfeld angegeben werden kann. + +Die Funktion erzeugt hierbei einmal eine Ausgabe bei welcher auch Leerzeichen +mitgeschrieben werden und eine Ausgabe wo zuvor die Leerzeichen entfernt werden. + +Wird im Schlüsselfeld keine Zahl angegeben erfolgt automatisch die Dekodierung +für alle Zeilenanzahlen von 2-12.""" + "\n\n") + elif pw == "": + for i in range(12, 1, -1): + Ausgabe.insert(1.0, f'{i:02} - {rail_decrypt(eingabetext.replace(" ", ""), i)}\n') + Ausgabe.insert(1.0, "ohne Leerzeichen\n", "bu") + for i in range(12, 1, -1): + Ausgabe.insert(1.0, f'{i:02} - {rail_decrypt(eingabetext, i)}\n') + Ausgabe.insert(1.0, "inkl. Leerzeichen\n", "bu") + elif not pw.isdigit(): + Ausgabe.insert(1.0, "Bitte eine Zahl im Schlüsselfeld eingeben!!\n", "re") + else: + try: + if int(pw) < 2: + raise ValueError("Zahl zu klein") + Ausgabe.insert(1.0, rail_decrypt(eingabetext.replace(" ", ""), int(pw)) + "\n") + Ausgabe.insert(1.0, "ohne Leerzeichen\n", "bu") + Ausgabe.insert(1.0, rail_decrypt(eingabetext, int(pw)) + "\n") + Ausgabe.insert(1.0, "inkl. Leerzeichen\n", "bu") + except ValueError: + Ausgabe.insert(1.0, "Schlüsselzahl fehlerhaft oder kleiner als 2.\n", "re") + + # ------------------------------------------------------------------------------------------ def knoeppe_aendern2(): B44.config(text="Button88", command="", bg=bgcolor_default, cursor="") @@ -4410,7 +4499,8 @@ def knoeppe_aendern1(): B55.config(text="Base64<->ASCII", command=base64_ascii, bg="#7777ff", cursor='question_arrow', font=schrift) B56.config(text="Jägerzaun kodieren", command=jaegerzaun_encrypt, bg="#3388aa", cursor='question_arrow', font=schrift) - B57.config(text="Button79", command="", bg=bgcolor_default, cursor="") + B57.config(text="Jägerzaun dekodieren", command=jaegerzaun_decrypt, bg="#3388aa", cursor='question_arrow', + font=schrift) B58.config(text="Button80", command="", bg=bgcolor_default, cursor="") B59.config(text="Button81", command="", bg=bgcolor_default, cursor="") B60.config(text="Button82", command="", bg=bgcolor_default, cursor="") diff --git a/Versionsgeschichte.txt b/Versionsgeschichte.txt index ff5270b..0ad2ffa 100644 --- a/Versionsgeschichte.txt +++ b/Versionsgeschichte.txt @@ -1,14 +1,18 @@ +1.10 +rework: diverse Codeüberarbeitungen +neu: Jägerzaun (Railfence) - Chiffre + 1.01 -neu: Scrollleiste für Eingabe und Ausgabe ergänzt +neu: Scrollleiste für Eingabe und Ausgabe ergänzt bugfix: Zahlwortsuch zwanzig, hundert, tausend wird jetzt auch gefunden fix: ein paar kleine Sachen im Code optimiert/verbessert 1.00 -release: es wird noch einfacher das Ding zum laufen zu bringen +release: es wird noch einfacher das Ding zum Laufen zu bringen new: Update-Check eingebaut update: ein paar kleine Schönheitsreparaturen am Quelltext update: Webseite aktualisiert, -update: öffentliche .exe-Version für Windowsbenutzer +update: Öffentliche .exe-Version für Windowsbenutzer 0.97 neu: manuelle Config ist doof, deshalb klicki-klicki-konfig-editor gebastelt @@ -38,7 +42,7 @@ neu: T9-EN, T9-DE update: Maptilesfunktion testet nun bis Zoomstufe 30 statt vorher 25 neu: Funktion zum Umwandeln von Quadtreekoordinaten -0.90a Keine Programmänderung sondern nur eine UTF-8-kodierte Variante für die Benutzung unter Pydroid ergänzt. +0.90a Keine Programmänderung sondern nur eine UTF-8-kodierte Variante für die Benutzung unter Pydroid ergänzt. 0.90 update: Ab jetzt alles mit Schriftart "Times New Roman" und Schriftgröße 10, was Abhilfe schaffen sollte bei @@ -51,7 +55,7 @@ bugfix: Funktionsknöpfe für Kennyspeak waren zwischenzeitlich verlorengegangen 0.88 update: Primfaktorsuche eingeschränkt um extrem lange Suchläufe zu verhindern. - Es erfolgt ein Abbruch, wenn ein Faktor größer als 100 Millionen ist. + Es erfolgt ein Abbruch, wenn ein Faktor größer als 100 Millionen ist. 0.87 update: noch einmal die Anordnung für ein paar Funktionsknöpfe geändert und Funktionen, welche @@ -83,13 +87,13 @@ neu: Chronogramm 0.80 neu: Text rückwärts update: Layout-Änderung und Anpassung, damit das Fenster auch bei kleineren Bildschirmmodi - noch komplett rauf passt und Vorbereitung für jede Menge zusätzliche Funktionsknöppe + noch komplett rauf passt und Vorbereitung für jede Menge zusätzliche Funktionsknöppe 0.77 neu: Maptiles/Kachelkoord. 0.76 bugfix: in die Primzahlprüffunktion hatte sich ein Fehler eingeschlichen wodurch 289 als Primzahl erkannt - wurde und für alle größeren Primzahlen eine falsche Position ermittelt wurde + wurde und für alle grüßeren Primzahlen eine falsche Position ermittelt wurde 0.75 neu: Polybios, Klopfcode @@ -110,12 +114,12 @@ neu: -Umgestaltung Oberfläche, da die Funktionsknöpfe ausgehen und ein Eingab fehlte, außerdem etwas Farbe in Ausgabetexte für bessere Lesbarkeit gebracht -Vignere-Chiffre -Woseley-Chiffre -update: -Re-Morse braucht jetzt nur noch die normalen Wörterbuchdateien von +update: -Re-Morse braucht jetzt nur noch die normalen Wörterbuchdateien von https://sourceforge.net/projects/germandict (deutsch) bzw. https://sourceforge.net/projects/wordlist (englisch) wie sie auch von der Anagrammsuche genutzt werden. Da die deutsche Version allerdings dadurch extrem an Geschwindigkeit verliert ist eine - Funktion integriert, über die sich das Spezial-Wörterbuch aus dem normalen generieren läßt, + Funktion integriert, über die sich das Spezial-Wörterbuch aus dem normalen generieren läßt, mit welchem die Suche dann wieder deutlich schneller geht. (In Eingabefeld GENERATE eingeben und dann auf Knopf [Re-Morse-DE] allerdings wird die Generierung dann auch nur durchgeführt wenn die Datei morse-de.dic im Verzeichnis data fehlt) diff --git a/py-to-exe-config.json b/py-to-exe-config.json index 5e94c27..599804f 100644 --- a/py-to-exe-config.json +++ b/py-to-exe-config.json @@ -7,7 +7,7 @@ }, { "optionDest": "filenames", - "value": "D:/mager/Documents/Python/Mysteryhelfer/Mysteryhelfer.pyw" + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/Mysteryhelfer.pyw" }, { "optionDest": "onefile", @@ -19,7 +19,7 @@ }, { "optionDest": "icon_file", - "value": "D:/mager/Documents/Python/Mysteryhelfer/mystery-helfer-logo.ico" + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/mystery-helfer-logo.ico" }, { "optionDest": "ascii", @@ -71,19 +71,19 @@ }, { "optionDest": "datas", - "value": "D:/mager/Documents/Python/Mysteryhelfer/Versionsgeschichte.txt;." + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/Versionsgeschichte.txt;." }, { "optionDest": "datas", - "value": "D:/mager/Documents/Python/Mysteryhelfer/Kurzanleitung.txt;." + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/Kurzanleitung.txt;." }, { "optionDest": "datas", - "value": "D:/mager/Documents/Python/Mysteryhelfer/Mysteryhelfer.pyw;." + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/Mysteryhelfer.pyw;." }, { "optionDest": "datas", - "value": "D:/mager/Documents/Python/Mysteryhelfer/data_f\u00fcr_auto-py-to-exe;data/" + "value": "D:/mager/Documents/Python/Mysteryhelfer_git/data;data/" } ], "nonPyinstallerOptions": { diff --git a/Mysteryhelfer-Python-komplett.zip b/release/Mysteryhelfer-Python-komplett.zip similarity index 67% rename from Mysteryhelfer-Python-komplett.zip rename to release/Mysteryhelfer-Python-komplett.zip index 3ad3bc9..1ca1e4f 100644 Binary files a/Mysteryhelfer-Python-komplett.zip and b/release/Mysteryhelfer-Python-komplett.zip differ diff --git a/release/Mysteryhelfer-Python-ohne_data.zip b/release/Mysteryhelfer-Python-ohne_data.zip new file mode 100644 index 0000000..8adca80 Binary files /dev/null and b/release/Mysteryhelfer-Python-ohne_data.zip differ diff --git a/Mysteryhelfer-Windows-all_in_one.zip b/release/Mysteryhelfer-Windows-all_in_one.zip similarity index 73% rename from Mysteryhelfer-Windows-all_in_one.zip rename to release/Mysteryhelfer-Windows-all_in_one.zip index a3501b1..9895875 100644 Binary files a/Mysteryhelfer-Windows-all_in_one.zip and b/release/Mysteryhelfer-Windows-all_in_one.zip differ diff --git a/Mysteryhelfer-Windows-ohne_data.zip b/release/Mysteryhelfer-Windows-ohne_data.zip similarity index 56% rename from Mysteryhelfer-Windows-ohne_data.zip rename to release/Mysteryhelfer-Windows-ohne_data.zip index c2116fc..9122e9c 100644 Binary files a/Mysteryhelfer-Windows-ohne_data.zip and b/release/Mysteryhelfer-Windows-ohne_data.zip differ diff --git a/version.txt b/version.txt deleted file mode 100644 index 52f401f..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -Version: 1.01 (21. Juni 2023) \ No newline at end of file