Is it possible to send javascript code to a client, and have it send back information to a server, without the user being able to intercept it, see it, or alter it. As far as I know this is not possible, but I am unsure about certain realtime protocols like socket/ajax. Could somebody intercept a web socket?
If this is not possible, is there a clever solution to verify that the code was not altered, or at least make it more difficult for the code to be altered? Perhaps Dom Mutation-Events? What about obfuscating certain sensitive parts of the code/data?
ie: How does Google Analytics know that a given user has not created false data?