Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Had a quick look around in CodeProject but couldn't find what I was after.

Windows, .Net Winforms, encryption.

I am familiar with encrypting and decrypting data and files, the different levels and types of encryption and I've code to do it. Not a problem.

The last place I worked at, all the encryption assemblies were internal to the company really and the assemblies were obfuscated with string encryption.

I'm developing a Winforms application in a new company I'm working for. I want to encrypt and decrypt a file, in an application that will be sold to many clients.

So the difference now is that both private and public keys will be embedded in the Winforms application or another assembly on the client computer to handle the encrypted file.

Is there a best practice for this scenario where you want to store and encrypt some data in a file on someone's computer?

My thought is to obfuscate and string encrypt any assemblies, hiding as best as possible the private key. The data isn't highly confidential, but it would be good to say that the file is encrypted.

Any thoughts on the matter would be greatly appreciated. Or any pointers to discussions on the subject.

Thanks

Julian

What I have tried:

Searching the net
Searching CodeProject
Posted
Updated 15-Mar-18 7:08am

This CodeProject article describes how to do your own obfuscation, it is in C though, but maybe you will find the utilities useful: Binary Obfuscation[^]

You might also find the SecureString class interesting: SecureString Class (System.Security)[^]
 
Share this answer
 
v2
Comments
jugs0101 15-Mar-18 11:54am    
Thanks for the SecureString pointer Rick, I'll look into using that and yes I'll be obfuscating using a third party product.

So do you think this is the right way to go when doing this?

Julian
RickZeeland 15-Mar-18 12:35pm    
Can't say if this is the right way, at work we just use Dotfuscator, but that can be a hassle too as we use reflection a lot, and Dotfuscator and reflection don't go together well so we have to exclude parts of the application from obfuscation.
I would say that a password protected zip / compressed file is the simplest (secure) option.

You can compress / decompress in memory.
 
Share this answer
 
I used a combination of of both answers. I am encrypting the file with .Net encryption and then string encrypting and obfuscating the assemblies. I am also using the ZIP option to back up the file. The data I am storing is not super sensitive, if it was I would be doing something different.

Julian
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900