Welcome, Guest

Author Topic: Protection of resource files  (Read 1755 times)


  • Posts: 4
    • View Profile
Protection of resource files
« on: March 02, 2014, 01:49:33 PM »

Is there a way to protect the resource files (html, js, etc.) on the client?
We are planning to implement mini-games and without a protection everything could be easily manipulated.

An easy solution would be an Coherent::UI::UISystem::CreateView with an additional parameter for an encrypted container.
If this container is specified, Coherent uses it as virtual file system and reads all resources from it.



  • Administrator
  • *****
  • Posts: 475
    • View Profile
Re: Protection of resource files
« Reply #1 on: March 03, 2014, 05:23:05 AM »
Hey Manuel,

You can implement your own Coherent::UI::FileHandler that is passed to the InitializeUISystem function. When using a coui:// URL, every resource request passes through the FileHandler::ReadFile method. This way you can encrypt your files any way you like when deploying, and decrypt them the ReadFile function.

We have a sample for the custom file handler that just reads files from a .zip archive. An easy extension to that would be to password protect the archive and supply it in the reading function.

By the way, we're currently doing some changes for allowing user-specified protocols, per-view file handlers and others, so if you have any suggestion how the API can be made more flexible we're open to hear them  :)
R&D Director @CoherentLabs