Reputation: 359
I have some proprietary formulas that is used to calculate some vehicle dynamic stuff. I have it all in a php file and the user gets access to this from ajax in the javascript on the client side.
I believe by doing this the user can never get access to the formulas in the php script, is this true (If I have the access setup correctly)?
The actual problem I have is, there are probably 80 equations and this is run in a loop 200 times to obtain the final answers and its cpu intensive. Running 1 is fine, but if I had 10 people using the site it will slow down the server.
I cant put all the formulas on the client side or else he can download them. And I cant put say 90% of the equations on the client side and leave the rest on the server because then I would have to go back and forward with ajax 200 times inside the loop just to obtain the answers once.
What are my options to get stuff done on the client side but protect the formulas?
Upvotes: 4
Views: 138
Reputation: 106589
You cannot run code on the client side without letting the client side see that code. You can obfuscate your code, but for something like mathematical equations I doubt there is going to be much in the way of obfuscation you can do that will obscure the content enough to prevent someone from figuring out what the equations are.
Your options are:
Upvotes: 2