• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.tx/H15-Jul-2021-5242

contrib/H15-Jul-2021-13394

deps/H15-Jul-2021-738,748541,880

docs/H15-Jul-2021-3,1991,944

func_tests/H03-May-2022-1,7031,506

images/H03-May-2022-

linux_deployment/H15-Jul-2021-341209

macos_deployment/H15-Jul-2021-4437

qt_ui/H03-May-2022-50,93248,816

scripts/H15-Jul-2021-339272

src/H15-Jul-2021-7,6275,399

.disable.travis.ymlH A D15-Jul-2021350 2320

.gitignoreH A D15-Jul-2021427 4039

.ycm_extra_conf.pyH A D15-Jul-2021466 1714

CHANGES.htmH A D15-Jul-20217.3 KiB11891

CHANGES.mdH A D15-Jul-20216.6 KiB10081

README.htmH A D15-Jul-202131.2 KiB755470

README.mdH A D15-Jul-202127 KiB622383

appveyor.ymlH A D15-Jul-20213.3 KiB10690

configure.pyH A D15-Jul-202176.2 KiB2,0881,627

encryptpad.desktopH A D15-Jul-2021245 1211

encryptpad.xmlH A D15-Jul-2021284 98

README.htm

1<p>EncryptPad is an application for viewing and editing symmetrically encrypted text. Using a simple and convenient graphical and command line interface, EncryptPad provides a tool for encrypting and decrypting binary files on disk while offering effective measures for protecting information, and it uses the most widely chosen quality file format <strong>OpenPGP</strong> <a href="https://tools.ietf.org/html/rfc4880">RFC 4880</a>. Unlike other OpenPGP software which main purpose is asymmetric encryption, the primary focus of EncryptPad is symmetric encryption.</p>
2
3<h2>Table of Contents</h2>
4
5<ul>
6<li><a href="#features">Features</a></li>
7<li><a href="#supported-platforms">Supported platforms</a></li>
8<li><a href="#why-use-encryptpad">Why use EncryptPad?</a></li>
9<li><a href="#when-encryptpad">When do I need EncryptPad?</a></li>
10<li><a href="#when-can-i-not">When can I not use EncryptPad?</a></li>
11<li><a href="#file-types">File types</a>
12
13<ul>
14<li><a href="#gpg">GPG</a></li>
15<li><a href="#epd">EPD</a></li>
16<li><a href="#feature-support">Feature support</a></li>
17</ul>
18</li>
19<li><a href="#key-file">What is an EncryptPad key file?</a></li>
20<li><a href="#epd-file-format">EPD file format when encrypting with a key</a></li>
21<li><a href="#use-curl">Use CURL to automatically download keys from a remote storage</a></li>
22<li><a href="#known-weaknesses">Known weaknesses</a></li>
23<li><a href="#command-line-interface">Command line interface</a>
24
25<ul>
26<li><a href="#command-line-encryptcli">encryptcli</a></li>
27<li><a href="#command-line-encryptpad">encryptpad</a></li>
28</ul>
29</li>
30<li><a href="#installing">Installing EncryptPad</a>
31
32<ul>
33<li><a href="#portable-exe">Portable executable</a></li>
34<li><a href="#install-on-arch">Arch Linux</a></li>
35<li><a href="#install-on-ubuntu">Ubuntu or Linux Mint</a></li>
36</ul>
37</li>
38<li><a href="#compile-on-windows">Compile EncryptPad on Windows</a>
39
40<ul>
41<li><a href="#prerequisites">Prerequisites</a></li>
42<li><a href="#steps">Steps</a></li>
43</ul>
44</li>
45<li><a href="#compile-on-macos">Compile EncryptPad on macOS</a></li>
46<li><a href="#compile-on-linux">Compile EncryptPad on Linux</a>
47
48<ul>
49<li><a href="#build-on-fedora">Fedora</a></li>
50<li><a href="#build-on-ubuntu">Ubuntu</a></li>
51<li><a href="#build-on-debian">Debian</a></li>
52<li><a href="#build-on-opensuse">openSUSE</a></li>
53<li><a href="#build-on-archlinux">Archlinux</a></li>
54<li><a href="#build-on-freebsd">FreeBSD</a></li>
55</ul>
56</li>
57<li><a href="#portable-mode">Portable mode</a></li>
58<li><a href="#fakevim-mode">FakeVim mode</a>
59
60<ul>
61<li><a href="#fakevim-input-output">FakeVim: input and output commands</a></li>
62</ul>
63</li>
64<li><a href="#passphrases-in-memory">Does EncryptPad store passphrases in the memory to reopen files?</a></li>
65<li><a href="#acknowledgements">Acknowledgements</a></li>
66<li><a href="#integrity-verification">EncryptPad integrity verification</a>
67
68<ul>
69<li><a href="#openpgp-signing">OpenPGP signing and certification authority</a></li>
70<li><a href="#verification-process">Step by step verification process</a></li>
71</ul>
72</li>
73<li><a href="#license">License</a></li>
74<li><a href="#contact">Contact and feedback</a></li>
75</ul>
76
77
78<div id="features"></div>
79
80
81<h2>Features</h2>
82
83<ul>
84<li><strong>Symmetric</strong> encryption</li>
85<li><strong>Passphrase</strong> protection</li>
86<li><strong>Key file</strong> protection</li>
87<li>Combination of <strong>passphrase and key file</strong></li>
88<li>Random <strong>key file generator</strong></li>
89<li><strong>Key repository</strong> in a hidden directory in the user&rsquo;s home folder</li>
90<li>Path to a key file can be stored in an encrypted file. If enabled, <strong>you do not need to specify the key file</strong> every time you open files.</li>
91<li>Encryption of <strong>binary files</strong> (images, videos, archives etc.)</li>
92<li><strong>FakeVim</strong> mode to edit files by using Vim-like user interface</li>
93<li><strong>Read only</strong> mode to prevent accidental file modification</li>
94<li><strong>UTF8</strong> text encoding</li>
95<li>Windows/Unix <strong>configurable line endings</strong></li>
96<li>Customisable <strong>passphrase generator</strong> helps create strong random passphrases.</li>
97<li>File format compatible with <strong>OpenPGP</strong></li>
98<li><strong>Iterated and salted S2K</strong></li>
99<li><strong>Passphrases are not kept in the memory</strong> for reuse, only S2K results (<a href="#passphrases-in-memory">more &hellip;</a>)</li>
100<li>Cipher algorithms: <strong>TripleDES, CAST5, AES, AES192, AES256, Camellia128, Camellia192, Camellia256, Twofish</strong></li>
101<li>Hash algorithms: <strong>SHA-1, SHA-256, SHA-384, SHA-512, SHA-224</strong></li>
102<li>Integrity protection: <strong>SHA-1</strong></li>
103<li>Compression: <strong>ZLIB, ZIP, Bzip2</strong></li>
104<li><strong>ASCII armor</strong></li>
105<li><strong>Large multi-gigabyte files</strong> are supported</li>
106</ul>
107
108
109<div id="supported-platforms"></div>
110
111
112<h2>Supported platforms</h2>
113
114<ul>
115<li><p>Windows</p></li>
116<li><p>Linux</p></li>
117<li><p>Mac OS</p></li>
118</ul>
119
120
121<div id="why-use-encryptpad"></div>
122
123
124<h2>Why use EncryptPad?</h2>
125
126<ul>
127<li><p><strong>Multi-platform</strong> codebase: it has been compiled on three popular operating systems and can be adapted to more.</p></li>
128<li><p><strong>Portable</strong>: simply copy the executable to a memory stick or a network drive and use on all your computers.</p></li>
129<li><p><strong>Simple to use</strong>: EncryptPad is a text editor and an encryption tool for binary files but it saves encrypted, compressed and integrity protected files.</p></li>
130<li><p><strong>Open source</strong> with concise codebase: you can read the code or ask somebody you trust to read it for you to ensure that there are no back doors and your information is safe.</p></li>
131<li><p><strong>OpenPGP</strong> file format: you can encrypt a file with another tool (gpg for example) implementing the format and open it with EncryptPad and vice versa.</p></li>
132<li><p><strong>Double protection</strong>: randomly generated key files in addition to passphrases.</p></li>
133</ul>
134
135
136<div id="when-encryptpad"></div>
137
138
139<h2>When do I need EncryptPad?</h2>
140
141<ul>
142<li><p>You have a file containing sensitive information such as account names, passphrases or IDs. It is stored on an unprotected media or you can&rsquo;t control who accesses the file, whether it is located on a computer at work, a laptop while on the move, a memory stick or a cloud drive.</p></li>
143<li><p>You need to send an encrypted file to somebody with whom you prearranged a shared secret (a passphrase or a key file). In this case, you need to exchange the secret personally (not via an accessible Internet protocol) for the protected file to be decrypted by the recipient.</p></li>
144<li><p>You store or receive a file and need to ensure that it has not been tampered with or corrupted during transmission. EncryptPad uses SHA-1 hashing algorithm to verify the data&rsquo;s integrity.</p></li>
145<li><p>You need protection against a brute force attack in case your storage gets in somebody&rsquo;s hands. EncryptPad allows to generate a key and store it separately from encrypted information. The unwanted person would need two secrets to open an encrypted file: the passphrase and the key. Consider this example: you store your encrypted file on a memory stick, and protect it with a passphrase. In addition to that, you protect the file with a file key and store the key on computers where you open the file. If the memory stick is lost, the passphrase is not enough to decrypt your information. The key file is also needed and it is not on the memory stick.</p></li>
146</ul>
147
148
149<div id="when-can-i-not"></div>
150
151
152<h2>When can I not use EncryptPad?</h2>
153
154<ul>
155<li><p>You need to send a file to somebody with whom you have <strong>not prearranged a shared secret</strong> (a passphrase or a key file). In this case, you need asymmetric encryption with public and private keys. Fortunately, there are many convenient tools suitable for the task.</p></li>
156<li><p>You are on public transport or a common area where <strong>somebody can see your screen</strong>.</p></li>
157<li><p>EncryptPad is not effective on a computer infected with spyware or a virus. Do not use it on a <strong>public, shared or compromised computer</strong> if you do not trust its safety.</p></li>
158<li><p><strong>IMPORTANT</strong>: Before using EncryptPad ensure that it is legal in your country to use encryption ciphers that EncryptPad provides. You may find useful information at <a href="http://www.cryptolaw.org/">cryptolaw.org</a>.</p></li>
159<li><p><strong>IMPORTANT</strong>: If you forgot your passphrase or lost a key file, there is nothing that can be done to open your encrypted information. There are no backdoors in the formats that EncryptPad supports. EncryptPad developers take no responsibility for corrupted or invalid files in accordance with the license.</p></li>
160</ul>
161
162
163<div id="file-types"></div>
164
165
166<h2>File types</h2>
167
168<p>The format is determined by an extension of a file. Main extensions of encrypted files are GPG and EPD.</p>
169
170<div id="gpg"></div>
171
172
173<h3>GPG</h3>
174
175<p>This file type conforms to OpenPGP format and it is compatible with other OpenPGP tools. Use it if you need to open a file where EncryptPad is not available. The format does not support double protection (key file + passphrase). So you need to choose between key file or passphrase and cannot use both. In addition, it cannot store file key path in the encrypted file. It means that every time you open a file encrypted with a key file, the application will ask you which key file to use.</p>
176
177<div id="epd"></div>
178
179
180<h3>EPD</h3>
181
182<p>EncryptPad specific format. Other OpenPGP software will not be able to open it unless the file was only protected with a passphrase. If passphrase only protection was used, the file is effectively a GPG file (see GPG section above). However, when a key file protection is involved, it is a GPG file in a <a href="https://en.wikipedia.org/wiki/Doom_WAD">WAD</a> container. See the following chapter for details.</p>
183
184<div id="feature-support"></div>
185
186
187<h3>Feature support</h3>
188
189<table style="border: 1px solid black">
190<tr>
191<th>Type</th><th>Feature</th><th>Supported</th><th>Key file path\*</th><th>OpenPGP compatible</th><th>File format</th>
192</tr>
193<tr><td>GPG</td><td>Passphrase</td><td>yes</td><td>n/a</td><td>yes</td><td>OpenPGP file</td></tr>
194<tr><td>GPG</td><td>Key file</td><td>yes</td><td>no</td><td>yes</td><td>OpenPGP file</td></tr>
195<tr><td>GPG</td><td>Key file and passphrase</td><td>no</td><td>n/a</td><td>n/a</td><td>n/a</td></tr>
196<tr><td>EPD</td><td>Passphrase</td><td>yes</td><td>n/a</td><td>yes</td><td>OpenPGP file</td></tr>
197<tr><td>EPD</td><td>Key file</td><td>yes</td><td>yes</td><td>no</td><td>Nested: WAD/OpenPGP</td></tr>
198<tr><td>EPD</td><td>Key file and passphrase</td><td>yes</td><td>yes</td><td>no</td><td>Nested: OpenPGP/WAD/OpenPGP</td></tr>
199</table>
200
201
202<p>* Key file location is persisted in the header of an encrypted file so the user does not need to specify it when decrypting.</p>
203
204<div id="key-file"></div>
205
206
207<h2>What is an EncryptPad key file?</h2>
208
209<p>In symmetric encryption the same sequence is used to encrypt and decrypt data. The user or another
210application usually provides this sequence in the form of an entered passphrase or a file. In addition to
211entered passphrases, EncryptPad generates files with random sequences called &ldquo;key files&rdquo;.</p>
212
213<p>When the user creates a key file, EncryptPad generates a random sequence of bytes, asks the
214user for a passphrase, encrypts the generated sequence and saves it to a file.</p>
215
216<p>The format of the file is OpenPGP. Other OpenPGP implementations can also create and
217open EncryptPad key files as below shell commands demonstrate.</p>
218
219<p>When EncryptPad generates a new key file, it is roughly equivalent to the following <code>gpg2</code> command.</p>
220
221<pre><code>pwmake 1024 | gpg2 -c --armor --cipher-algo AES256 &gt; ~/.encryptpad/foo.key
222</code></pre>
223
224<p><code>pwmake</code> generates a random sequence, which <code>gpg2</code> in-turn encrypts. It will ask for the
225passphrase to encrypt the sequence.</p>
226
227<p>When you use this key to encrypt <code>test3.txt</code>, the equivalent <code>gpg</code> command is below:</p>
228
229<pre><code>gpg2 --decrypt ~/.encryptpad/foo.key \
230| gpg2 --passphrase-fd 0 --batch -c --cipher-algo AES256 \
231-o /tmp/test3.txt.gpg /tmp/test3.txt
232</code></pre>
233
234<p>The first <code>gpg2</code> process decrypts <code>foo.key</code> and directs it to descriptor 0 of the second process
235through a pipe. <code>gpg2</code> reads the sequence from the descriptor with <code>--passphrase-fd 0</code>.</p>
236
237<p>When EncryptPad opens the encrypted file protected with <code>foo.key</code>, the equivalent <code>gpg</code> commands are:</p>
238
239<pre><code>gpg2 --decrypt ~/.encryptpad/foo.key \
240| gpg2 --passphrase-fd 0 --batch --decrypt \
241-o /tmp/test4.txt /tmp/test3.txt.gpg
242</code></pre>
243
244<p>As you see, other OpenPGP implementations can also use EncryptPad keys.</p>
245
246<div id="epd-file-format"></div>
247
248
249<h2>EPD file format when encrypting with a key</h2>
250
251<p>There are three different structures a saved file can have depending on protection mode:</p>
252
253<ol>
254<li><p><strong>Passphrase only</strong> (passphrase is used to protect a file but no keys are specified). The file is an ordinary OpenPGP file.</p></li>
255<li><p><strong>Key only</strong> (passphrase is not set but a key file is used for protection). The file is a WAD file. <a href="https://en.wikipedia.org/wiki/Doom_WAD">WAD</a> is a simple format for combining multiple binary files in one. You can open a WAD file in <a href="http://slade.mancubus.net/">Slade</a>. It contains two files internally:</p>
256
257<ul>
258<li>OpenPGP file encrypted with the key</li>
259<li><code>__X2_KEY</code> is a plain text file containing the path to the key if &ldquo;Persistent key location in the encrypted file&rdquo; is enabled. Otherwise, it has zero length.</li>
260</ul>
261</li>
262<li><p><strong>Protected with passphrase and key</strong>. The resulting file is an OpenPGP file containing a WAD file as explained in 2.</p></li>
263</ol>
264
265
266<div id="use-curl"></div>
267
268
269<h2>Use CURL to automatically download keys from a remote storage</h2>
270
271<p>If <strong><a href="http://curl.haxx.se/">CURL</a></strong> URL is specified in <strong>Key File Path</strong> field in the <strong>Set Encryption Key</strong> dialogue, EncryptPad will attempt to start a curl process to download the key from a remote host. If you want to use this feature, you need to set the path to the CURL executable in the EncryptPad settings.</p>
272
273<p>Consider this use case scenario: you travel with your laptop and open an encrypted file on the laptop. If you protect the file with a passphrase and a key and your laptop is lost or stolen, the perpetrator will be able to make a brute force attack on your file because the key is also stored on the laptop. To avoid this, EncryptPad takes the following steps:</p>
274
275<ol>
276<li>Encrypts the plain text file with the key</li>
277<li>Copies the encrypted file into a WAD file together with the unencrypted HTTPS or SFTP URL to the key file containing authentication parameters.</li>
278<li>Encrypts the WAD file from point 2 with the passphrase.</li>
279</ol>
280
281
282<p>If this file gets into the hands of a wrongdoer, he or she will need to brute force the passphrase first to be able to obtain the key URL and the authentication parameters. Since a brute force attack takes a lot of time, the user will be able to remove the key or change the authentication so the previous parameters become obsolete.</p>
283
284<div id="known-weaknesses"></div>
285
286
287<h2>Known weaknesses</h2>
288
289<ul>
290<li>EncryptPad stores unencrypted text in memory. If a memory dump is automatically taken after a system or application crash or some of the memory is saved to a swap file, the sensitive information will be present on the disk. Sometimes it is possible to configure an operating system not to use a dump and swap files. It is a good practice to close EncryptPad when not in use.</li>
291</ul>
292
293
294<div id="command-line-interface"></div>
295
296
297<h2>Command line interface</h2>
298
299<h3>encryptcli</h3>
300
301<div id="command-line-encryptcli"></div>
302
303
304<p><strong>encryptcli</strong> is the executable to encrypt / decrypt files in command line. Run it without arguments to see available parameters. Below is an example of encrypting a file with a key:</p>
305
306<pre><code># generate a new key and protect it with the passphrase "key".
307# --key-pwd-fd 0 for reading the key passphrase from descriptor 0
308echo -n "key" | encryptcli --generate-key --key-pwd-fd 0 my_key.key
309
310# encrypt plain_text.txt with my_key.key created above.
311# The key passphrase is sent through file descriptor 3
312cat plain_text.txt | encryptcli -e --key-file my_key.key \
313--key-only --key-pwd-fd 3 -o plain_text.txt.gpg 3&lt; &lt;(echo -n "key")
314</code></pre>
315
316<h3>encryptpad</h3>
317
318<div id="command-line-encryptpad"></div>
319
320
321<p><strong>encryptpad</strong> is the GUI executable. It has the command line parameters below:</p>
322
323<pre><code>`--lang` - to enforce the language for the GUI
324
325`--log-file` - specify the log file for diagnostics
326
327`--log-severity` - log severity can be one of the following list: none, fatal, error, warning, info, debug, verbose
328</code></pre>
329
330<div id="installing"></div>
331
332
333<h2>Installing EncryptPad</h2>
334
335<div id="portable-exe"></div>
336
337
338<h3>Portable executable</h3>
339
340<p>Portable binaries are available for Windows and macOS. They can be copied on a memory stick or
341placed on a network share.</p>
342
343<div id="install-on-arch"></div>
344
345
346<h3>Arch Linux</h3>
347
348<p>Use fingerprints to receive gpg keys for EncryptPad and Botan.</p>
349
350<pre><code>gpg --recv-key 621DAF6411E1851C4CF9A2E16211EBF1EFBADFBC
351gpg --recv-key 634BFC0CCC426C74389D89310F1CFF71A2813E85
352</code></pre>
353
354<p>Install the AUR packages below:</p>
355
356<ul>
357<li><a href="https://aur.archlinux.org/packages/botan-stable/">botan-stable</a><sup><small>AUR</small></sup></li>
358<li><a href="https://aur.archlinux.org/packages/encryptpad/">encryptpad</a><sup><small>AUR</small></sup></li>
359</ul>
360
361
362<p><code>pacaur</code> installs <code>botan-stable</code> automatically as <code>encryptpad</code> dependency.</p>
363
364<div id="install-on-ubuntu"></div>
365
366
367<h3>Ubuntu or Linux Mint via PPA</h3>
368
369<p>Alin Andrei from <a href="http://webupd8.org"><strong>webupd8.org</strong></a> kindly created EncryptPad packages for
370several distributions. See instructions below on how to install them.</p>
371
372<h4>Installation</h4>
373
374<p>Use the commands below to install the packages.</p>
375
376<pre><code>sudo add-apt-repository ppa:nilarimogard/webupd8
377sudo apt update
378sudo apt install encryptpad encryptcli
379</code></pre>
380
381<h4>Integrity verification procedure</h4>
382
383<p>Below are steps to verify the SHA-1 hashes of the source files in <a href="https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+packages">Launchpad webupd8 PPA</a> used for building the packages. Ideally, you need to be familiar with the PPA concepts.</p>
384
385<p>1. Download one of the <code>changes</code> files below depending on your distribution. The package version was 0.3.2.5 at the moment of writing. Please replace it with the latest version you are installing.</p>
386
387<ul>
388<li><p>Yakkety</p>
389
390<pre><code>  wget https://launchpadlibrarian.net/282249531/encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes
391</code></pre></li>
392<li><p>Xenial</p>
393
394<pre><code>  wget https://launchpadlibrarian.net/282249418/encryptpad_0.3.2.5-1~webupd8~xenial1_source.changes
395</code></pre></li>
396<li><p>Vivid</p>
397
398<pre><code>  wget https://launchpadlibrarian.net/282249098/encryptpad_0.3.2.5-1~webupd8~vivid1_source.changes
399</code></pre></li>
400<li><p>Trusty</p>
401
402<pre><code>  wget https://launchpadlibrarian.net/282247738/encryptpad_0.3.2.5-1~webupd8~trusty1_source.changes
403</code></pre></li>
404</ul>
405
406
407<p>2. Download the tarball with the verified &ldquo;changes&rdquo; files and its signature:</p>
408
409<pre><code>wget https://github.com/evpo/EncryptPad/releases/download/v0.3.2.5\
410/encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz
411
412wget https://github.com/evpo/EncryptPad/releases/download/v0.3.2.5\
413/encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz.asc
414</code></pre>
415
416<p>3. Receive and verify the <code>EncryptPad Release</code> key:</p>
417
418<pre><code>gpg --recv-key 634BFC0CCC426C74389D89310F1CFF71A2813E85
419</code></pre>
420
421<p>4. Verify the signature on the tarball:</p>
422
423<pre><code>gpg --verify encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz.asc
424</code></pre>
425
426<p>5. Extract the content:</p>
427
428<pre><code>tar -xf encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz
429</code></pre>
430
431<p>6. Compare the &ldquo;changes&rdquo; file for your distribution with the file from step 1. The SHA hashes should match.</p>
432
433<pre><code>diff encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes \
434encryptpad0_3_2_5_webupd8_ppa_changes/encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes
435</code></pre>
436
437<div id="compile-on-windows"></div>
438
439
440<h2>Compile EncryptPad on Windows</h2>
441
442<div id="prerequisites"></div>
443
444
445<h3>Prerequisites</h3>
446
447<ol>
448<li><a href="http://www.qt.io/download-open-source/"><strong>Qt framework</strong></a> based on MingW 32 bit (the latest build has been tested with Qt 5.10.1).</li>
449<li>MSYS: you can use one bundled with <a href="http://git-scm.com/download/win"><strong>Git For Windows</strong></a>. You probably use Git anyway.</li>
450<li>Python: any recent version will work.</li>
451</ol>
452
453
454<div id="steps"></div>
455
456
457<h3>Steps</h3>
458
459<ol>
460<li><p>Modify the session <strong>PATH</strong> environment variable to include the Qt build toolset and Python. <strong>mingw32-make</strong>, <strong>g++</strong>, <strong>qmake</strong>, <strong>python.exe</strong> should be in the global search path in your Git Bash session. I personally modify bash.bashrc and add a line like <code>PATH=/c/Python35-32:/c/Qt/5.10.1/mingw53_32/bin:/c/Qt/Tools/mingw530_32/bin:/c/MinGW/msys/1.0/bin:/bin</code> not to pollute the system wide PATH variable.</p></li>
461<li><p>Extract the EncryptPad source files to a directory.</p></li>
462<li><p>Run <strong>configure.py &ndash;help</strong> script to see available options. To build everything:</p>
463
464<p> ./configure.py &ndash;cpu x86 &ndash;os mingw &ndash;static
465 make</p></li>
466</ol>
467
468
469<p>The configure command will always work if your console is running with administrative privileges. If you don&rsquo;t want to run as administrator, add <code>--link-method hardlink</code> to the options.
470If the build is successful, you should see the executable <strong>./bin/release/encryptpad.exe</strong></p>
471
472<p>Note that if you want EncryptPad to work as a single executable without dlls, you need to build Qt framework yourself statically. It takes a few hours. There are plenty of instructions on how to do this in the Internet. The most popular article recommends using a PowerShell script. While it is convenient and I did it once, sometimes you don&rsquo;t want to upgrade your PowerShell and install heavy dependencies coming with it. So the next time I had to do that, I read the script and did everything manually. Luckily there are not too many steps in it.</p>
473
474<div id="compile-on-macos"></div>
475
476
477<h2>Compile EncryptPad on macOS</h2>
478
479<p>You need to install Qt 5, Python and run:</p>
480
481<pre><code>export PATH=$HOME/Qt/5.12.11/clang_64/bin/:$PATH
482./configure.py --ldflags "-mmacosx-version-min=11.0" --cxxflags "-mmacosx-version-min=11.0"
483make
484</code></pre>
485
486<p>Change the Qt path and replace the minimal macOS versions as needed. The command will work without them but the result will be limited to the current version.</p>
487
488<div id="compile-on-linux"></div>
489
490
491<h2>Compile EncryptPad on Linux</h2>
492
493<div id="build-on-fedora"></div>
494
495
496<h3>Fedora</h3>
497
498<p>Install dependencies and tools:</p>
499
500<pre><code>dnf install gcc make qt5-qtbase-devel gcc-c++ python libstdc++-static glibc-static botan2-devel bzip2-devel zlib-devel
501</code></pre>
502
503<p>Open the EncryptPad directory:</p>
504
505<pre><code>./configure.py
506make
507sudo make install
508</code></pre>
509
510<div id="build-on-ubuntu"></div>
511
512
513<h3>Ubuntu</h3>
514
515<p>Install dependencies and tools:</p>
516
517<pre><code>apt-get install qtbase5-dev gcc g++ make python pkg-config zlib1g-dev libbotan-2-dev libbz2-dev
518</code></pre>
519
520<p>Open the EncryptPad source directory:</p>
521
522<pre><code>./configure.py
523make
524sudo make install
525</code></pre>
526
527<div id="build-on-debian"></div>
528
529
530<h3>Debian</h3>
531
532<p>Install dependencies and tools:</p>
533
534<pre><code>apt-get install qtbase5-dev gcc g++ make python zlib1g-dev pkg-config libbotan-2-dev libbz2-dev
535</code></pre>
536
537<p>Open the EncryptPad source directory:</p>
538
539<pre><code>./configure.py
540make
541sudo make install
542</code></pre>
543
544<div id="build-on-opensuse"></div>
545
546
547<h3>openSUSE</h3>
548
549<p>Install dependencies and tools:</p>
550
551<pre><code>zypper install gcc gcc-c++ make python pkg-config zlib-devel libqt5-qtbase-devel libbotan-devel libbz2-devel
552</code></pre>
553
554<p>Open the EncryptPad source directory:</p>
555
556<pre><code>./configure.py
557make
558sudo make install
559</code></pre>
560
561<div id="build-on-archlinux"></div>
562
563
564<h3>Archlinux</h3>
565
566<p>Install dependencies and tools:</p>
567
568<pre><code>pacman -S --needed base-devel
569pacman -S qt5-base python botan zlib bzip2
570</code></pre>
571
572<p>Open the EncryptPad source directory:</p>
573
574<pre><code>./configure.py
575make
576sudo make install
577</code></pre>
578
579<div id="build-on-freebsd"></div>
580
581
582<h3>FreeBSD</h3>
583
584<p>Install dependencies and tools:</p>
585
586<pre><code>pkg install python pkgconf botan2 qt5
587</code></pre>
588
589<p>Open the EncryptPad source directory:</p>
590
591<pre><code>./configure.py
592make
593</code></pre>
594
595<div id="portable-mode"></div>
596
597
598<h2>Portable mode</h2>
599
600<p>EncryptPad checks the executable directory for a sub-directory called <code>encryptpad_repository</code>. If exists, it is used for key files and settings. The directory <code>.encryptpad</code> in the user&rsquo;s profile is then ignored. The EncryptPad executable and <code>encryptpad_repository</code> can both be copied to a removable media and used on multiple computers. It should be noted that keeping encrypted material with the key files on the same removable media is less secure. Separate them if possible.</p>
601
602<div id="fakevim-mode"></div>
603
604
605<h2>FakeVim mode</h2>
606
607<p>FakeVim mode lets edit files with Vim-like interface.</p>
608
609<p>To enable the mode:</p>
610
611<ol>
612<li>open Settings&hellip; / Preferences &hellip;</li>
613<li>Set &ldquo;Enable FakeVim&rdquo;</li>
614<li>Restart EncryptPad</li>
615</ol>
616
617
618<p>To configure FakeVim create and edit the file at the location below:</p>
619
620<p>Linux and macOS:</p>
621
622<pre><code>~/.encryptpad/vimrc
623</code></pre>
624
625<p>On Windows in the user profile directory:</p>
626
627<pre><code>_encryptpad/vimrc
628</code></pre>
629
630<p>You can find more information about FakeVim interface at <a href="https://github.com/hluk/FakeVim">FakeVim library web page</a></p>
631
632<div id="fakevim-input-output"></div>
633
634
635<h3>FakeVim: input and output commands</h3>
636
637<p>The ex mode supports commands to read and write files. The input and output commands are integrated with the following EncryptPad operations:</p>
638
639<pre><code>:r &lt;file&gt; - File / Open...
640
641:w - File / Save
642
643:w &lt;file&gt; - File / Save As...
644
645:q - File / Exit
646</code></pre>
647
648<p>The combinations of the above commands are also supported:</p>
649
650<pre><code>:wq
651:wq &lt;file&gt;
652</code></pre>
653
654<p>Vim + register integrates with the system clipboard. You can also add the below line to the vimrc file to integrate the unnamed register with the system clipboard:</p>
655
656<pre><code>set clipboard=unnamedplus
657</code></pre>
658
659<div id="passphrases-in-memory"></div>
660
661
662<h2>Does EncryptPad store passphrases in the memory to reopen files?</h2>
663
664<p>No, it does not. After being entered, a passphrase and random salt are hashed with an S2K algorithm. The result is used as the encryption key to encrypt or decrypt the file. A pool of these S2K results is generated every time the user enters a new passphrase. It allows to save and load files protected with this passphrase multiple times without having the passphrase. The size of the pool can be changed in the Preferences dialogue. The latest version at the moment of writing has this number set to 8 by default. It means that you can save a file 8 times before EncryptPad will ask you to enter the passphrase again. You can increase this number but it will have an impact on the performance because S2K algorithms with many iterations are slow by design.</p>
665
666<div id="acknowledgements"></div>
667
668
669<h2>Acknowledgements</h2>
670
671<p>EncryptPad uses the following frameworks and libraries:</p>
672
673<ol>
674<li><a href="http://www.qt.io/"><strong>Qt Framework</strong></a></li>
675<li><a href="http://botan.randombit.net/"><strong>Botan</strong></a></li>
676<li><a href="http://stlplus.sourceforge.net/"><strong>stlplus</strong></a></li>
677<li><a href="http://stlplus.sourceforge.net/makefiles/docs/"><strong>Makefiles</strong></a></li>
678<li><a href="http://zlib.net/"><strong>zlib</strong></a></li>
679<li><a href="http://code.google.com/p/googletest/"><strong>gtest</strong></a></li>
680<li><a href="http://www.famfamfam.com/lab/icons/silk/"><strong>famfamfam Silk iconset 1.3</strong></a></li>
681<li><a href="https://github.com/SergiusTheBest/plog"><strong>plog</strong></a></li>
682<li><a href="https://github.com/hluk/FakeVim"><strong>FakeVim</strong></a></li>
683</ol>
684
685
686<div id="integrity-verification"></div>
687
688
689<h2>EncryptPad integrity verification</h2>
690
691<div id="openpgp-signing"></div>
692
693
694<h3>OpenPGP signing and certification authority</h3>
695
696<p>All EncryptPad related downloads are signed with the following OpenPGP key.</p>
697
698<p><code>EncryptPad (Releases) 2048R/A2813E85</code></p>
699
700<p><code>software@evpo.net</code></p>
701
702<p><code>Key fingerprint = 634B FC0C CC42 6C74 389D  8931 0F1C FF71 A281 3E85</code></p>
703
704<p>I also have a code signing certificate issued by a certification authority (CA). To establish a connection between my CA certificate and the above OpenPGP key, I created an executable signed with the CA certificate containing fingerprints and the OpenPGP key. You can find <code>ca_signed_pgp_signing_instructions</code> in downloads. Effectively I created a bridge of trust between my CA certificate and the OpenPGP key.</p>
705
706<p>There is a few reasons why I did not simply use the CA certificate:</p>
707
708<ol>
709<li>EncryptPad is based on the OpenPGP standard and promotes it.</li>
710<li>OpenPGP signing is more flexible.</li>
711<li>There is no yearly CA certification running cost.</li>
712</ol>
713
714
715<div id="verification-process"></div>
716
717
718<h3>Step by step verification process</h3>
719
720<ol>
721<li>Download packages and their detached OpenPGP signatures.</li>
722<li>Import the EncryptPad (Releases) key to your GPG keyring.</li>
723<li>Ensure that it is the valid EncryptPad (Releases) key by checking its fingerprint with <code>ca_signed_pgp_signing_instructions</code>.</li>
724<li>Verify signatures on the downloaded files with GPG.</li>
725</ol>
726
727
728<div id="license"></div>
729
730
731<h2>License</h2>
732
733<p>EncryptPad is free software: you can redistribute it and/or modify
734it under the terms of the <a href="http://www.gnu.org/licenses/">GNU General Public License</a> as published by
735the Free Software Foundation, either version 2 of the License, or
736(at your option) any later version.</p>
737
738<p>EncryptPad is distributed in the hope that it will be useful,
739but WITHOUT ANY WARRANTY; without even the implied warranty of
740MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
741GNU General Public License for more details.</p>
742
743<div id="contact"></div>
744
745
746<h2>Contact and feedback</h2>
747
748<p>If your question is related to EncryptPad, send it to the mailing list: <strong>encryptpad@googlegroups.com</strong> linked to <a href="https://groups.google.com/d/forum/encryptpad">the public discussion group</a>.</p>
749
750<p>Bug tracker and contributions: <a href="https://github.com/evpo/EncryptPad/issues">github.com/evpo/EncryptPad/issues</a></p>
751
752<p>For other matters, please contact Evgeny Pokhilko <strong>software@evpo.net</strong></p>
753
754<p><a href="http://www.evpo.net/encryptpad">http://www.evpo.net/encryptpad</a></p>
755

