0

I am writing a game in cocos2d width javaScript.

All my gameCode will be in JS for cross-platform reasons, and I need to know if I can protect my code and content from sneaky eyes..

I have to encrypt the code in cocos2D-iPhone, cocos2D-x and cocos2D-HTML to stay safe..

What is the best way?

It will also be appreciated if you can tell me how to use the Content Protection in TexturePacker with javaScript: change the ZipUtils.js file to decode the texture.

  • Depending on what you are protecting, just minifying the code might work pretty well. If you are storing sensitive information it's not good enough, but if you are just keeping someone from copying your game, it might be good enough. – Reason Apr 24 '13 at 11:25
  • Anyone can use the code if it is just minified, and you can reverse it.. What I need is encryption.. encode the code and on runtime decode it.. – Jóhann Forberg Apr 24 '13 at 11:33
  • 1
    Yes, you can reverse it, but reversed minified code (no useful variable names, no comments) is pretty painful to work with. Possibly painful enough to make people lose interest in stealing your code. Still, you are right, of course it's not real security. – Reason Apr 24 '13 at 11:42
  • I see your point, but what about content protection? textures and audio? – Jóhann Forberg Apr 24 '13 at 12:25

1 Answers1

0

You can protect your javascript code by obfuscating the code.

Maybe here is what you are looking for

Community
  • 1
  • 1
Ganesh Somani
  • 2,280
  • 2
  • 28
  • 37