martinrotter / textosaurus

Cross-platform text editor based on Qt and Scintilla.
GNU General Public License v3.0
284 stars 44 forks source link

Use OpenSSL for encryption if installed #59

Closed martinrotter closed 5 years ago

martinrotter commented 5 years ago

https://www.shellhacks.com/encrypt-decrypt-file-password-openssl/

It is easy to encrypt data with opensssl: echo "data" | openssl enc -aes-256-cbc -salt -k "password" and decrypt it: echo "encrypted data" | openssl enc -aes-256-cbc -salt -d -k "password".

Luckily, openssl returns non-zero return code if password is not correct.

Or we can use the library directly instead of calling external openssl executable.

https://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption

martinrotter commented 5 years ago

I upgrade my Qt build to OpenSSL 1.1 branch.