Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > c18ee9bd72eeb0aba0917f7f57195cba > files > 24

encryptpad-docs-0.4.0.4-5.mga7.noarch.rpm

<h1>Open a plain text file, protect it with both a key file and passphrase then save it as an EPD file</h1>

<h2>Open a plain text file</h2>

<p>1. Click the Open File tool button</p>

<p><img src="images/open_text_file.png" alt="Open File tool button" /></p>

<p>2. Select Plain Text file type and click Save button</p>

<p><img src="images/open_file_dialog_text_file.png" alt="Plain Text file type" /></p>

<p>3. The plain text file opened</p>

<p><img src="images/text_file_opened.png" alt="Text file opened" /></p>

<p>Now EncryptPad is in unprotected plain text mode. It works as an ordinary text editor.</p>

<p><img src="images/unprotected_status.png" alt="Unprotected mode" /></p>

<h2>Generate a new key file</h2>

<p>4. Click the Generate Key tool button.</p>

<p><img src="images/generate_key_tool_button.png" alt="Generate Key tool button" /></p>

<p>5. Select the Key In Repository radio button and enter <code>my_new_key</code> in the corresponding text box and click OK.</p>

<p><img src="images/generate_key_dialog.png" alt="Generate Key dialogue" /></p>

<p>6. You will be asked to enter a passphrase to protect the key file on the disk.</p>

<p><img src="images/set_passphrase_for_key.png" alt="Key File passphrase" /></p>

<p>Enter <code>KeyPwd</code></p>

<p>7. Click Yes to use the new key file to encrypt our text.</p>

<p><img src="images/use_new_key_dialog.png" alt="Use new key dialogue" /></p>

<p>8. You can look at the key file in your user profile directory under <code>_encryptpad</code></p>

<p><img src="images/key_in_explorer.png" alt="Key in Windows Explorer" /></p>

<p>Here is the content of the file (it will be different for you as the key is random):<br/></p>

<p><code>91Oamyib4o+Tbry/4NzoFOWhWpIfQE0TyMHiYtnOK9w=</code></p>

<p>This is a random sequence in Base64, from which the encryption key is derived.</p>

<h2>Protect with the key file and save as a GPG file</h2>

<p>9. Click the Save As tool button.</p>

<p><img src="images/save_as_tool_button.png" alt="Save As tool button" /></p>

<p>10. Select EncryptPad (*.epd) file type and click Save button</p>

<p><img src="images/select_epd_in_save_as.png" alt="Save As dialogue" /></p>

<p>Please note that the file name has changed to <code>war and peace.epd</code> in the Save As dialogue.</p>

<p>11. You will be asked to enter a passphrase twice. Enter <code>DemoPwd</code> for this example and click OK.</p>

<p><img src="images/set_passphrase.png" alt="Set passphrase" /></p>

<p>Note that if you leave the passphrase blank and click OK, the file will be only protected with the key file and you will not have the double protection.</p>

<p>12. Now the file has been saved on the disk and it is encrypted with the generated key file and then the passphrase. See the status in the picture below.</p>

<p><img src="images/double_protection_status.png" alt="GPG file saved" /></p>

<h2>Persist the key file location in the encrypted file</h2>

<p>Now if you clear protection, close the file and open it again, you will be asked for both the passphrase and key file. It may be cumbersome to enter the path to the key file every time, especially if it is not in the repository. To make it easier you can enable <code>Persist key location in encrypted file</code> (this feature is only supported in the EPD file type).</p>

<p>13. Click Set Key tool button.</p>

<p><img src="images/set_key_tool_button.png" alt="Set Key tool button" /></p>

<p>14. Enable <code>Persist key location in encrypted file</code> in the Set Key dialogue and click OK.</p>

<p><img src="images/enable_persist_key.png" alt="Enable Persist Key" /></p>

<p>15. The status bar has changed (see the picture below).</p>

<p><img src="images/persisted_in_status_bar.png" alt="Persisted in status bar" /></p>

<p>If you clear protection and open this file again, you will not be asked for the key file location as it is persisted in the encrypted file itself. It is also hidden from unwanted view because the location is encrypted with the passphrase.</p>

<p>16. Click the Save tool button to save the file.</p>

<h2>Open another plain text file</h2>

<p>If you try to open a plain text file now, it will fail with the following message.</p>

<p><img src="images/open_another_plain_text.png" alt="Cannot open plain text" /></p>

<p>EncryptPad &ldquo;thinks&rdquo; that the file is encrypted with a passphrase and key file because its mode is <code>Key protected</code> and <code>passphrase protected</code> as you can see in the status bar. It tried to decrypt the plain text and failed. To proceed with opening the file, clear passphrase and key protection by clicking the Clear Key and Clear passphrase tool buttons or even better click Close and Reset. The latter will close the text file and reset both parts of the protection.</p>

<p><img src="images/clear_key_and_pwd_or_close_and_reset.png" alt="Clear Key or Close and Reset" /></p>

<p>Now you can open your plain text file.</p>

<h2>The internals of the EPD file</h2>

<p>The EPD file is an OpenPGP file containing a <a href="https://en.wikipedia.org/wiki/Doom_WAD">WAD</a> file, which contains another OpenPGP file. There is three levels of nesting. To demonstrate, we can extract the encrypted text without using EncryptPad.</p>

<p>17. Rename the file from <code>war and peace.epd</code> to <code>war and peace.gpg</code>.</p>

<p>18. Decrypt the file with <a href="https://www.gpg4win.org/">Gpg4Win</a>. Use <code>DemoPwd</code> as a passphrase.</p>

<p><img src="images/kleopatra_decrypted.png" alt="Kleopatra decrypted our file" /></p>

<p>19. Rename the file produced by Kleopatra from <code>war and peace</code> to <code>war_and_peace.wad</code>.</p>

<p>20. You need to get a tool for working with WAD files for the next step. I recommend <a href="https://github.com/sirjuddington/SLADE">Slade</a>.</p>

<p>21. Extract the content of the wad file with Slade. See the window below for details.</p>

<p><img src="images/slade_window.png" alt="Slade Window" /></p>

<p>Note that the <code>__X2_KEY</code> file contains the name of our key file <code>my_new_key.key</code>. <code>_PAYLOAD</code> is the OpenPGP file encrypted with the key file.</p>

<p>22. Save <code>_PAYLOAD</code> to the disk. Click Entry->Export and save the file as <strong>war and peace.gpg</strong>. Overwrite the existing file we used at previous steps.</p>

<p><img src="images/slade_export.png" alt="Slade Export" /></p>

<p>23. Decrypt the key file <code>my_new_key.key</code> with <a href="https://www.gpg4win.org/">Gpg4Win</a>. Use <code>KeyPwd</code> as a passphrase.</p>

<p>24. Now that we have the unencrypted key file, decrypt the file from step 22 with <a href="https://www.gpg4win.org/">Gpg4Win</a>. Use the content of the key file from step 23 as a passphrase.</p>

<p><img src="images/kleopatra_decrypted.png" alt="Kleopatra decrypted our file" /></p>

<p>25. The result of this decryption will be your original plain text file.</p>