PDA

View Full Version : How to store huge data in a Qt software



Momergil
24th March 2012, 04:05
Hello!

I'm developing a software that uses lots of images (hundreds) that are shown throughout the software as it's used. When it comes to acessing data, I know only two ways of doing it in Qt: using resources files and acessing the files direclty in folders sorrounding the executable. But the problem is that resource files don't allow me to add many images on them (for the time being, when I have something like 500+ images to show, I'm using something like 5 resource files to store them in an organized way) and I want the images to be IN the software, not in folders sorrounding it (let's say I don't want the images to be accessed apart from the software, but only by it).

So is there another way to store this data so only the software is able to find it and that is not by resource files?

I know that there is the SQL database, but as far as I know that would require a server where I would store the files and the software would download them each time it is used, or I could create a storage webpage and use Qt's network methods to download the files, but I don't want to make the software internet-dependent (it must me able to be accesible offline).


Thanks,


Momergil

Lykurg
24th March 2012, 08:52
Even if the images are combined the executable, one can access them using an hex editor. And storing 500 images inside the exe is a bad idea.

Als for the SQL database you can use SQLite which do not need any configuration and the driver is already build in. But also there you need a protection. For that you can encrypt the database with AES (see an older article of mine in our Wiki about that).
More simpler (and you shouldn't store images in a database) save the images encrypted in a normal folder using e.g. openssl.

But even then your data is not save because you have to store the key in your application and with a hexeditor one can find it. Or replace the Qt dll with prepared ones... But that need some knowledge and criminal energy.

Momergil
7th April 2012, 16:37
Well, I guess I don't have much choice then. I'ld give a look at openssl and see what I can do.

Thanks!

Momergil

marcvanriet
7th April 2012, 23:43
You could also store the images in a password protected ZIP file (or any other archive format).

QuaZIP (http://quazip.sourceforge.net/) can handle zip files, but I'm not sure about protected ones.

Regards,
Marc