Unsolved Encrypt/Decrypt QImages
-
Hello,
I am wondering if there is a straight forward way to encrypt-decrypt QImage (read from a .jpg file for example). I am aware of CryptoCpp and CryptFileDevice but as I see they only support plain files. The only solution is to save/read images as files (i.e. text files)?
*I am not very familiar with cryptography concepts so please bear with me.
-
-
CryptoCpp may well contain code which works on in-memory data rather than file, I don't know.
-
CryptFileDevice is open source code so you could always rip out the in-memory encryption code if you don't want a file involved.
-
Something like https://doc.qt.io/qt-5/qcryptographichash.html is a Qt class for encrypting. It works (in-memory) against any
QByteArray
/data, so any arbitrary bytes. You can treat aQImage
as arbitrary bytes. But this does not allow you to decrypt, so probably not what you are looking for! -
https://wiki.qt.io/Simple_encryption_with_SimpleCrypt does Qt encrypt & decrypt, but does not claim to be "secure".
Other people may be able to recommend a "standard-ish" C++ library you might want to use.
-