What is a good way to run a time-consuming function from a C# webpage on the users CPU instead of running it on the web-server? Is it possible to get a C# function to run locally or do I have to write the function in JavaScript? The function itself is not secret in any way but I would prefer if the input and the output will be kept secret from the user. The solution should not require the user to download anything.
This functions uses data from the database + user input and when it’s finished it writes the output to the database.
The functions best case is ~1s, average ~30s and worst ~10min (for every user) so it’s not an option to run this function on the web-server.
You can get this to work, by either
You won’t really be able to keep the data totally secret, though.
Now, how to go about this… You will need a web service to provide the data to your silverlight component and another one to accept the computed results. You know, I don’t really see why everyone else here thinks this is such a no-go…
As for data secrecy… The best you can do is obfuscate, though you should use a secure communication layer for aquiring the data and posting the results back, what ends up on the users computer will eventually be open for inspection by the user. If you use obfuscation techniques for your code, this will make reverse engineering an encryption/decryption scheme for the data payload harder, but you’re playing essentially the same game as game devs / game crackers…
Personally, I would code the client side stuff in JavaScript. Chances are, what you want done is more of an algorithmic thing than a library thing, so porting to js should not be difficult to pull off.