Dateien hochladen nach „plugins“

main
Justus Jan Nico Wolff 2022-12-22 23:18:43 +01:00
parent cf915393c9
commit 3344f03bc2
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
{'name': 'encryption system builtin', 'author': 'justus', 'main': '#path\nimport tkinter as tk\nimport easygui\nfrom tkinter import messagebox\n\ndef xor_encrypt(text, key):\n text = text.encode(\'utf-8\')\n key = key.encode(\'utf-8\')\n encrypted_bytes = []\n for i, b in enumerate(text):\n encrypted_bytes.append(b ^ key[i % len(key)])\n return \'\'.join([\'%02x\' % b for b in encrypted_bytes])\n\ndef xor_decrypt(encrypted, key):\n key = key.encode(\'utf-8\')\n encrypted_bytes = [int(encrypted[i:i+2], 16) for i in range(0, len(encrypted), 2)]\n decrypted_bytes = []\n for i, b in enumerate(encrypted_bytes):\n decrypted_bytes.append(b ^ key[i % len(key)])\n decrypted = \'\'.join([chr(b) for b in decrypted_bytes])\n return decrypted\n\ncontainer = tk.Tk("verschlüsseler")\ndictionary = {\'0000\': \'0\', \'0001\': \'1\', \'0002\': \'2\', \'0003\': \'3\', \'0004\': \'4\', \'0005\': \'5\', \'0006\': \'6\', \'0007\': \'7\', \'0008\': \'8\', \'0009\': \'9\', \'0010\': \'a\', \'0011\': \'b\', \'0012\': \'c\', \'0013\': \'d\', \'0014\': \'e\', \'0015\': \'f\', \'0016\': \'g\', \'0017\': \'h\', \'0018\': \'i\', \'0019\': \'j\', \'0020\': \'k\', \'0021\': \'l\', \'0022\': \'m\', \'0023\': \'n\', \'0024\': \'o\', \'0025\': \'p\', \'0026\': \'q\', \'0027\': \'r\', \'0028\': \'s\', \'0029\': \'t\', \'0030\': \'u\', \'0031\': \'v\', \'0032\': \'w\', \'0033\': \'x\', \'0034\': \'y\', \'0035\': \'z\', \'0036\': \'A\', \'0037\': \'B\', \'0038\': \'C\', \'0039\': \'D\', \'0040\': \'E\', \'0041\': \'F\', \'0042\': \'G\', \'0043\': \'H\', \'0044\': \'I\', \'0045\': \'J\', \'0046\': \'K\', \'0047\': \'L\', \'0048\': \'M\', \'0049\': \'N\', \'0050\': \'O\', \'0051\': \'P\', \'0052\': \'Q\', \'0053\': \'R\', \'0054\': \'S\', \'0055\': \'T\', \'0056\': \'U\', \'0057\': \'V\', \'0058\': \'W\', \'0059\': \'X\', \'0060\': \'Y\', \'0061\': \'Z\', \'0062\': \'!\', \'0063\': \'"\', \'0064\': \'#\', \'0065\': \'$\', \'0066\': \'%\', \'0067\': \'&\', \'0068\': "\'", \'0069\': \'(\', \'0070\': \')\', \'0071\': \'*\', \'0072\': \'+\', \'0073\': \',\', \'0074\': \'-\', \'0075\': \'.\', \'0076\': \'/\', \'0077\': \':\', \'0078\': \';\', \'0079\': \'<\', \'0080\': \'=\', \'0081\': \'>\', \'0082\': \'?\', \'0083\': \'@\', \'0084\': \'[\', \'0085\': \'\\\\\', \'0086\': \']\', \'0087\': \'^\', \'0088\': \'_\', \'0089\': \'`\', \'0090\': \'{\', \'0091\': \'|\', \'0092\': \'}\', \'0093\': \'~\', \'0094\': \' \', \'0095\': \'\\t\', \'0096\': \'\\n\', \'0097\': \'\\r\', \'0098\': \'\\x0b\', \'0099\': \'\\x0c\'}\ndef tonormal(text):\n dictionary2 = {}\n for i in dictionary:\n dictionary2[dictionary[i]] = i\n out = ""\n for i in text:\n out = out + dictionary2[i]\n return out\n\ndef totext(temp):\n out = ""\n for i in range(0, len(temp), 4):\n temp2 = temp[i]\n temp2 = temp2+temp[i+1]\n temp2 = temp2+temp[i+2]\n temp2 = temp2+temp[i+3]\n if temp2 in dictionary:\n out = out + dictionary[temp2]\n return out\n\ndef encrypt():\n password = easygui.enterbox("passwort eingeben", "verschlüsseln")\n if password:\n temp = open(path, \'r\')\n temp = temp.read()\n out = xor_encrypt(temp, password)\n out = tonormal(out)\n temp = open(path, \'w\')\n temp.write(out)\n temp.close()\n\ndef decrypt():\n password = easygui.enterbox("passwort eingeben", "entschlüsseln")\n temp = open(path, \'r\')\n temp = temp.read()\n temp = totext(temp)\n out = xor_decrypt(temp, password)\n if out == False:\n messagebox.showerror("fehler!", "das passwort ist falsch! bitte versuchen sie es erneut")\n else:\n temp = open(path, \'w\')\n temp.write(out)\n temp.close()\n\nencryptbutton = tk.Button(container, text="verschlüsseln", command=encrypt)\nencryptbutton.grid()\ndecryptbutton = tk.Button(container, text="entschlüsseln", command=decrypt)\ndecryptbutton.grid()\ncontainer.mainloop()', 'extension': '.*'}

