Vijay Kumbhar
Vijay Kumbhar

Reputation: 916

.net WPF application create a secure folder

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

Upvotes: 0

Views: 1252

Answers (3)

7ok3n
7ok3n

Reputation: 66

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:

Upvotes: 3

Dan
Dan

Reputation: 9837

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.

Upvotes: 1

StackTrace
StackTrace

Reputation: 9416

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.

Upvotes: 1

Related Questions