-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
249 lines (226 loc) · 91.1 KB
/
setup.py
File metadata and controls
249 lines (226 loc) · 91.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#!/usr/bin/env python3
# setup.py, Copyright(c) 2021 Martin S. Merkli
# version: 1.2
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from random import randint
from tkinter import filedialog
from tkinter import messagebox
from tkinter import *
import os
import sys
from hashlib import sha512
from hashlib import pbkdf2_hmac
location = os.getcwd()
if location[-1] != '/':
location += '/'
rsakeys = 'none'
def secure_hash(data: bytes, mode: int = 1, length: int = 64) -> bytes:
hashed = pbkdf2_hmac('sha512', data, sha512(data).digest(), (mode + 10) * 1000, length)
return hashed
def randomprime(length: int = 16) -> int:
length -= 1
testnumber = randint((10 ** length) + 1, (9 * (10 ** length)) + 9)
if testnumber % 2 == 0:
testnumber += 1
while not rabinmillerprime(testnumber):
testnumber += 2
return testnumber
def rabinmillerprime(number: int, rounds: int = 64) -> bool:
small_primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
if number < 2:
return False
for p in small_primes:
if number < p * p:
return True
if number % p == 0:
return False
r, s = 0, number - 1
while s % 2 == 0:
r += 1
s //= 2
for _ in range(rounds):
a = randint(2, number - 1)
x = pow(a, s, number)
if x == 1 or x == number - 1:
continue
for _ in range(r - 1):
x = pow(x, 2, number)
if x == number - 1:
break
else:
return False
return True
def modinverse(e: int, phin: int) -> int:
try:
modinv = pow(e, -1, phin)
return modinv
except:
def egdc(a, b):
if a == 0:
return b, 0, 1
else:
gb, yb, xb = egdc(b % a, a)
return gb, xb - (b // a) * yb, yb
g, x, y = egdc(e, phin)
if g != 1:
raise Exception('modular inverse does not exist')
else:
return x % phin
def generatersakeys(base10length: int = 320) -> list:
p = randomprime(base10length // 2)
q = randomprime(base10length // 2)
while p == q:
q = randomprime(base10length // 2)
n = p * q
phin = (p - 1) * (q - 1)
e = randomprime(base10length // 2)
while n % e == 2 or phin % e == 2 or q == e or p == e:
e = randomprime(base10length // 2)
d = modinverse(e, phin)
del p
del q
return [[e, n], [d, n]]
def selectlocation(label: Label):
global location
inputlocation = filedialog.askdirectory()
if isinstance(inputlocation, str):
if inputlocation[-1] != '/':
inputlocation += '/'
location = inputlocation
label.config(text=location)
def cancelinstallation():
root.quit()
sys.exit()
def openabout():
messagebox.showinfo('About - Setup FileEncryption', 'Copyright(c) 2021 Martin S. Merkli\nThis program is free and'
' open-source software and is licensed under the GNU GPL3.'
' Visit https://www.gnu.org/licenses/ for more information.'
'\nYou can read more about this project in the documentation.')
def continuersa():
password = o1.get()
if password == 'password':
messagebox.showerror('Password not secure - Setup FileEncryption.', "'password' is not secure. Please enter "
"an other password")
elif o1.get() != q1.get():
messagebox.showerror("Passwords don't match - Setup FileEncryption", "The passwords which you entered didn't"
" match. \nPlease try again.")
o1.delete(0, 'end')
q1.delete(0, 'end')
else:
root2.quit()
if __name__ == '__main__':
mf = b'#!/usr/bin/env python3\n# FileEncryption.py, Copyright(c) 2021 Martin S. Merkli\n# version: 1.2\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see <https://www.gnu.org/licenses/>.\n\nfrom tkinter import *\nfrom hashlib import pbkdf2_hmac\nfrom hashlib import sha512\nfrom random import randrange\nimport os\nfrom tkinter import filedialog\nfrom tkinter import messagebox\nfrom time import time\n\n\ndebug = False\nfileselected = \'none\'\nfilename = \'none\'\nlanguage = []\n\n\ndef xor(x: bytes, y: bytes) -> bytes:\n return bytes([_a ^ _b for _a, _b in zip(x, y)])\n\n\ndef secure_hash(data: bytes, mode: int = 1, length: int = 64) -> bytes:\n hashed = pbkdf2_hmac(\'sha512\', data, sha512(data).digest(), (mode + 10) * 1000, length)\n return hashed\n\n\ndef hashpassword2(password: str, minlength: int) -> bytes:\n pbkdf2_hmac_hashed = secure_hash(password.encode(), 4, 1024)\n hashed = pbkdf2_hmac_hashed\n while len(hashed) < minlength:\n hashed += hashed\n printdebug(\'hashed password\')\n return hashed\n\n\ndef hashpassword1p0(password: str, minlength: int) -> bytes:\n sha512hashed = sha512(password.encode()).digest()\n hashed = sha512hashed\n while len(hashed) < minlength:\n hashed += hashed\n printdebug(\'hashed password\')\n return hashed\n\n\ndef randomprime(length: int = 16) -> int:\n length -= 1\n testnumber = randrange((10 ** length) + 1, (9 * (10 ** length)) + 9)\n if testnumber % 2 == 0:\n testnumber += 1\n while not rabinmillerprime(testnumber):\n testnumber += 2\n printdebug(\'prime found\')\n return testnumber\n\n\ndef rabinmillerprime(number: int, rounds: int = 64) -> bool:\n small_primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]\n if number < 2:\n return False\n for p in small_primes:\n if number < p * p:\n return True\n if number % p == 0:\n return False\n r, s = 0, number - 1\n while s % 2 == 0:\n r += 1\n s //= 2\n for _ in range(rounds):\n a = randrange(2, number - 1)\n x = pow(a, s, number)\n if x == 1 or x == number - 1:\n continue\n for _ in range(r - 1):\n x = pow(x, 2, number)\n if x == number - 1:\n break\n else:\n return False\n return True\n\n\ndef modinverse(e: int, phin: int) -> int:\n try:\n modinv = pow(e, -1, phin)\n printdebug(\'modinverse 3.8+ used\')\n return modinv\n except:\n printdebug(\'using old modinverse\')\n\n def egdc(a, b):\n if a == 0:\n return b, 0, 1\n else:\n gb, yb, xb = egdc(b % a, a)\n return gb, xb - (b // a) * yb, yb\n\n g, x, y = egdc(e, phin)\n if g != 1:\n raise Exception(\'modular inverse does not exist\')\n else:\n return x % phin\n\n\ndef generatersakeys(base10length: int = 320) -> list:\n p = randomprime(base10length // 2)\n q = randomprime(base10length // 2)\n while p == q:\n printdebug(\'p=q\')\n q = randomprime(base10length // 2)\n n = p * q\n phin = (p - 1) * (q - 1)\n e = randomprime(base10length // 2)\n while n % e == 2 or phin % e == 2 or q == e or p == e:\n e = randomprime(base10length // 2)\n d = modinverse(e, phin)\n del p\n del q\n printdebug(\'generated RSA keys\')\n return [[e, n], [d, n]]\n\n\ndef rsaencrypt(file: bytes, publickeys: list) -> bytes:\n filekey = int(os.urandom(500).hex(), 16)\n key = pow(filekey, publickeys[0], publickeys[1])\n hashed = hashpassword2(str(filekey), len(file))\n normalcipher = xor(file, hashed)\n cipher = b\'\\x02RSA\'\n cipher += bytes([len(str(key).encode()) // 256])\n cipher += bytes([len(str(key).encode()) % 256])\n cipher += str(key).encode()\n cipher += normalcipher\n printdebug(\'encrypted content with rsa\')\n return cipher\n\n\ndef rsadecrypt(cipher: bytes, privatekeys: list) -> bytes:\n if cipher[0] == 1:\n printdebug(\'RSA-version: v1\')\n return rsadecrypt1(cipher, privatekeys)\n elif cipher[0] == 2:\n printdebug(\'RSA-version: v2\')\n return rsadecrypt2(cipher, privatekeys)\n else:\n printdebug(\'unknown rsa-version\')\n askwin = Tk()\n askwin.title(text(10) + \' - \' + text(1))\n a1 = Label(askwin, text=text(11) + \'\\n\' + text(12))\n options = [text(13), \'v1\', \'v2\']\n clicked = StringVar()\n clicked.set(text(13))\n a2 = OptionMenu(askwin, clicked, *options)\n a3 = Button(askwin, text=text(14), command=askwin.quit)\n a1.grid(row=0, column=0)\n a2.grid(row=1, column=0)\n a3.grid(row=2, column=0)\n askwin.mainloop()\n selected = clicked.get()\n if selected == text(13):\n printdebug(\'version canceled\')\n return b\'__cancel__\'\n elif selected == \'v1\':\n printdebug(\'v1 selected\')\n return rsadecrypt1(cipher, privatekeys)\n elif selected == \'v2\':\n printdebug(\'v2 selected\')\n return rsadecrypt2(cipher, privatekeys)\n\n\ndef rsadecrypt1(cipher: bytes, privatekeys: list) -> bytes:\n keylength = (cipher[4] * 256) + (cipher[5]) + 6\n cryptkey = int(cipher[6:keylength].decode())\n key = pow(cryptkey, privatekeys[0], privatekeys[1])\n cipherfile = cipher[keylength:]\n hashed = hashpassword1p0(str(key), len(cipherfile))\n return xor(cipherfile, hashed)\n\n\ndef rsadecrypt2(cipher: bytes, privatekeys: list) -> bytes:\n keylength = (cipher[4] * 256) + (cipher[5]) + 6\n cryptkey = int(cipher[6:keylength].decode())\n key = pow(cryptkey, privatekeys[0], privatekeys[1])\n cipherfile = cipher[keylength:]\n hashed = hashpassword2(str(key), len(cipherfile))\n return xor(cipherfile, hashed)\n\n\ndef inttobytes(number: int) -> bytes:\n bstring = b\'\'\n new = number\n while new > 0:\n bstring = bytes([new % 256]) + bstring\n new //= 256\n printdebug(\'Turned integer to bytes\')\n return bstring\n\n\ndef bytestoint(data: bytes) -> int:\n return int.from_bytes(data, \'big\')\n\n\ndef printdebug(message: str) -> None:\n global debug\n if debug:\n print(str(time()) + \' - \' + message)\n else:\n pass\n\n\ndef getrsapublic() -> str:\n try:\n with open(\'rsa.txt\', \'r\') as keyfile:\n lines = keyfile.readlines()\n one = hex(int(lines[0]))[2:]\n two = hex(int(lines[2]))[2:]\n output = \'01g\' + one + \'g\' + two\n except ValueError:\n printdebug(\'ERROR: getrsa didnt work\')\n output = \'__ERROR__\'\n return output\n\n\ndef selectfile(label: Label) -> None:\n global fileselected\n fileselectedtmp = filedialog.askopenfilename(initialdir=os.getcwd(), title=text(34))\n global filename\n if fileselectedtmp == ():\n fileselected = \'none\'\n else:\n fileselected = fileselectedtmp\n if fileselected == \'none\':\n filename = \'none\'\n else:\n filename = fileselected.split(\'/\')[-1]\n label.config(text=filename)\n printdebug(\'selected file\')\n\n\ndef selectfilename():\n global fileselected\n global filename\n filename = fileselected.split(\'/\')[-1]\n\n\ndef isrsakey(potentialkey: str) -> bool:\n split = potentialkey.split(\'g\')\n for part in split:\n part.replace(\'g\', \'\')\n if len(split) == 3 and split[0] == \'01\':\n printdebug(\'is rsa key\')\n return True\n else:\n printdebug(\'is not rsa key\')\n return False\n\n\ndef encryptfile(passwordentry: Entry, filedirectory: str) -> None:\n password = passwordentry.get()\n if password == \'password\':\n printdebug(\'unsecure password\')\n if messagebox.askyesnocancel(text(15) + \' - \' + text(1), text(16) + text(17)):\n pass\n else:\n return None\n if filedirectory == \'none\':\n printdebug(\'no file selected\')\n messagebox.showerror(text(18) + \' - \' + text(1), text(19))\n return None\n with open(filedirectory, \'rb\') as originalfile:\n with open(filedirectory + \'.enc\', \'wb\') as encfile:\n originalcontent = originalfile.read()\n hashedpassword = hashpassword2(password, len(originalcontent))\n encfile.write(b\'\\x02ENC\')\n encfile.write(xor(originalcontent, hashedpassword))\n messagebox.showinfo(text(20) + \' - \' + text(1), text(21) + "\'" + password + "\'. \\n" + text(22))\n\n\ndef decryptfile1(cipher: bytes, password: str) -> bytes:\n hashed = hashpassword1p0(password, len(cipher))\n content = xor(cipher[4:], hashed)\n return content\n\n\ndef decryptfile2(cipher: bytes, password: str) -> bytes:\n hashed = hashpassword2(password, len(cipher))\n content = xor(cipher[4:], hashed)\n return content\n\n\ndef decryptfile(passwordentry: Entry, filedirectory: str) -> None:\n try:\n password = passwordentry.get()\n with open(filedirectory, \'rb\') as encfile:\n with open(filedirectory[:-4], \'wb\') as newfile:\n cipher = encfile.read()\n if cipher[0] == 1:\n content = decryptfile1(cipher, password)\n printdebug(\'decrypted with v1\')\n elif cipher[0] == 2:\n content = decryptfile2(cipher, password)\n printdebug(\'decrypted with v2\')\n else:\n printdebug(\'unknown encryption version\')\n askwin = Tk()\n askwin.title(text(10) + \' - \' + text(1))\n a1 = Label(askwin, text=text(11) + \'\\n\' + text(12))\n options = [text(13), \'v1\']\n clicked = StringVar()\n clicked.set(text(13))\n a2 = OptionMenu(askwin, clicked, *options)\n a3 = Button(askwin, text=text(14), command=askwin.quit)\n a1.grid(row=0, column=0)\n a2.grid(row=1, column=0)\n a3.grid(row=2, column=0)\n askwin.mainloop()\n selected = clicked.get()\n if selected == text(13):\n printdebug(\'version canceled\')\n return None\n elif selected == \'v1\':\n printdebug(\'v1 selected\')\n content = decryptfile1(cipher, password)\n newfile.write(content)\n messagebox.showinfo(text(20) + \' - \' + text(1), text(23))\n except:\n messagebox.showerror(text(18) + \' - \' + text(1), text(25))\n\n\ndef receiversa(passwordentry: Entry, filedirectory: str) -> None:\n if filedirectory == \'none\':\n return None\n with open(\'rsa.txt\', \'r\') as encryptedkeysfile:\n with open(filedirectory, \'rb\') as originalfile:\n with open(filedirectory[:-4], \'wb\') as newfile:\n passwordint = int(secure_hash(passwordentry.get().encode(), 3, 32).hex(), 16)\n try:\n lines = encryptedkeysfile.readlines()\n if int(lines[1]) % passwordint == 0:\n cipher = originalfile.read()\n content = rsadecrypt(cipher, [int(lines[1]) // passwordint, int(lines[2])])\n if content != b\'__ERROR__\' and b\'__cancel__\':\n newfile.write(content)\n messagebox.showinfo(text(20) + \' - \' + text(1), text(26))\n else:\n messagebox.showerror(text(18) + \' - \' + text(1), text(25))\n return None\n else:\n messagebox.showerror(text(25) + \' - \' + text(1), text(27))\n except:\n messagebox.showerror(text(18) + \' - \' + text(1), text(24) + \'\\n\' + text(28))\n\n\ndef sendrsa(passwordentry: Entry, filedirectory: str) -> None:\n key = passwordentry.get()\n if isrsakey(key):\n with open(filedirectory, \'rb\') as originalfile:\n with open(filedirectory + \'.rsa\', \'wb\') as rsafile:\n splited = key.split(\'g\')\n keyone = int(splited[1].replace(\'g\', \'\'), 16)\n keytwo = int(splited[2].replace(\'g\', \'\'), 16)\n publickeys = [keyone, keytwo]\n rsafile.write(rsaencrypt(originalfile.read(), publickeys))\n messagebox.showinfo(text(20) + \' - \' + text(1), text(29) + \'\\n\' + text(30))\n else:\n messagebox.showerror(text(18) + \' - \' + text(1), text(31))\n\n\ndef copypublic(window: Tk) -> None:\n key = getrsapublic()\n if key != \'__ERROR__\':\n window.clipboard_clear()\n window.clipboard_append(getrsapublic())\n window.update()\n messagebox.showinfo(text(20) + \' - \' + text(1), text(33))\n else:\n messagebox.showerror(text(18) + \' - \' + text(1), text(32) + \'\\n\' + text(28))\n\n\ndef openabout() -> None:\n messagebox.showinfo(text(9) + \' - \' + text(1),\n text(35) + \'\\n\' + text(36) + \'\\n\' + text(37) + \'\\n\' + text(38) + \'1.2\')\n\n\ndef languageinit() -> None:\n global language\n supported_languages = [\'EN\', \'DE\']\n for supported_language in supported_languages:\n try:\n with open(supported_language + \'.txt\', \'r\') as language_file:\n words = language_file.readlines()\n language = []\n for word in words:\n language.append(word.replace(\'\\n\', \'\'))\n return None\n except FileNotFoundError:\n pass\n language = []\n\n\ndef text(index: int) -> str:\n global language\n if index > 0:\n index -= 1\n else:\n return \'\'\n if len(language) > index:\n return language[index]\n else:\n return \'\'\n\n\ndef startgui() -> None:\n global fileselected\n fileselected = \'none\'\n root = Tk()\n root.title(text(1))\n a1 = Button(root, text=text(2), command=lambda: selectfile(a2), width=16)\n a2 = Label(root, text=filename)\n b = Entry(root, width=38, show=\'*\')\n c1 = Button(root, text=text(4), command=lambda: encryptfile(b, fileselected), width=16)\n c2 = Button(root, text=text(5), command=lambda: decryptfile(b, fileselected), width=16)\n d1 = Button(root, text=text(6), command=lambda: sendrsa(b, fileselected), width=16)\n d2 = Button(root, text=text(7), command=lambda: receiversa(b, fileselected), width=16)\n e1 = Button(root, text=text(8), command=lambda: copypublic(root), width=16)\n e2 = Button(root, text=text(9), command=openabout, width=16)\n a1.grid(row=0, column=0)\n a2.grid(row=0, column=1)\n b.grid(row=1, column=0, columnspan=2)\n c1.grid(row=2, column=0)\n c2.grid(row=2, column=1)\n d1.grid(row=3, column=0)\n d2.grid(row=3, column=1)\n e1.grid(row=4, column=0)\n e2.grid(row=4, column=1)\n root.mainloop()\n\n\nif __name__ == \'__main__\':\n languageinit()\n startgui()\n'
filelicense = b' GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers\' and authors\' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users\' and\nauthors\' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users\' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n'
doclicense = b'\n GNU Free Documentation License\n Version 1.3, 3 November 2008\n\n\n Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n0. PREAMBLE\n\nThe purpose of this License is to make a manual, textbook, or other\nfunctional and useful document "free" in the sense of freedom: to\nassure everyone the effective freedom to copy and redistribute it,\nwith or without modifying it, either commercially or noncommercially.\nSecondarily, this License preserves for the author and publisher a way\nto get credit for their work, while not being considered responsible\nfor modifications made by others.\n\nThis License is a kind of "copyleft", which means that derivative\nworks of the document must themselves be free in the same sense. It\ncomplements the GNU General Public License, which is a copyleft\nlicense designed for free software.\n\nWe have designed this License in order to use it for manuals for free\nsoftware, because free software needs free documentation: a free\nprogram should come with manuals providing the same freedoms that the\nsoftware does. But this License is not limited to software manuals;\nit can be used for any textual work, regardless of subject matter or\nwhether it is published as a printed book. We recommend this License\nprincipally for works whose purpose is instruction or reference.\n\n\n1. APPLICABILITY AND DEFINITIONS\n\nThis License applies to any manual or other work, in any medium, that\ncontains a notice placed by the copyright holder saying it can be\ndistributed under the terms of this License. Such a notice grants a\nworld-wide, royalty-free license, unlimited in duration, to use that\nwork under the conditions stated herein. The "Document", below,\nrefers to any such manual or work. Any member of the public is a\nlicensee, and is addressed as "you". You accept the license if you\ncopy, modify or distribute the work in a way requiring permission\nunder copyright law.\n\nA "Modified Version" of the Document means any work containing the\nDocument or a portion of it, either copied verbatim, or with\nmodifications and/or translated into another language.\n\nA "Secondary Section" is a named appendix or a front-matter section of\nthe Document that deals exclusively with the relationship of the\npublishers or authors of the Document to the Document\'s overall\nsubject (or to related matters) and contains nothing that could fall\ndirectly within that overall subject. (Thus, if the Document is in\npart a textbook of mathematics, a Secondary Section may not explain\nany mathematics.) The relationship could be a matter of historical\nconnection with the subject or with related matters, or of legal,\ncommercial, philosophical, ethical or political position regarding\nthem.\n\nThe "Invariant Sections" are certain Secondary Sections whose titles\nare designated, as being those of Invariant Sections, in the notice\nthat says that the Document is released under this License. If a\nsection does not fit the above definition of Secondary then it is not\nallowed to be designated as Invariant. The Document may contain zero\nInvariant Sections. If the Document does not identify any Invariant\nSections then there are none.\n\nThe "Cover Texts" are certain short passages of text that are listed,\nas Front-Cover Texts or Back-Cover Texts, in the notice that says that\nthe Document is released under this License. A Front-Cover Text may\nbe at most 5 words, and a Back-Cover Text may be at most 25 words.\n\nA "Transparent" copy of the Document means a machine-readable copy,\nrepresented in a format whose specification is available to the\ngeneral public, that is suitable for revising the document\nstraightforwardly with generic text editors or (for images composed of\npixels) generic paint programs or (for drawings) some widely available\ndrawing editor, and that is suitable for input to text formatters or\nfor automatic translation to a variety of formats suitable for input\nto text formatters. A copy made in an otherwise Transparent file\nformat whose markup, or absence of markup, has been arranged to thwart\nor discourage subsequent modification by readers is not Transparent.\nAn image format is not Transparent if used for any substantial amount\nof text. A copy that is not "Transparent" is called "Opaque".\n\nExamples of suitable formats for Transparent copies include plain\nASCII without markup, Texinfo input format, LaTeX input format, SGML\nor XML using a publicly available DTD, and standard-conforming simple\nHTML, PostScript or PDF designed for human modification. Examples of\ntransparent image formats include PNG, XCF and JPG. Opaque formats\ninclude proprietary formats that can be read and edited only by\nproprietary word processors, SGML or XML for which the DTD and/or\nprocessing tools are not generally available, and the\nmachine-generated HTML, PostScript or PDF produced by some word\nprocessors for output purposes only.\n\nThe "Title Page" means, for a printed book, the title page itself,\nplus such following pages as are needed to hold, legibly, the material\nthis License requires to appear in the title page. For works in\nformats which do not have any title page as such, "Title Page" means\nthe text near the most prominent appearance of the work\'s title,\npreceding the beginning of the body of the text.\n\nThe "publisher" means any person or entity that distributes copies of\nthe Document to the public.\n\nA section "Entitled XYZ" means a named subunit of the Document whose\ntitle either is precisely XYZ or contains XYZ in parentheses following\ntext that translates XYZ in another language. (Here XYZ stands for a\nspecific section name mentioned below, such as "Acknowledgements",\n"Dedications", "Endorsements", or "History".) To "Preserve the Title"\nof such a section when you modify the Document means that it remains a\nsection "Entitled XYZ" according to this definition.\n\nThe Document may include Warranty Disclaimers next to the notice which\nstates that this License applies to the Document. These Warranty\nDisclaimers are considered to be included by reference in this\nLicense, but only as regards disclaiming warranties: any other\nimplication that these Warranty Disclaimers may have is void and has\nno effect on the meaning of this License.\n\n2. VERBATIM COPYING\n\nYou may copy and distribute the Document in any medium, either\ncommercially or noncommercially, provided that this License, the\ncopyright notices, and the license notice saying this License applies\nto the Document are reproduced in all copies, and that you add no\nother conditions whatsoever to those of this License. You may not use\ntechnical measures to obstruct or control the reading or further\ncopying of the copies you make or distribute. However, you may accept\ncompensation in exchange for copies. If you distribute a large enough\nnumber of copies you must also follow the conditions in section 3.\n\nYou may also lend copies, under the same conditions stated above, and\nyou may publicly display copies.\n\n\n3. COPYING IN QUANTITY\n\nIf you publish printed copies (or copies in media that commonly have\nprinted covers) of the Document, numbering more than 100, and the\nDocument\'s license notice requires Cover Texts, you must enclose the\ncopies in covers that carry, clearly and legibly, all these Cover\nTexts: Front-Cover Texts on the front cover, and Back-Cover Texts on\nthe back cover. Both covers must also clearly and legibly identify\nyou as the publisher of these copies. The front cover must present\nthe full title with all words of the title equally prominent and\nvisible. You may add other material on the covers in addition.\nCopying with changes limited to the covers, as long as they preserve\nthe title of the Document and satisfy these conditions, can be treated\nas verbatim copying in other respects.\n\nIf the required texts for either cover are too voluminous to fit\nlegibly, you should put the first ones listed (as many as fit\nreasonably) on the actual cover, and continue the rest onto adjacent\npages.\n\nIf you publish or distribute Opaque copies of the Document numbering\nmore than 100, you must either include a machine-readable Transparent\ncopy along with each Opaque copy, or state in or with each Opaque copy\na computer-network location from which the general network-using\npublic has access to download using public-standard network protocols\na complete Transparent copy of the Document, free of added material.\nIf you use the latter option, you must take reasonably prudent steps,\nwhen you begin distribution of Opaque copies in quantity, to ensure\nthat this Transparent copy will remain thus accessible at the stated\nlocation until at least one year after the last time you distribute an\nOpaque copy (directly or through your agents or retailers) of that\nedition to the public.\n\nIt is requested, but not required, that you contact the authors of the\nDocument well before redistributing any large number of copies, to\ngive them a chance to provide you with an updated version of the\nDocument.\n\n\n4. MODIFICATIONS\n\nYou may copy and distribute a Modified Version of the Document under\nthe conditions of sections 2 and 3 above, provided that you release\nthe Modified Version under precisely this License, with the Modified\nVersion filling the role of the Document, thus licensing distribution\nand modification of the Modified Version to whoever possesses a copy\nof it. In addition, you must do these things in the Modified Version:\n\nA. Use in the Title Page (and on the covers, if any) a title distinct\n from that of the Document, and from those of previous versions\n (which should, if there were any, be listed in the History section\n of the Document). You may use the same title as a previous version\n if the original publisher of that version gives permission.\nB. List on the Title Page, as authors, one or more persons or entities\n responsible for authorship of the modifications in the Modified\n Version, together with at least five of the principal authors of the\n Document (all of its principal authors, if it has fewer than five),\n unless they release you from this requirement.\nC. State on the Title page the name of the publisher of the\n Modified Version, as the publisher.\nD. Preserve all the copyright notices of the Document.\nE. Add an appropriate copyright notice for your modifications\n adjacent to the other copyright notices.\nF. Include, immediately after the copyright notices, a license notice\n giving the public permission to use the Modified Version under the\n terms of this License, in the form shown in the Addendum below.\nG. Preserve in that license notice the full lists of Invariant Sections\n and required Cover Texts given in the Document\'s license notice.\nH. Include an unaltered copy of this License.\nI. Preserve the section Entitled "History", Preserve its Title, and add\n to it an item stating at least the title, year, new authors, and\n publisher of the Modified Version as given on the Title Page. If\n there is no section Entitled "History" in the Document, create one\n stating the title, year, authors, and publisher of the Document as\n given on its Title Page, then add an item describing the Modified\n Version as stated in the previous sentence.\nJ. Preserve the network location, if any, given in the Document for\n public access to a Transparent copy of the Document, and likewise\n the network locations given in the Document for previous versions\n it was based on. These may be placed in the "History" section.\n You may omit a network location for a work that was published at\n least four years before the Document itself, or if the original\n publisher of the version it refers to gives permission.\nK. For any section Entitled "Acknowledgements" or "Dedications",\n Preserve the Title of the section, and preserve in the section all\n the substance and tone of each of the contributor acknowledgements\n and/or dedications given therein.\nL. Preserve all the Invariant Sections of the Document,\n unaltered in their text and in their titles. Section numbers\n or the equivalent are not considered part of the section titles.\nM. Delete any section Entitled "Endorsements". Such a section\n may not be included in the Modified Version.\nN. Do not retitle any existing section to be Entitled "Endorsements"\n or to conflict in title with any Invariant Section.\nO. Preserve any Warranty Disclaimers.\n\nIf the Modified Version includes new front-matter sections or\nappendices that qualify as Secondary Sections and contain no material\ncopied from the Document, you may at your option designate some or all\nof these sections as invariant. To do this, add their titles to the\nlist of Invariant Sections in the Modified Version\'s license notice.\nThese titles must be distinct from any other section titles.\n\nYou may add a section Entitled "Endorsements", provided it contains\nnothing but endorsements of your Modified Version by various\nparties--for example, statements of peer review or that the text has\nbeen approved by an organization as the authoritative definition of a\nstandard.\n\nYou may add a passage of up to five words as a Front-Cover Text, and a\npassage of up to 25 words as a Back-Cover Text, to the end of the list\nof Cover Texts in the Modified Version. Only one passage of\nFront-Cover Text and one of Back-Cover Text may be added by (or\nthrough arrangements made by) any one entity. If the Document already\nincludes a cover text for the same cover, previously added by you or\nby arrangement made by the same entity you are acting on behalf of,\nyou may not add another; but you may replace the old one, on explicit\npermission from the previous publisher that added the old one.\n\nThe author(s) and publisher(s) of the Document do not by this License\ngive permission to use their names for publicity for or to assert or\nimply endorsement of any Modified Version.\n\n\n5. COMBINING DOCUMENTS\n\nYou may combine the Document with other documents released under this\nLicense, under the terms defined in section 4 above for modified\nversions, provided that you include in the combination all of the\nInvariant Sections of all of the original documents, unmodified, and\nlist them all as Invariant Sections of your combined work in its\nlicense notice, and that you preserve all their Warranty Disclaimers.\n\nThe combined work need only contain one copy of this License, and\nmultiple identical Invariant Sections may be replaced with a single\ncopy. If there are multiple Invariant Sections with the same name but\ndifferent contents, make the title of each such section unique by\nadding at the end of it, in parentheses, the name of the original\nauthor or publisher of that section if known, or else a unique number.\nMake the same adjustment to the section titles in the list of\nInvariant Sections in the license notice of the combined work.\n\nIn the combination, you must combine any sections Entitled "History"\nin the various original documents, forming one section Entitled\n"History"; likewise combine any sections Entitled "Acknowledgements",\nand any sections Entitled "Dedications". You must delete all sections\nEntitled "Endorsements".\n\n\n6. COLLECTIONS OF DOCUMENTS\n\nYou may make a collection consisting of the Document and other\ndocuments released under this License, and replace the individual\ncopies of this License in the various documents with a single copy\nthat is included in the collection, provided that you follow the rules\nof this License for verbatim copying of each of the documents in all\nother respects.\n\nYou may extract a single document from such a collection, and\ndistribute it individually under this License, provided you insert a\ncopy of this License into the extracted document, and follow this\nLicense in all other respects regarding verbatim copying of that\ndocument.\n\n\n7. AGGREGATION WITH INDEPENDENT WORKS\n\nA compilation of the Document or its derivatives with other separate\nand independent documents or works, in or on a volume of a storage or\ndistribution medium, is called an "aggregate" if the copyright\nresulting from the compilation is not used to limit the legal rights\nof the compilation\'s users beyond what the individual works permit.\nWhen the Document is included in an aggregate, this License does not\napply to the other works in the aggregate which are not themselves\nderivative works of the Document.\n\nIf the Cover Text requirement of section 3 is applicable to these\ncopies of the Document, then if the Document is less than one half of\nthe entire aggregate, the Document\'s Cover Texts may be placed on\ncovers that bracket the Document within the aggregate, or the\nelectronic equivalent of covers if the Document is in electronic form.\nOtherwise they must appear on printed covers that bracket the whole\naggregate.\n\n\n8. TRANSLATION\n\nTranslation is considered a kind of modification, so you may\ndistribute translations of the Document under the terms of section 4.\nReplacing Invariant Sections with translations requires special\npermission from their copyright holders, but you may include\ntranslations of some or all Invariant Sections in addition to the\noriginal versions of these Invariant Sections. You may include a\ntranslation of this License, and all the license notices in the\nDocument, and any Warranty Disclaimers, provided that you also include\nthe original English version of this License and the original versions\nof those notices and disclaimers. In case of a disagreement between\nthe translation and the original version of this License or a notice\nor disclaimer, the original version will prevail.\n\nIf a section in the Document is Entitled "Acknowledgements",\n"Dedications", or "History", the requirement (section 4) to Preserve\nits Title (section 1) will typically require changing the actual\ntitle.\n\n\n9. TERMINATION\n\nYou may not copy, modify, sublicense, or distribute the Document\nexcept as expressly provided under this License. Any attempt\notherwise to copy, modify, sublicense, or distribute it is void, and\nwill automatically terminate your rights under this License.\n\nHowever, if you cease all violation of this License, then your license\nfrom a particular copyright holder is reinstated (a) provisionally,\nunless and until the copyright holder explicitly and finally\nterminates your license, and (b) permanently, if the copyright holder\nfails to notify you of the violation by some reasonable means prior to\n60 days after the cessation.\n\nMoreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\nTermination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, receipt of a copy of some or all of the same material does\nnot give you any rights to use it.\n\n\n10. FUTURE REVISIONS OF THIS LICENSE\n\nThe Free Software Foundation may publish new, revised versions of the\nGNU Free Documentation License from time to time. Such new versions\nwill be similar in spirit to the present version, but may differ in\ndetail to address new problems or concerns. See\nhttps://www.gnu.org/licenses/.\n\nEach version of the License is given a distinguishing version number.\nIf the Document specifies that a particular numbered version of this\nLicense "or any later version" applies to it, you have the option of\nfollowing the terms and conditions either of that specified version or\nof any later version that has been published (not as a draft) by the\nFree Software Foundation. If the Document does not specify a version\nnumber of this License, you may choose any version ever published (not\nas a draft) by the Free Software Foundation. If the Document\nspecifies that a proxy can decide which future versions of this\nLicense can be used, that proxy\'s public statement of acceptance of a\nversion permanently authorizes you to choose that version for the\nDocument.\n\n11. RELICENSING\n\n"Massive Multiauthor Collaboration Site" (or "MMC Site") means any\nWorld Wide Web server that publishes copyrightable works and also\nprovides prominent facilities for anybody to edit those works. A\npublic wiki that anybody can edit is an example of such a server. A\n"Massive Multiauthor Collaboration" (or "MMC") contained in the site\nmeans any set of copyrightable works thus published on the MMC site.\n\n"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 \nlicense published by Creative Commons Corporation, a not-for-profit \ncorporation with a principal place of business in San Francisco, \nCalifornia, as well as future copyleft versions of that license \npublished by that same organization.\n\n"Incorporate" means to publish or republish a Document, in whole or in \npart, as part of another Document.\n\nAn MMC is "eligible for relicensing" if it is licensed under this \nLicense, and if all works that were first published under this License \nsomewhere other than this MMC, and subsequently incorporated in whole or \nin part into the MMC, (1) had no cover texts or invariant sections, and \n(2) were thus incorporated prior to November 1, 2008.\n\nThe operator of an MMC Site may republish an MMC contained in the site\nunder CC-BY-SA on the same site at any time before August 1, 2009,\nprovided the MMC is eligible for relicensing.\n'
documentation = b'\n=======================================\n Documentation (English)\n=======================================\n\nDisclaimer: Im not a native speaker of English,\n so my English isn\'t the best\n\n-------------\n Index\n-------------\nLine 7: Index\nLine XX: Legal\nLine XX: Security notices\nLine XX: About this project\nLine XXX: Definitions\nLine XXX: System requirements\nLine XXX: Installation\nLine XXX: Run FileEncryption\nLine XXX: Encryption\nLine XXX: RSA-Encryption\n\n-------------\n Legal\n-------------\n\nThis product (the program FileEncryption and this\ndocumentation) comes WITHOUT ANY WARRANTY; without\neven the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE.\n\nBy using, downlaoding, installing, modifying or redistributing\nthe software you accept the following license:\n\n\'\'\'\nFileEncryption.py, Copyright(c) 2021 Martin S. Merkli\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <https://www.gnu.org/licenses/>.\n\'\'\'\n\nFor this documentation this following license applies:\n\'\'\'\ndocumentation.txt, Copyright(c) Martin S. Merkli.\nPermission is granted to copy, distribute and/or modify this document\nunder the terms of the GNU Free Documentation License, Version 1.3\nor any later version published by the Free Software Foundation;\nwith no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.\nA copy of the license is included in the section entitled "GNU\nFree Documentation License".\n\'\'\'\n\nIf you have a special agreement with the author, then the\nterms of usage and the license above does not apply.\n\n------------------------\n Security notices\n------------------------\n\nBecause this program comes WITHOUT ANY WARRANTY, you\nshould backup your files before encrypting.\n\nDO NOT share your private RSA key or your password(s)!\n\nA password should be at least 8 characters long, the\nlonger the better. It shouldn\'t be on the list of the\n32\'000 most used passwords. The password should contain\nuppercase letters, lowercase letters, numbers and special\ncharacters. It shouldn\'t contain any words from a dictionary.\n\nDO NOT save your password(s) on your computer!\n\nWe recommend using an open-source operating system\nfor more security and privacy, for example POP!_OS.\n\n--------------------------\n About this project\n--------------------------\n\nWe made this project to help people, companies,\ngovernment and schools store their data secure\ndue to vulnerabilities in Windows XP to 10. It\nis too easy for hackers to get to important data\n(for example passwords, payment information,\npersonal data and school exams and marks. If you\nare in front of a windows 10 pro computer with\nwindows defender, you could hack it with a 8\ngigabyte usb stick in 1 to 2 minutes. The usb\nstick only needs a free operating system with\na file explorer. We made this program free and\nopen source, because we think, everyone has a\nbasic right for privacy and security in the\ndigital and online world.\n\nWe have chosen Python as our programming-\nlanguage, because you can execute it on almost\nevery operating system. Python is also easy\nto change if someone wants a new function.\nThe only problem is, that on computers which\nhaven\'t GNU/Linux or Python preinstalled, you\nneed to first install the Python interpreter.\nFor our other files, we\'ve chosen txt as the\nfile format, because it is readable with\nall operating systems.\n\n-------------------\n Definitions\n-------------------\n\nPython: is an open-source programming language,\n which works on almost any operating system.\nOpen-Source: means that you can see and edit the\n source code.\nSource code: original code where you can see how\n the software works.\nOperating system: manages hardware, software resources\n and provides common services for\n installed computer software.\nPython interpreter: software which translates python\n code to machine readable commands.\nRSA: public-key cryptosystem for sending data secure\n over public networks or the internet.\nTerminal: text based user interface, mostly used if\n you know what you are going to do.\nOS: short for operating system\nRAM: temporally storage for applications\n\n---------------------------\n System requirements\n---------------------------\n\nRAM: 256 MB or more\nadditional storage: 8 MB (+ size of the files which\n you want to encrypt) or more\nPython version: 3.8.1 or later\nOS: Linux/macOS/Windows/BSD/Darwin/other\n\n\n--------------------\n Installation\n--------------------\n\n1. Check if Python interpreter is preinstalled:\n GNU/Linux: preinstalled on most distros\n check in terminal with \'$ python\'\n or \'$ python3\'\n macOS & windows: not preinstalled.\n Debian-based(Ubuntu, Mint, POP): preinstalled\n2. Install Python(if not already installed)\n From <https://www.python.org/downloads/>\n download the latest version for your operating\n system and install it.\n3. Download FileEncryption\n Go to <>\n download \'universal.zip\'. Save and unzip it.\n4. Setup FileEncryption\n Terminal:\n select the folder with $ cd [directory] and\n $ python setup.py or\n $ python3 setup.py\n and follow the instructions. Recommended\n settings are preselected.\n IDLE or other software:\n select the program in the file explorer,\n right-click(secondary click) the program\n and press open with... . Select IDLE or\n another python interpreter and run it.\n Follow the instructions from setup.py .\n Recommended settings are preselected.\n5. Additional software\n If you want to add your own functions\n to FileEncryption, we recommend Thonny\n (https://thonny.org/), because it is\n easy to get started with.\n\n--------------------------\n Run FileEncryption\n--------------------------\n\nTerminal:\n select the folder with $ cd [directory] and\n $ python FileEncryption.py or\n $ python3 FileEncryption.py\n\nIDLE:\n select the program in the file explorer,\n right-click(secondary click) the program\n and press open with... . Select IDLE and\n click open. In the Toolbar select run or\n press F5.\nThonny:\n select the program in the file explorer,\n right-click(secondary click) the program\n and press open with... . Select Thonny and\n click open. Press the green Button on the\n top to run the program\n\n------------------\n Encryption\n------------------\n\nTo encrypt files or oder binary data, we use our\nown XOR encryption algorithm. Every bit (0/1) of\nthe file gets with the bit of the hashed password\ninto the XOR gate. See the explanations below:\n\nInputs Output\n A B A XOR B\n 0 0 0\n 0 1 1\n 1 0 1\n 1 1 0\n\nOriginal|hash|encrypted|hash|decrypted\n 0 XOR 1 = 1 XOR 1 = 0\n 1 XOR 1 = 0 XOR 1 = 1\n 0 XOR 0 = 0 XOR 0 = 0\n 1 XOR 0 = 1 XOR 0 = 1\n\nA hash is a one-way function, that is a function,\nwhich is practically infeasible to invert. This\nprogram use this for two purposes: 1. To increase\nsecurity and 2. to make the XOR function easier.\nOur hash algorithm is a slightly modified version\nof the sha512 hash algorithm.\n\nTo decrypt encrypted files we use the same function\nagain: (encrypted) file XOR hashed password. It\nwould take for decades to decrypt one encrypted\nfile without the password or the hashed password.\nIf you forget/lose your password, your files can\'t\nbe decrypted anymore.\n\n----------------------\n RSA-Encryption\n----------------------\n\nThe RSA algorithm is for sending any kind of data\nover a public connection. It uses too much math\nso we don\'t explain the details here exactly.\nVisit \'en.wikipedia.org/wiki/RSA_(cryptosystem)\'\nfor more and detailed information. As an user\nyou have to know the following things:\n\n1. To send a file to someone you need to know\n their public key (just ask)\n2. Your entire conversation could be public\n (sending public key, sending encrypted file)\n3. DO NOT give away your private key\n\nHere are some examples:\nBob wants to send a file to Alice\n\nBob / Public / Alice\nfile ---> cipher ----> file\n ^ / / ^\n | / / |---private key\n |-public key-----public key\n / /\n\nConversation\nBob Alice\nCan you give me your public key?\n 94f573a80e43d2b7...\nThanks!\nHere\'s the file:\ntop-secret.txt.rsa\n Thanks! It worked.\n\nIf you lose or delete your private key, you can\'t\ndecrypt files that were sent to you. If you share\nyour private key, everyone is able to read the\nfiles which were sent to you.\n\nIf someone wants your public key, open FileEncryption,\npress on \'copy public key\', paste it in your\nfavorite communication program and send it back\nto the person.\n\nTo increase speed and lower storage usage, we are\nusing a customised RSA algorithm. The file is\nencrypted as normal with a random key. Only the\nkey is encrypted with the public key from RSA.\nFor experts, here is the syntax of the bytes:\n\n1 to 4: file identification\n5 to 6: key length, order big first\n7 to key length + 5: encrypted key\nkey length + 6 to end: encrypted file\n'
supported_languages = ['EN', 'DE']
EN = b'FileEncryption\nSelect file\nnone\nencrypt\ndecrypt\nsend\nreceive\ncopy public key\nAbout\nUnknown version\nThe version of the rsa encrypted file is unknown.\nPlease select a version or cancel.\ncancel\nSelect\nWarning\n\'password\' is one of the worst passwords!\nDo you really want to continue?\nError\nError: No file selected.\nSuccess\nThe file was successfully encrypted with the following password:\nThe original file still exists. You can delete it.\nThe file was decrypted, but the password could be wrong.\nAn unexpected error accrued.\nWrong password\nThe file was successfully decrypted.\nThe entered password is incorrect. Please try again.\nThe file with your RSA keys is probably corrupted.\nThe file was successfully encrypted.\nThe original file still exists. You can delete it.\nError: input is not a valid RSA-key.\nError: couldn\'t get your public key.\nYour public key was copied to the clipboard. Paste it before closing this window.\nSelect a file\nCopyright(c) 2021 Martin S. Merkli\nThis program is free and open-source software and is licensed under the GNU GPL3. Visit https://www.gnu.org/licenses/ for more information.\nYou can read more about this project in the documentation.\nVersion:\n'
DE = b'DateiVerschl\xc3\xbcsselung\nW\xc3\xa4hlen Sie eine Datei aus.\nnone\nverschl\xc3\xbcsseln\nentschl\xc3\xbcsseln\nsenden\nerhalten\n\xc3\xb6ffentlicher Schl\xc3\xbcssel kopieren\n\xc3\x9cber\nunbekannte Version\nDie RSA-Version der Datei ist unbekannt.\nBitte w\xc3\xa4hlen Sie eine Version aus oder brechen Sie ab.\nAbbrechen\nAusw\xc3\xa4hlen\nWarnung\n\'password\' ist eines der schlechtesten Passw\xc3\xb6rter!\nM\xc3\xb6chten Sie wirklich fortfahren?\nFehler\nFehler: keine Datei ausgew\xc3\xa4hlt.\nErfolg\nDie Datei wurde erfolgreich verschl\xc3\xbcsselt mit dem folgenden Passwort:\nDie Orginaldatei existiert noch. Sie k\xc3\xb6nnen sie l\xc3\xb6schen.\nDie Datei wurde entschl\xc3\xbcsselt, aber das Passwort k\xc3\xb6nnte falsch sein.\nEin unerwarter Fehler ist aufgetreten.\nFalsches Passwort\nDie Datei wurde erfolgreich entschl\xc3\xbcsselt.\nDas eingegebene Passwort ist falsch. Bitte versuchen Sie es erneut.\nDie Datei mit Ihren RSA-Schl\xc3\xbcsseln ist vermutlich besch\xc3\xa4digt.\nDie Datei wurde erfolgreich verschl\xc3\xbcsselt\nDie Orginaldatei existiert noch. Sie k\xc3\xb6nnen sie l\xc3\xb6schen.\nFehler: Eingabe ist kein g\xc3\xbcltiger RSA-Schl\xc3\xbcssel\nFehler: Ihr \xc3\xb6ffentlicher Schl\xc3\xbcssel wurde nicht gefunden.\nIhr \xc3\xb6ffentlicher RSA-Schl\xc3\xbcssel wurde in die Zwischenablage kopiert. F\xc3\xbcgen Sie ihn ein, bevor Sie dieses Fenster schliessen.\nW\xc3\xa4hlen Sie eine Datei aus.\nCopyright(c) 2021 Martin S. Merkli\nDieses Programm ist freie (bezogen auf Freiheit), Open-Source Software und lizensiert unter der GNU GPL v3. Besuchen Sie <https://www.gnu.org/licenses/> f\xc3\xbcr mehr Informationen.\nSie k\xc3\xb6nnen mehr \xc3\xbcber dieses Projekt in der Dokumentation erfahren.\nVersion:\n'
root = Tk()
root.title('Setup - FileEncryption')
a1 = Button(root, text='select install location', command=lambda: selectlocation(a2))
a2 = Label(root, text=location)
radiovar = IntVar(value=1)
b1 = Radiobutton(root, text='English(EN)', variable=radiovar, value=1)
licensevar = IntVar(value=1)
b2 = Checkbutton(root, text='include license', variable=licensevar, onvalue=1, offvalue=0)
c1 = Radiobutton(root, text='Deutsch(DE)', variable=radiovar, value=2)
doclicensvar = IntVar(value=1)
c2 = Checkbutton(root, text='include documentation license', variable=doclicensvar, onvalue=1, offvalue=0)
documentationvar = IntVar(value=1)
d1 = Checkbutton(root, text='include documentation', variable=documentationvar, onvalue=1, offvalue=0)
debugvar = IntVar(value=0)
d2 = Checkbutton(root, text='debug', variable=debugvar, onvalue=1, offvalue=0)
e0 = Button(root, text='continue', command=root.quit, width=48)
f1 = Button(root, text='cancel', command=cancelinstallation, width=24)
f2 = Button(root, text='about', command=openabout, width=24)
a1.grid(row=0, column=0)
a2.grid(row=0, column=1)
b1.grid(row=1, column=0)
b2.grid(row=1, column=1)
c1.grid(row=2, column=0)
c2.grid(row=2, column=1)
d1.grid(row=3, column=0)
d2.grid(row=3, column=1)
e0.grid(row=4, column=0, columnspan=2)
f1.grid(row=5, column=0)
f2.grid(row=5, column=1)
root.mainloop()
root2 = Tk()
root2.title('RSA-keys - Setup FileEncryption')
m1 = Label(root2, text='Enter a secure password for your RSA-keys:')
o1 = Entry(root2, width=32, show='*')
p1 = Label(root2, text='Please repeat the password: ')
q1 = Entry(root2, width=32, show='*')
r1 = Button(root2, width=24, text='continue', command=continuersa)
m1.grid(row=0, column=0)
o1.grid(row=1, column=0)
p1.grid(row=2, column=0)
q1.grid(row=3, column=0)
r1.grid(row=4, column=0)
root2.mainloop()
installations = ['FileEncryption.py', 'rsa.txt']
if licensevar.get() == 1:
installations.append('license.txt')
if doclicensvar.get() == 1:
installations.append('documentation-license.txt')
if documentationvar.get() == 1:
installations.append('documentation.txt')
if radiovar.get() == 2:
installations.append('DE.txt')
else:
installations.append('EN.txt')
for potential_collision in installations:
trypath = location + potential_collision
try:
tryfile = open(trypath, 'rb')
if not messagebox.askyesnocancel('Warning - Setup FileEncryption',
'If you continue, ' + trypath + ' is getting deleted. \nAre you sure that'
' you want to continue?',
icon='warning'):
sys.exit()
else:
pass
except FileNotFoundError:
pass
with open(location + 'FileEncryption.py', 'wb') as mainfile:
if debugvar.get() == 1:
mainfile.write(mf.replace(b'debug = False', b'debug = True'))
else:
mainfile.write(mf)
if radiovar.get() == 2:
with open(location + 'DE.txt', 'wb') as language_file:
language_file.write(DE)
else:
with open(location + 'EN.txt', 'wb') as language_file:
language_file.write(EN)
if 'license.txt' in installations:
with open(location + 'license.txt', 'wb') as licensefile:
licensefile.write(filelicense)
if 'documentation-license.txt' in installations:
with open(location + 'documentation-license.txt', 'wb') as doclicensefile:
doclicensefile.write(doclicense)
if 'documentation.txt' in installations:
with open(location + 'documentation.txt', 'wb') as docfile:
docfile.write(documentation)
rsakeys = generatersakeys(320)
with open(location + 'rsa.txt', 'w') as rsafile:
rsafile.write(str(rsakeys[0][0]))
rsafile.write('\n')
rsafile.write(str(rsakeys[1][0] * int(secure_hash(q1.get().encode(), 3, 32).hex(), 16)))
rsafile.write('\n')
rsafile.write(str(rsakeys[0][1]))
messagebox.showinfo('Success - Setup FileEncryption', 'FileEncryption was successfully installed.'
' You can now delete setup.py')