Rui Xia
Rui Xia

Reputation: 175

javascript api plugin

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.

Upvotes: 0

Views: 141

Answers (1)

Sergio Cinos
Sergio Cinos

Reputation: 756

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.

Upvotes: 1

Related Questions