-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentation.txt
302 lines (256 loc) · 9.55 KB
/
documentation.txt
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
=======================================
Documentation (English)
=======================================
Disclaimer: Im not a native speaker of English,
so my English isn't the best
-------------
Index
-------------
Line 10: Index
Line 24: Legal
Line 67: Security notices
Line 87: About this project
Line 117: Definitions
Line 139: System requirements
Line 150: Installation
Line 187: Run FileEncryption
Line 209: Encryption
Line 247: RSA-Encryption
-------------
Legal
-------------
This product (the program FileEncryption and this
documentation) comes WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
By using, downloading, installing, modifying or redistributing
the software you accept the following license:
'''
FileEncryption.py, Copyright(c) 2021 Martin S. Merkli
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/>.
'''
For this documentation this following license applies:
'''
documentation.txt, Copyright(c) Martin S. Merkli.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
'''
If you have a special agreement with the author, then the
terms of usage and the license above does not apply or
only parts of them apply.
------------------------
Security notices
------------------------
Because this program comes WITHOUT ANY WARRANTY, you
should backup your files before encrypting.
DO NOT share your private RSA key or your password(s)!
A password should be at least 8 characters long, the
longer the better. It shouldn't be on the list of the
32'000 most used passwords. The password should contain
uppercase letters, lowercase letters, numbers and special
characters. It shouldn't contain any words from a dictionary.
DO NOT save your password(s) on your computer!
We recommend using an open-source operating system
for more security and privacy, for example POP!_OS.
--------------------------
About this project
--------------------------
We made this project to help people, companies,
government and schools store their data secure
due to vulnerabilities in Windows XP to 10. It
is too easy for hackers to get to important data
(for example passwords, payment information,
personal data and school exams and marks. If you
are in front of a windows 10 pro computer with
windows defender, you could hack it with a 8
gigabyte usb stick in 1 to 2 minutes. The usb
stick only needs a free operating system with
a file explorer. We made this program free and
open source, because we think, everyone has a
basic right for privacy and security in the
digital and online world.
We have chosen Python as our programming-
language, because you can execute it on almost
every operating system. Python is also easy
to change if someone wants a new function.
The only problem is, that on computers which
haven't GNU/Linux or Python preinstalled, you
need to first install the Python interpreter.
For our other files, we've chosen txt as the
file format, because it is readable with
all operating systems.
-------------------
Definitions
-------------------
Python: is an open-source programming language,
which works on almost any operating system.
Open-Source: means that you can see and edit the
source code.
Source code: original code where you can see how
the software works.
Operating system: manages hardware, software resources
and provides common services for
installed computer software.
Python interpreter: software which translates python
code to machine readable commands.
RSA: public-key cryptosystem for sending data secure
over public networks or the internet.
Terminal: text based user interface, mostly used if
you know what you are going to do.
OS: short for operating system
RAM: temporally storage for applications
---------------------------
System requirements
---------------------------
RAM: 256 MB or more
additional storage: 8 MB (+ size of the files which
you want to encrypt) or more
Python version: 3.8.1 or later
OS: Linux/macOS/Windows/BSD/Darwin/other
--------------------
Installation
--------------------
1. Check if Python interpreter is preinstalled:
GNU/Linux: preinstalled on most distros
check in terminal with '$ python'
or '$ python3'
macOS & windows: not preinstalled.
Debian-based(Ubuntu, Mint, POP): preinstalled
2. Install Python(if not already installed)
From <https://www.python.org/downloads/>
download the latest version for your operating
system and install it.
3. Download FileEncryption
Go to <>
download 'universal.zip'. Save and unzip it.
4. Setup FileEncryption
Terminal:
select the folder with $ cd [directory] and
$ python setup.py or
$ python3 setup.py
and follow the instructions. Recommended
settings are preselected.
IDLE or other software:
select the program in the file explorer,
right-click(secondary click) the program
and press open with... . Select IDLE or
another python interpreter and run it.
Follow the instructions from setup.py .
Recommended settings are preselected.
5. Additional software
If you want to add your own functions
to FileEncryption, we recommend Thonny
(https://thonny.org/), because it is
easy to get started with.
--------------------------
Run FileEncryption
--------------------------
Terminal:
select the folder with $ cd [directory] and
$ python FileEncryption.py or
$ python3 FileEncryption.py
IDLE:
select the program in the file explorer,
right-click(secondary click) the program
and press open with... . Select IDLE and
click open. In the Toolbar select run or
press F5.
Thonny:
select the program in the file explorer,
right-click(secondary click) the program
and press open with... . Select Thonny and
click open. Press the green Button on the
top to run the program
------------------
Encryption
------------------
To encrypt files or oder binary data, we use our
own XOR encryption algorithm. Every bit (0/1) of
the file gets with the bit of the hashed password
into the XOR gate. This is why the program can not
detect if the correct password was given. See the
explanations for the XOR function below:
Inputs Output
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
Original|hash|encrypted|hash|decrypted
0 XOR 1 = 1 XOR 1 = 0
1 XOR 1 = 0 XOR 1 = 1
0 XOR 0 = 0 XOR 0 = 0
1 XOR 0 = 1 XOR 0 = 1
A hash is a one-way function, that is a function,
which is practically infeasible to invert. This
program use this for two purposes: 1. To increase
security and 2. to make the XOR function easier.
Our hash algorithm is a slightly modified version
of the sha512 hash algorithm.
To decrypt encrypted files we use the same function
again: (encrypted) file XOR hashed password. It
would take for decades to decrypt one encrypted
file without the password or the hashed password.
If you forget/lose your password, your files can't
be decrypted anymore.
----------------------
RSA-Encryption
----------------------
The RSA algorithm is for sending any kind of data
over a public connection. It uses too much math
so we don't explain the details here exactly.
Visit 'en.wikipedia.org/wiki/RSA_(cryptosystem)'
for more and detailed information. As an user
you have to know the following things:
1. To send a file to someone you need to know
their public key (just ask)
2. Your entire conversation could be public
(sending public key, sending encrypted file)
3. DO NOT give away your private key (it's
hidden anyways)
Here are some examples:
Bob wants to send a file to Alice
Bob / Public / Alice
file ---> cipher ----> file
^ / / ^
| / / |---private key
|-public key-----public key
/ /
Conversation
Bob Alice
Can you give me your public key?
01g94f573a80e43d2b7...
Thanks!
Here's the file:
top-secret.txt.rsa
Thanks! It worked.
If you lose or delete your private key, you can't
decrypt files that were sent to you. If you share
your private key, everyone is able to read the
files which were sent to you.
If someone wants your public key, open FileEncryption,
press on 'copy public key', paste it in your
favorite communication program and send it back
to the person.
To increase speed and lower storage usage, we are
using a customised RSA algorithm. The file is
encrypted as normal with a random key. Only the
key is encrypted with the public key from RSA.
For experts, here is the syntax of the bytes:
1 to 4: file identification
5 to 6: key length, order big first
7 to key length + 5: encrypted key
key length + 6 to end: encrypted file