Reader Level:
Articles

Decrypt a File in C#

By Dinesh Beniwal on August 16, 2012
In this article we will discuss about how to Decrypt a File in C#.
  • 0
  • 0
  • 6471

The File class provides the Encrypt and the Decrypt methods to restrict other users to open and read a file. 

Encrypt a File in C#

The Encrypt method encrypts a file so that only the account used to encrypt the file can decrypt it.

string fileName = @"c:\temp\Mahesh.txt";
File
.Encrypt(fileName);

Decrypt a File in C#

The Decrypt method decrypts an encrypted file. Only account that has encrypted a file can decrypt a file.

string fileName = @"c:\temp\Mahesh.txt";
File
.Decrypt(fileName);

Dinesh Beniwal

I am working as VP Content Manager, responsible for content publishing, content development, and social relations. You can follow me on twitter @dbeniwal21

COMMENT USING

Trending up