View File

@ -0,0 +1 @@
{'name': 'text editor. builtin', 'author': 'justus', 'main': '#path\nimport tkinter as tk\ndictionary = {\'0000\': \'0\', \'0001\': \'1\', \'0002\': \'2\', \'0003\': \'3\', \'0004\': \'4\', \'0005\': \'5\', \'0006\': \'6\', \'0007\': \'7\', \'0008\': \'8\', \'0009\': \'9\', \'0010\': \'a\', \'0011\': \'b\', \'0012\': \'c\', \'0013\': \'d\', \'0014\': \'e\', \'0015\': \'f\', \'0016\': \'g\', \'0017\': \'h\', \'0018\': \'i\', \'0019\': \'j\', \'0020\': \'k\', \'0021\': \'l\', \'0022\': \'m\', \'0023\': \'n\', \'0024\': \'o\', \'0025\': \'p\', \'0026\': \'q\', \'0027\': \'r\', \'0028\': \'s\', \'0029\': \'t\', \'0030\': \'u\', \'0031\': \'v\', \'0032\': \'w\', \'0033\': \'x\', \'0034\': \'y\', \'0035\': \'z\', \'0036\': \'A\', \'0037\': \'B\', \'0038\': \'C\', \'0039\': \'D\', \'0040\': \'E\', \'0041\': \'F\', \'0042\': \'G\', \'0043\': \'H\', \'0044\': \'I\', \'0045\': \'J\', \'0046\': \'K\', \'0047\': \'L\', \'0048\': \'M\', \'0049\': \'N\', \'0050\': \'O\', \'0051\': \'P\', \'0052\': \'Q\', \'0053\': \'R\', \'0054\': \'S\', \'0055\': \'T\', \'0056\': \'U\', \'0057\': \'V\', \'0058\': \'W\', \'0059\': \'X\', \'0060\': \'Y\', \'0061\': \'Z\', \'0062\': \'!\', \'0063\': \'"\', \'0064\': \'#\', \'0065\': \'$\', \'0066\': \'%\', \'0067\': \'&\', \'0068\': "\'", \'0069\': \'(\', \'0070\': \')\', \'0071\': \'*\', \'0072\': \'+\', \'0073\': \',\', \'0074\': \'-\', \'0075\': \'.\', \'0076\': \'/\', \'0077\': \':\', \'0078\': \';\', \'0079\': \'<\', \'0080\': \'=\', \'0081\': \'>\', \'0082\': \'?\', \'0083\': \'@\', \'0084\': \'[\', \'0085\': \'\\\\\', \'0086\': \']\', \'0087\': \'^\', \'0088\': \'_\', \'0089\': \'`\', \'0090\': \'{\', \'0091\': \'|\', \'0092\': \'}\', \'0093\': \'~\', \'0094\': \' \', \'0095\': \'\\t\', \'0096\': \'\\n\', \'0097\': \'\\r\', \'0098\': \'\\x0b\', \'0099\': \'\\x0c\'}\ndef totext():\n out = ""\n temp = open(path, \'r\')\n temp = temp.read()\n for i in range(0, len(temp), 4):\n temp2 = temp[i]\n temp2 = temp2+temp[i+1]\n temp2 = temp2+temp[i+2]\n temp2 = temp2+temp[i+3]\n if temp2 in dictionary:\n out = out + dictionary[temp2]\n return out\n\ndef tonormal(text):\n dictionary2 = {}\n for i in dictionary:\n dictionary2[dictionary[i]] = i\n out = ""\n for i in text:\n out = out + dictionary2[i]\n temp = open(path, \'w\')\n temp.write(out)\n temp.close()\n\ndef save():\n text = label.get("1.0", tk.END)\n tonormal(text)\n\ncontainer = tk.Tk("editor")\ntemp = totext()\nscrollbar = tk.Scrollbar(container)\nscrollbar.grid(row=0, column=1)\nlabel = tk.Text(container, yscrollcommand=scrollbar.set)\nlabel.insert(tk.INSERT, temp)\nlabel.grid(row=0, column=0)\nscrollbar.config(command=label.yview)\nsavebutton = tk.Button(container, text="speichern", command=save)\nsavebutton.grid()\ncontainer.mainloop()\n\n\n\n\n', 'extension': '.txt'}