Decrypt file before loading
-
Well I didn't expect it was going to be a 'hard' task, the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
wrote on 14 Nov 2022, 21:23 last edited by@Roberrt said in Decrypt file before loading:
Well I didn't expect it was going to be a 'hard' task, the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
Well AFAIK unless you are using a commercial license of Qt, every modification of Qt source you make must be made available to other users - including your encryption modification. If that is the case you win nothing and your customers may easily decrypt the resources...but I guess it will be a lot easier for them to just make screenshots and edit those.
-
@JoeCFD
So try it using memory instead of external file.Goodness knows what you guys are trying to encrypt to hide from the user, an image that you're presumably going to show anyway. You would be talking about a symmetric encryption/decryption algorithm, right? So between that, and whether it be Qt's code or your code both likely to be publicly visible, isn't it likely that a user who wants to see the image file decrypted could do so anyway?
-
wrote on 14 Nov 2022, 22:17 last edited by
@JoeCFD QImage::loadFromData() with a byte array.
-
@JoeCFD QImage::loadFromData() with a byte array.
wrote on 14 Nov 2022, 22:25 last edited by@DerReisende said in Decrypt file before loading:
QImage::loadFromData()
Thanks. Then it is doable for images. How about videos?
-
Well I didn't expect it was going to be a 'hard' task, the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
@Roberrt said in Decrypt file before loading:
the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
One can do a simple screen shot of running app and cut all the icons, personal art, logo. Don't see how encryption can help here...
-
Well I didn't expect it was going to be a 'hard' task, the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
wrote on 15 Nov 2022, 07:04 last edited by@Roberrt said in Decrypt file before loading:
Well I didn't expect it was going to be a 'hard' task, the reason to encrypt is to avoid easily copy of icons, personal art, logo, etc
For my money, using the Qt resource system is going to achieve this goal. There is no on-disk file to copy. Anyone savvy enough, and with enough motivation, to find and decompress the image data embedded in your executable or DLL is probably going to be able to subvert this several ways.
@DerReisende 's suggestion is a good one if it is only images involved. This has the benefit of working anywhere the encrypted image is used.
A QImageIOPlugin should be quite quick to produce. The plugin
create()
method would have to create your QImageIOHandler subclass for *.enc images and ensure it gets a decryption key if one is needed.
The QImageIOHandler may be more involved but could be as simple as theread()
method loading the target QIODevice data into a QByteArray, decrypting/de-obfuscating in-place, calling QImage::loadFromData(), and destroying the interim QByteArray. -
@DerReisende said in Decrypt file before loading:
QImage::loadFromData()
Thanks. Then it is doable for images. How about videos?
wrote on 15 Nov 2022, 08:58 last edited by
21/27