evpo / EncryptPad

Minimalist secure text editor and binary encryptor that implements RFC 4880 Open PGP format: symmetrically encrypted, compressed and integrity protected. The editor can protect files with passwords, key files or both.
https://evpo.net/encryptpad
Other
433 stars 64 forks source link

Crash on save #132

Closed sergeevabc closed 9 months ago

sergeevabc commented 9 months ago

Windows 7 x64, EncryptPad 0.5.0.2 x86

evpo commented 9 months ago

Hi, I've seen a similar problem before. What's your hardware? You can also enable logging. Run encryptpad.exe --help in cmd to see how.

sergeevabc commented 9 months ago

Intel Core 2 Duo T7250 @ 2.00 GHz, 4 GB DDR2 RAM

$ encryptpad --log-file enclog.txt --log-severity verbose
$ type enclog.txt
INFO  [19476] [qMain@162] Log instance started
INFO  [19476] [MainWindow::saveAs@585] selectedFilter:
INFO  [19476] [MainWindow::saveAs@596] selection.file_name: C:/EncryptPad/abc.epd
INFO  [19476] [MainWindow::saveAs@597] selection.filter: EncryptPad (*.epd)
evpo commented 9 months ago

Most likely it crashes when accessing the encryption library Botan right after you entered the passphrase. The processor does not support sse4 instruction set and the botan library is built with the switches enabling sse4 -msse4.1-msse4.2.

There was another user with similar problem and I narrowed it down to the CPU. I don't have a CPU handy to test this problem.

There is emulator for older CPUs apparently that some gaming sites recommend. You can have a look:

https://www.intel.com/content/www/us/en/developer/articles/tool/software-development-emulator.html

It was recommended for running new games on older CPUs.

That said the proper solution would be to recompile EncryptPad without the SSE4 switch. Compiling EncryptPad on Windows is not trivial but there is an article (https://evpo.net/encryptpad/#compile-on-windows). Older versions of EncryptPad did not use Botan with SSE4. They should work theoretically.

evpo commented 9 months ago

Another link describes how to use the intel emulator: https://steamcommunity.com/sharedfiles/filedetails/?id=2362590754

sergeevabc commented 9 months ago

Intel's website is currently not available to users from Russia, but the fact that a small encryption utility of yours suddenly requires an emulator to run properly disturbs me.

You see, @evpo, nowadays ordinary people also tend to have sensitive information, not just the celestial ones and the golden billion with a bleeding-edge hardware. Thus, cryptography is no longer a luxury, but a necessity. Accordingly, cryptoapps should be widely accessible, i.e. work with almost any hardware -- the very goal to have in mind in the first place, while designing such an app. In particular, the developers of GPG, Veracrypt, Keepass, Cryptomator, DNSCrypt, Restic, etc follow this guideline, their apps work safe and sound for years.

In case anyone is stuck in a similar situation, there are some alternatives. For example, Safenotes.

evpo commented 9 months ago

As time allows, I will try to compile Botan with disabled SSE4 for users like yourself. In fact I am working on a new release and if everything goes well, I may be able to disable SSE4 requirement in the new release.

evpo commented 9 months ago

The new release is available: https://github.com/evpo/EncryptPad/releases/tag/v0.5.0.3

I disabled the sse4 components of the Botan library but I don't have the hardware to test handy. Let me know if it's fixed.

sergeevabc commented 9 months ago

I confirm that 0.5.0.3 has this issue fixed, no crash on my end.