README.md

1[![Build status](https://ci.appveyor.com/api/projects/status/6esb4w56f25go5oc?svg=true)](https://ci.appveyor.com/project/evpo/encryptpad)
2
3Screenshots and tutorials are at [evpo.net/encryptpad/](http://evpo.net/encryptpad/)
4
5# EncryptPad
6
7![README.png](README.png)
8
9<div id="cutline"></div>
10EncryptPad is an application for viewing and editing symmetrically encrypted text. Using a simple and convenient graphical and command line interface, EncryptPad provides a tool for encrypting and decrypting binary files on disk while offering effective measures for protecting information, and it uses the most widely chosen quality file format **OpenPGP** [RFC 4880](https://tools.ietf.org/html/rfc4880). Unlike other OpenPGP software which main purpose is asymmetric encryption, the primary focus of EncryptPad is symmetric encryption.
11
12## Table of Contents
13
14* [Features](#features)
15* [Supported platforms](#supported-platforms)
16* [Why use EncryptPad?](#why-use-encryptpad)
17* [When do I need EncryptPad?](#when-encryptpad)
18* [When can I not use EncryptPad?](#when-can-i-not)
19* [File types](#file-types)
20  - [GPG](#gpg)
21  - [EPD](#epd)
22  - [Feature support](#feature-support)
23* [What is an EncryptPad key file?](#key-file)
24* [EPD file format when encrypting with a key](#epd-file-format)
25* [Use CURL to automatically download keys from a remote storage](#use-curl)
26* [Known weaknesses](#known-weaknesses)
27* [Command line interface](#command-line-interface)
28  - [encryptcli](#command-line-encryptcli)
29  - [encryptpad](#command-line-encryptpad)
30* [Installing EncryptPad](#installing)
31    - [Portable executable](#portable-exe)
32    - [Arch Linux](#install-on-arch)
33    - [Ubuntu or Linux Mint](#install-on-ubuntu)
34* [Compile EncryptPad on Windows](#compile-on-windows)
35  - [Prerequisites](#prerequisites)
36  - [Steps](#steps)
37* [Compile EncryptPad on macOS](#compile-on-macos)
38* [Compile EncryptPad on Linux](#compile-on-linux)
39    - [Fedora](#build-on-fedora)
40    - [Ubuntu](#build-on-ubuntu)
41    - [Debian](#build-on-debian)
42    - [openSUSE](#build-on-opensuse)
43    - [Archlinux](#build-on-archlinux)
44    - [FreeBSD](#build-on-freebsd)
45* [Portable mode](#portable-mode)
46* [FakeVim mode](#fakevim-mode)
47    - [FakeVim: input and output commands](#fakevim-input-output)
48* [Does EncryptPad store passphrases in the memory to reopen files?](#passphrases-in-memory)
49* [Acknowledgements](#acknowledgements)
50* [EncryptPad integrity verification](#integrity-verification)
51    - [OpenPGP signing and certification authority](#openpgp-signing)
52    - [Step by step verification process](#verification-process)
53* [License](#license)
54* [Contact and feedback](#contact)
55
56
57<div id="features"></div>
58
59## Features
60
61* **Symmetric** encryption
62* **Passphrase** protection
63* **Key file** protection
64* Combination of **passphrase and key file**
65* Random **key file generator**
66* **Key repository** in a hidden directory in the user's home folder
67* Path to a key file can be stored in an encrypted file. If enabled, **you do not need to specify the key file** every time you open files.
68* Encryption of **binary files** (images, videos, archives etc.)
69* **FakeVim** mode to edit files by using Vim-like user interface
70* **Read only** mode to prevent accidental file modification
71* **UTF8** text encoding
72* Windows/Unix **configurable line endings**
73* Customisable **passphrase generator** helps create strong random passphrases.
74* File format compatible with **OpenPGP**
75* **Iterated and salted S2K**
76* **Passphrases are not kept in the memory** for reuse, only S2K results ([more ...](#passphrases-in-memory))
77* Cipher algorithms: **TripleDES, CAST5, AES, AES192, AES256, Camellia128, Camellia192, Camellia256, Twofish**
78* Hash algorithms: **SHA-1, SHA-256, SHA-384, SHA-512, SHA-224**
79* Integrity protection: **SHA-1**
80* Compression: **ZLIB, ZIP, Bzip2**
81* **ASCII armor**
82* **Large multi-gigabyte files** are supported
83
84<div id="supported-platforms"></div>
85
86## Supported platforms
87
88* Windows
89
90* Linux
91
92* Mac OS
93
94<div id="why-use-encryptpad"></div>
95
96## Why use EncryptPad?
97
98* **Multi-platform** codebase: it has been compiled on three popular operating systems and can be adapted to more.
99
100* **Portable**: simply copy the executable to a memory stick or a network drive and use on all your computers.
101
102* **Simple to use**: EncryptPad is a text editor and an encryption tool for binary files but it saves encrypted, compressed and integrity protected files.
103
104* **Open source** with concise codebase: you can read the code or ask somebody you trust to read it for you to ensure that there are no back doors and your information is safe.
105
106* **OpenPGP** file format: you can encrypt a file with another tool (gpg for example) implementing the format and open it with EncryptPad and vice versa.
107
108* **Double protection**: randomly generated key files in addition to passphrases.
109
110<div id="when-encryptpad"></div>
111
112## When do I need EncryptPad?
113
114* You have a file containing sensitive information such as account names, passphrases or IDs. It is stored on an unprotected media or you can't control who accesses the file, whether it is located on a computer at work, a laptop while on the move, a memory stick or a cloud drive.
115
116* You need to send an encrypted file to somebody with whom you prearranged a shared secret (a passphrase or a key file). In this case, you need to exchange the secret personally (not via an accessible Internet protocol) for the protected file to be decrypted by the recipient.
117
118* You store or receive a file and need to ensure that it has not been tampered with or corrupted during transmission. EncryptPad uses SHA-1 hashing algorithm to verify the data's integrity.
119
120* You need protection against a brute force attack in case your storage gets in somebody's hands. EncryptPad allows to generate a key and store it separately from encrypted information. The unwanted person would need two secrets to open an encrypted file: the passphrase and the key. Consider this example: you store your encrypted file on a memory stick, and protect it with a passphrase. In addition to that, you protect the file with a file key and store the key on computers where you open the file. If the memory stick is lost, the passphrase is not enough to decrypt your information. The key file is also needed and it is not on the memory stick.
121
122<div id="when-can-i-not"></div>
123
124## When can I not use EncryptPad?
125
126* You need to send a file to somebody with whom you have **not prearranged a shared secret** (a passphrase or a key file). In this case, you need asymmetric encryption with public and private keys. Fortunately, there are many convenient tools suitable for the task.
127
128* You are on public transport or a common area where **somebody can see your screen**.
129
130* EncryptPad is not effective on a computer infected with spyware or a virus. Do not use it on a **public, shared or compromised computer** if you do not trust its safety.
131
132* **IMPORTANT**: Before using EncryptPad ensure that it is legal in your country to use encryption ciphers that EncryptPad provides. You may find useful information at [cryptolaw.org](http://www.cryptolaw.org/).
133
134* **IMPORTANT**: If you forgot your passphrase or lost a key file, there is nothing that can be done to open your encrypted information. There are no backdoors in the formats that EncryptPad supports. EncryptPad developers take no responsibility for corrupted or invalid files in accordance with the license.
135
136<div id="file-types"></div>
137
138## File types
139
140The format is determined by an extension of a file. Main extensions of encrypted files are GPG and EPD.
141
142<div id="gpg"></div>
143
144### GPG
145
146This file type conforms to OpenPGP format and it is compatible with other OpenPGP tools. Use it if you need to open a file where EncryptPad is not available. The format does not support double protection (key file + passphrase). So you need to choose between key file or passphrase and cannot use both. In addition, it cannot store file key path in the encrypted file. It means that every time you open a file encrypted with a key file, the application will ask you which key file to use.
147
148<div id="epd"></div>
149
150### EPD
151
152EncryptPad specific format. Other OpenPGP software will not be able to open it unless the file was only protected with a passphrase. If passphrase only protection was used, the file is effectively a GPG file (see GPG section above). However, when a key file protection is involved, it is a GPG file in a [WAD](https://en.wikipedia.org/wiki/Doom_WAD) container. See the following chapter for details.
153
154<div id="feature-support"></div>
155
156### Feature support
157
158<table style="border: 1px solid black">
159<tr>
160<th>Type</th><th>Feature</th><th>Supported</th><th>Key file path\*</th><th>OpenPGP compatible</th><th>File format</th>
161</tr>
162<tr><td>GPG</td><td>Passphrase</td><td>yes</td><td>n/a</td><td>yes</td><td>OpenPGP file</td></tr>
163<tr><td>GPG</td><td>Key file</td><td>yes</td><td>no</td><td>yes</td><td>OpenPGP file</td></tr>
164<tr><td>GPG</td><td>Key file and passphrase</td><td>no</td><td>n/a</td><td>n/a</td><td>n/a</td></tr>
165<tr><td>EPD</td><td>Passphrase</td><td>yes</td><td>n/a</td><td>yes</td><td>OpenPGP file</td></tr>
166<tr><td>EPD</td><td>Key file</td><td>yes</td><td>yes</td><td>no</td><td>Nested: WAD/OpenPGP</td></tr>
167<tr><td>EPD</td><td>Key file and passphrase</td><td>yes</td><td>yes</td><td>no</td><td>Nested: OpenPGP/WAD/OpenPGP</td></tr>
168</table>
169
170\* Key file location is persisted in the header of an encrypted file so the user does not need to specify it when decrypting.
171
172<div id="key-file"></div>
173
174## What is an EncryptPad key file?
175In symmetric encryption the same sequence is used to encrypt and decrypt data. The user or another
176application usually provides this sequence in the form of an entered passphrase or a file. In addition to
177entered passphrases, EncryptPad generates files with random sequences called "key files".
178
179When the user creates a key file, EncryptPad generates a random sequence of bytes, asks the
180user for a passphrase, encrypts the generated sequence and saves it to a file.
181
182The format of the file is OpenPGP. Other OpenPGP implementations can also create and
183open EncryptPad key files as below shell commands demonstrate.
184
185When EncryptPad generates a new key file, it is roughly equivalent to the following `gpg2` command.
186
187    pwmake 1024 | gpg2 -c --armor --cipher-algo AES256 > ~/.encryptpad/foo.key
188
189`pwmake` generates a random sequence, which `gpg2` in-turn encrypts. It will ask for the
190passphrase to encrypt the sequence.
191
192When you use this key to encrypt `test3.txt`, the equivalent `gpg` command is below:
193
194    gpg2 --decrypt ~/.encryptpad/foo.key \
195    | gpg2 --passphrase-fd 0 --batch -c --cipher-algo AES256 \
196    -o /tmp/test3.txt.gpg /tmp/test3.txt
197
198The first `gpg2` process decrypts `foo.key` and directs it to descriptor 0 of the second process
199through a pipe. `gpg2` reads the sequence from the descriptor with `--passphrase-fd 0`.
200
201When EncryptPad opens the encrypted file protected with `foo.key`, the equivalent `gpg` commands are:
202
203    gpg2 --decrypt ~/.encryptpad/foo.key \
204    | gpg2 --passphrase-fd 0 --batch --decrypt \
205    -o /tmp/test4.txt /tmp/test3.txt.gpg
206
207As you see, other OpenPGP implementations can also use EncryptPad keys.
208
209<div id="epd-file-format"></div>
210
211## EPD file format when encrypting with a key
212
213There are three different structures a saved file can have depending on protection mode:
214
2151. **Passphrase only** (passphrase is used to protect a file but no keys are specified). The file is an ordinary OpenPGP file.
216
2172. **Key only** (passphrase is not set but a key file is used for protection). The file is a WAD file. [WAD](https://en.wikipedia.org/wiki/Doom_WAD) is a simple format for combining multiple binary files in one. You can open a WAD file in [Slade](http://slade.mancubus.net/). It contains two files internally:
218    * OpenPGP file encrypted with the key
219    * `__X2_KEY` is a plain text file containing the path to the key if "Persistent key location in the encrypted file" is enabled. Otherwise, it has zero length.
220
2213. **Protected with passphrase and key**. The resulting file is an OpenPGP file containing a WAD file as explained in 2.
222
223<div id="use-curl"></div>
224
225## Use CURL to automatically download keys from a remote storage
226
227If **[CURL](http://curl.haxx.se/)** URL is specified in **Key File Path** field in the **Set Encryption Key** dialogue, EncryptPad will attempt to start a curl process to download the key from a remote host. If you want to use this feature, you need to set the path to the CURL executable in the EncryptPad settings.
228
229Consider this use case scenario: you travel with your laptop and open an encrypted file on the laptop. If you protect the file with a passphrase and a key and your laptop is lost or stolen, the perpetrator will be able to make a brute force attack on your file because the key is also stored on the laptop. To avoid this, EncryptPad takes the following steps:
230
2311. Encrypts the plain text file with the key
2322. Copies the encrypted file into a WAD file together with the unencrypted HTTPS or SFTP URL to the key file containing authentication parameters.
2333. Encrypts the WAD file from point 2 with the passphrase.
234
235If this file gets into the hands of a wrongdoer, he or she will need to brute force the passphrase first to be able to obtain the key URL and the authentication parameters. Since a brute force attack takes a lot of time, the user will be able to remove the key or change the authentication so the previous parameters become obsolete.
236
237<div id="known-weaknesses"></div>
238
239## Known weaknesses
240
241* EncryptPad stores unencrypted text in memory. If a memory dump is automatically taken after a system or application crash or some of the memory is saved to a swap file, the sensitive information will be present on the disk. Sometimes it is possible to configure an operating system not to use a dump and swap files. It is a good practice to close EncryptPad when not in use.
242
243<div id="command-line-interface"></div>
244
245## Command line interface
246
247### encryptcli
248<div id="command-line-encryptcli"></div>
249
250**encryptcli** is the executable to encrypt / decrypt files in command line. Run it without arguments to see available parameters. Below is an example of encrypting a file with a key:
251
252    # generate a new key and protect it with the passphrase "key".
253    # --key-pwd-fd 0 for reading the key passphrase from descriptor 0
254    echo -n "key" | encryptcli --generate-key --key-pwd-fd 0 my_key.key
255
256    # encrypt plain_text.txt with my_key.key created above.
257    # The key passphrase is sent through file descriptor 3
258    cat plain_text.txt | encryptcli -e --key-file my_key.key \
259    --key-only --key-pwd-fd 3 -o plain_text.txt.gpg 3< <(echo -n "key")
260
261### encryptpad
262<div id="command-line-encryptpad"></div>
263
264**encryptpad** is the GUI executable. It has the command line parameters below:
265
266    `--lang` - to enforce the language for the GUI
267
268    `--log-file` - specify the log file for diagnostics
269
270    `--log-severity` - log severity can be one of the following list: none, fatal, error, warning, info, debug, verbose
271
272<div id="installing"></div>
273
274## Installing EncryptPad
275
276<div id="portable-exe"></div>
277
278### Portable executable
279
280Portable binaries are available for Windows and macOS. They can be copied on a memory stick or
281placed on a network share.
282
283<div id="install-on-arch"></div>
284
285### Arch Linux
286
287Use fingerprints to receive gpg keys for EncryptPad and Botan.
288
289    gpg --recv-key 621DAF6411E1851C4CF9A2E16211EBF1EFBADFBC
290    gpg --recv-key 634BFC0CCC426C74389D89310F1CFF71A2813E85
291
292Install the AUR packages below:
293
294- [botan-stable](https://aur.archlinux.org/packages/botan-stable/)<sup><small>AUR</small></sup>
295- [encryptpad](https://aur.archlinux.org/packages/encryptpad/)<sup><small>AUR</small></sup>
296
297`pacaur` installs `botan-stable` automatically as `encryptpad` dependency.
298
299<div id="install-on-ubuntu"></div>
300
301### Ubuntu or Linux Mint via PPA
302
303Alin Andrei from [**webupd8.org**](http://webupd8.org) kindly created EncryptPad packages for
304several distributions. See instructions below on how to install them.
305
306#### Installation
307
308Use the commands below to install the packages.
309
310    sudo add-apt-repository ppa:nilarimogard/webupd8
311    sudo apt update
312    sudo apt install encryptpad encryptcli
313
314#### Integrity verification procedure
315
316Below are steps to verify the SHA-1 hashes of the source files in [Launchpad webupd8 PPA](https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+packages) used for building the packages. Ideally, you need to be familiar with the PPA concepts.
317
3181\. Download one of the `changes` files below depending on your distribution. The package version was 0.3.2.5 at the moment of writing. Please replace it with the latest version you are installing.
319
320- Yakkety
321
322        wget https://launchpadlibrarian.net/282249531/encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes
323
324- Xenial
325
326        wget https://launchpadlibrarian.net/282249418/encryptpad_0.3.2.5-1~webupd8~xenial1_source.changes
327
328- Vivid
329
330        wget https://launchpadlibrarian.net/282249098/encryptpad_0.3.2.5-1~webupd8~vivid1_source.changes
331
332- Trusty
333
334        wget https://launchpadlibrarian.net/282247738/encryptpad_0.3.2.5-1~webupd8~trusty1_source.changes
335
3362\. Download the tarball with the verified "changes" files and its signature:
337
338    wget https://github.com/evpo/EncryptPad/releases/download/v0.3.2.5\
339    /encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz
340
341    wget https://github.com/evpo/EncryptPad/releases/download/v0.3.2.5\
342    /encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz.asc
343
3443\. Receive and verify the `EncryptPad Release` key:
345
346    gpg --recv-key 634BFC0CCC426C74389D89310F1CFF71A2813E85
347
3484\. Verify the signature on the tarball:
349
350    gpg --verify encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz.asc
351
3525\. Extract the content:
353
354    tar -xf encryptpad0_3_2_5_webupd8_ppa_changes.tar.gz
355
3566\. Compare the "changes" file for your distribution with the file from step 1. The SHA hashes should match.
357
358    diff encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes \
359    encryptpad0_3_2_5_webupd8_ppa_changes/encryptpad_0.3.2.5-1~webupd8~yakkety1_source.changes
360
361<div id="compile-on-windows"></div>
362
363## Compile EncryptPad on Windows
364
365<div id="prerequisites"></div>
366
367### Prerequisites
368
3691. [**Qt framework**](http://www.qt.io/download-open-source/) based on MingW 32 bit (the latest build has been tested with Qt 5.10.1).
3702. MSYS: you can use one bundled with [**Git For Windows**](http://git-scm.com/download/win). You probably use Git anyway.
3713. Python: any recent version will work.
372
373<div id="steps"></div>
374
375### Steps
376
3771. Modify the session **PATH** environment variable to include the Qt build toolset and Python. **mingw32-make**, **g++**, **qmake**, **python.exe** should be in the global search path in your Git Bash session. I personally modify bash.bashrc and add a line like `PATH=/c/Python35-32:/c/Qt/5.10.1/mingw53_32/bin:/c/Qt/Tools/mingw530_32/bin:/c/MinGW/msys/1.0/bin:/bin` not to pollute the system wide PATH variable.
378
3792. Extract the EncryptPad source files to a directory.
380
3813. Run **configure.py --help** script to see available options. To build everything:
382
383    ./configure.py --cpu x86 --os mingw --static
384    make
385
386The configure command will always work if your console is running with administrative privileges. If you don't want to run as administrator, add `--link-method hardlink` to the options.
387If the build is successful, you should see the executable **./bin/release/encryptpad.exe**
388
389Note that if you want EncryptPad to work as a single executable without dlls, you need to build Qt framework yourself statically. It takes a few hours. There are plenty of instructions on how to do this in the Internet. The most popular article recommends using a PowerShell script. While it is convenient and I did it once, sometimes you don't want to upgrade your PowerShell and install heavy dependencies coming with it. So the next time I had to do that, I read the script and did everything manually. Luckily there are not too many steps in it.
390
391<div id="compile-on-macos"></div>
392
393## Compile EncryptPad on macOS
394
395You need to install Qt 5, Python and run:
396
397    export PATH=$HOME/Qt/5.12.11/clang_64/bin/:$PATH
398    ./configure.py --ldflags "-mmacosx-version-min=11.0" --cxxflags "-mmacosx-version-min=11.0"
399    make
400
401Change the Qt path and replace the minimal macOS versions as needed. The command will work without them but the result will be limited to the current version.
402
403<div id="compile-on-linux"></div>
404
405## Compile EncryptPad on Linux
406
407<div id="build-on-fedora"></div>
408
409### Fedora
410
411Install dependencies and tools:
412
413    dnf install gcc make qt5-qtbase-devel gcc-c++ python libstdc++-static glibc-static botan2-devel bzip2-devel zlib-devel
414
415Open the EncryptPad directory:
416
417    ./configure.py
418    make
419    sudo make install
420
421<div id="build-on-ubuntu"></div>
422
423### Ubuntu
424
425Install dependencies and tools:
426
427    apt-get install qtbase5-dev gcc g++ make python pkg-config zlib1g-dev libbotan-2-dev libbz2-dev
428
429Open the EncryptPad source directory:
430
431    ./configure.py
432    make
433    sudo make install
434
435<div id="build-on-debian"></div>
436
437### Debian
438
439Install dependencies and tools:
440
441    apt-get install qtbase5-dev gcc g++ make python zlib1g-dev pkg-config libbotan-2-dev libbz2-dev
442
443Open the EncryptPad source directory:
444
445    ./configure.py
446    make
447    sudo make install
448
449<div id="build-on-opensuse"></div>
450
451### openSUSE
452
453Install dependencies and tools:
454
455    zypper install gcc gcc-c++ make python pkg-config zlib-devel libqt5-qtbase-devel libbotan-devel libbz2-devel
456
457Open the EncryptPad source directory:
458
459    ./configure.py
460    make
461    sudo make install
462
463<div id="build-on-archlinux"></div>
464
465### Archlinux
466
467Install dependencies and tools:
468
469    pacman -S --needed base-devel
470    pacman -S qt5-base python botan zlib bzip2
471
472Open the EncryptPad source directory:
473
474    ./configure.py
475    make
476    sudo make install
477
478<div id="build-on-freebsd"></div>
479
480### FreeBSD
481
482Install dependencies and tools:
483
484    pkg install python pkgconf botan2 qt5
485
486Open the EncryptPad source directory:
487
488    ./configure.py
489    make
490
491<div id="portable-mode"></div>
492
493## Portable mode
494
495EncryptPad checks the executable directory for a sub-directory called `encryptpad_repository`. If exists, it is used for key files and settings. The directory `.encryptpad` in the user's profile is then ignored. The EncryptPad executable and `encryptpad_repository` can both be copied to a removable media and used on multiple computers. It should be noted that keeping encrypted material with the key files on the same removable media is less secure. Separate them if possible.
496
497<div id="fakevim-mode"></div>
498
499## FakeVim mode
500
501FakeVim mode lets edit files with Vim-like interface.
502
503To enable the mode:
504
5051. open Settings... / Preferences ...
5062. Set "Enable FakeVim"
5073. Restart EncryptPad
508
509To configure FakeVim create and edit the file at the location below:
510
511Linux and macOS:
512
513    ~/.encryptpad/vimrc
514
515On Windows in the user profile directory:
516
517    _encryptpad/vimrc
518
519You can find more information about FakeVim interface at [FakeVim library web page](https://github.com/hluk/FakeVim)
520
521<div id="fakevim-input-output"></div>
522### FakeVim: input and output commands
523
524The ex mode supports commands to read and write files. The input and output commands are integrated with the following EncryptPad operations:
525
526    :r <file> - File / Open...
527
528    :w - File / Save
529
530    :w <file> - File / Save As...
531
532    :q - File / Exit
533
534The combinations of the above commands are also supported:
535
536    :wq
537    :wq <file>
538
539Vim + register integrates with the system clipboard. You can also add the below line to the vimrc file to integrate the unnamed register with the system clipboard:
540
541    set clipboard=unnamedplus
542
543<div id="passphrases-in-memory"></div>
544
545## Does EncryptPad store passphrases in the memory to reopen files?
546No, it does not. After being entered, a passphrase and random salt are hashed with an S2K algorithm. The result is used as the encryption key to encrypt or decrypt the file. A pool of these S2K results is generated every time the user enters a new passphrase. It allows to save and load files protected with this passphrase multiple times without having the passphrase. The size of the pool can be changed in the Preferences dialogue. The latest version at the moment of writing has this number set to 8 by default. It means that you can save a file 8 times before EncryptPad will ask you to enter the passphrase again. You can increase this number but it will have an impact on the performance because S2K algorithms with many iterations are slow by design.
547
548<div id="acknowledgements"></div>
549
550## Acknowledgements
551
552EncryptPad uses the following frameworks and libraries:
553
5541. [**Qt Framework**](http://www.qt.io/)
5552. [**Botan**](http://botan.randombit.net/)
5563. [**stlplus**](http://stlplus.sourceforge.net/)
5575. [**Makefiles**](http://stlplus.sourceforge.net/makefiles/docs/)
5584. [**zlib**](http://zlib.net/)
5596. [**gtest**](http://code.google.com/p/googletest/)
5607. [**famfamfam Silk iconset 1.3**](http://www.famfamfam.com/lab/icons/silk/)
5618. [**plog**](https://github.com/SergiusTheBest/plog)
5629. [**FakeVim**](https://github.com/hluk/FakeVim)
563
564<div id="integrity-verification"></div>
565
566## EncryptPad integrity verification
567
568<div id="openpgp-signing"></div>
569
570### OpenPGP signing and certification authority
571
572All EncryptPad related downloads are signed with the following OpenPGP key.
573
574`EncryptPad (Releases) 2048R/A2813E85`
575
576`software@evpo.net`
577
578`Key fingerprint = 634B FC0C CC42 6C74 389D  8931 0F1C FF71 A281 3E85`
579
580I also have a code signing certificate issued by a certification authority (CA). To establish a connection between my CA certificate and the above OpenPGP key, I created an executable signed with the CA certificate containing fingerprints and the OpenPGP key. You can find `ca_signed_pgp_signing_instructions` in downloads. Effectively I created a bridge of trust between my CA certificate and the OpenPGP key.
581
582There is a few reasons why I did not simply use the CA certificate:
583
5841. EncryptPad is based on the OpenPGP standard and promotes it.
5852. OpenPGP signing is more flexible.
5863. There is no yearly CA certification running cost.
587
588<div id="verification-process"></div>
589
590### Step by step verification process
591
5921. Download packages and their detached OpenPGP signatures.
5932. Import the EncryptPad (Releases) key to your GPG keyring.
5943. Ensure that it is the valid EncryptPad (Releases) key by checking its fingerprint with `ca_signed_pgp_signing_instructions`.
5954. Verify signatures on the downloaded files with GPG.
596
597<div id="license"></div>
598
599## License
600
601EncryptPad is free software: you can redistribute it and/or modify
602it under the terms of the [GNU General Public License](http://www.gnu.org/licenses/) as published by
603the Free Software Foundation, either version 2 of the License, or
604(at your option) any later version.
605
606EncryptPad is distributed in the hope that it will be useful,
607but WITHOUT ANY WARRANTY; without even the implied warranty of
608MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
609GNU General Public License for more details.
610
611<div id="contact"></div>
612
613## Contact and feedback
614
615If your question is related to EncryptPad, send it to the mailing list: **encryptpad@googlegroups.com** linked to [the public discussion group](https://groups.google.com/d/forum/encryptpad).
616
617Bug tracker and contributions: [github.com/evpo/EncryptPad/issues](https://github.com/evpo/EncryptPad/issues)
618
619For other matters, please contact Evgeny Pokhilko **software@evpo.net**
620
621[http://www.evpo.net/encryptpad](http://www.evpo.net/encryptpad)
622