In response to your comment:
Unable to stop a specific user. If the user tries hard enough, you canโt do anything to prevent him from doing what the application can do on his machine. You can do this extremely difficult, but not impossible.
What are you afraid of what the user will do?
If you want it to be able to see some data, you can use database permissions or stored procedures, or replace the database with a web service.
If you do not want it to be able to copy data, there is no 100% solution.
You can photograph the assembly, but no obfuscator will be completely perfect.
You can add rows like if (Debugger.IsAttached) Environment.FailFast() , but the user can delete them using Reflexil .
You can use the hash of the assembly file as (part of) the encryption key, but the user can replace it with a hard-coded byte array using Reflexil.
If you replace the database with a web service, you can change the web service to detect suspicious requests, but the user can wait between requests and / or use different machines.
You can return images instead of data, but the user can use OCR.
In short, you can make it very complex and time consuming, but you cannot make it impossible.
source share