blah blah blah is here! blah blah » Close

up0down
link

salam guyz

i just made an application which generate a file for me, ok now i want to encrypt that file so when ever someone trys to reead it's contents so he/she should cant (because of security) now can any body help me!!!!

if u help me i will be very happy thanks.

last answered one year ago

1 answers

up0down
link

There are several ways to encrypt a file in .NET and which one you choose depends on how secure you want the encryption to be and how quickly you need the algorithm to work.

One of the easier ways is to use 'Windows Data Protection' (wrapped by the ProtectedData class in the .NET Framework) which works quickly and is moderately secure.

Check out this thread for some example code.

khesrow
45

how about md5 algorithm or S/MIME protocol??

vulpes
17279

Well, MD5 is a one-way encyption algorithm used for hashing (checksums etc) and so you wouldn't be able to decrypt the file after you'd encrypted it. S/MIME is a two-way system for e-mail etc. which uses public key encryption but, to my knowledge, it's not supported in the .NET framework. However, the framework does support Rijndael (same key) and RSA (public key) for two-way encryption.

Feedback