0

basically, I want to generate a unique html page to my client through a javascript plugin(code). the question is how I could prevent someone from putting this javascript code into other websites and generate the page supposed to be unique to my client.

I wonder is it possible to have such prevention. I am very new to this area and will appreciate any ideas or reading suggestions.

Rui Xia
  • 175
  • 4
  • 20
  • What exactly will make the page unique? Anyway I'll jump ahead and say it's a 95% chance that it isn't possible. – Ricardo Tomasi Dec 12 '11 at 05:57
  • @RicardoTomasi My plan was to give the client a unique key to put along with the javascript. However, that becomes a part of javascript and everyone can copy it. – Rui Xia Dec 12 '11 at 06:01
  • Duplicate http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript – Fraser Dec 12 '11 at 06:16

1 Answers1

1

It is not possible.

You can pass the key in multiple chunks, you can code a pretty hard and complex algorithm for key validation, you may pack and obfuscate the code, or apply any other crazy trick to hide the key or the code.

But at the end, anyone can access the JavaScript plain code, as it must be executed by the browser in plain format and the browser is under user control. So anyone with enough time and/or skills will be able to extract your key, no matter how many obfuscation techniques you used. Also, it will be possible to hack your code so a key will not be needed anymore.

Sergio Cinos
  • 746
  • 6
  • 13