0

I am working on one desktop application which is built by using .net WPF. I have some data inside the application like images,videos..

I want to make this folder secure, so nobody can access the data inside the folder after application installation. Only the application can read the data from that directory.

Even though administrator of that machine can not open that folder to check the content.

Is it possible to have this kind of security inside the WPF application.

Only motive it to keep the sensitive data protected from external copy from the application users.

Thanks, Vijay

Vijay Kumbhar
  • 896
  • 1
  • 13
  • 31
  • The application is given the rights the user running it has, and the administrator will trump everything. What problem are you trying to solve here? 'Protecting' your IP? – Andrew Barber May 24 '13 at 06:46
  • Thanks for the prompt response ....My client has this specific requirement to protect the data from external copying. So nobody can copy the data & misuse it. Its an enterprise level application. – Vijay Kumbhar May 24 '13 at 06:49
  • This is not a WPF issue at all. This is all about Windows security. An administrator will ALWAYS be able to get access. If he could not, he would not be an administrator. – Emond May 24 '13 at 06:49
  • I understand that, apart from admin any other user can not be able to copy data from the application directory.. can we achieve this? – Vijay Kumbhar May 24 '13 at 06:50
  • If a user can not "copy" the data, he can not use it, if he can not use it, why have it there in the first place? Anything that can be used, can be copied. – Emond May 24 '13 at 06:59
  • possible duplicate of [.net WPF application folder security](http://stackoverflow.com/questions/16729936/net-wpf-application-folder-security) – Emond May 24 '13 at 07:59

3 Answers3

3

It depends on how you use the resources. Actually you could encrypt all "protected" files, so that after the installation every one can copy but no one can use them unless your application decrypts the files. When you encrypt files you should definitively test the performance (decryption takes some time).

Two links showing how you could do it:

Community
  • 1
  • 1
7ok3n
  • 66
  • 3
1

Add the file you would like to strongly protect to you solution. Then right click each file, go to properties and set its "build action" to "embedded resource".

And for how to access the resource stream from within the exe for use with in your application, see link below

How to compile all files to one exe?

That way, your private files will not be copied to the installation folder but will instead reside inside your .exe file.

Community
  • 1
  • 1
StackTrace
  • 9,190
  • 36
  • 114
  • 202
  • 1
    This is security by obscurity at the most. – Emond May 24 '13 at 06:58
  • There are some files that are created by the users, like proposals pdf, xps file which are created after all the calculations.. These files also needs to be protected. So can we do this too... – Vijay Kumbhar May 24 '13 at 07:05
1

WPF is beside the point. Applications run with the permissions of the users that start them. If an application needs access to files, then the user will also need rights to those files.

In short, the answer is no, you cannot do exactly what you are asking.

The best you will be able to do is make it hard for a user to discover where the assets are coming from, but you will never be able to give access to your application without giving access to the application's user.

Dan
  • 9,717
  • 4
  • 47
  • 65