Encrypt and Decrypt a file in C#.Net

InfoPath alternatives for form designing SharePoint

In this post we will discuss about how we can encrypt or decrypt a file in C#.Net. You can also check my previous posts on CLR in C#.Net, Exception handling in C#.Net and Concurrent Collections in .NET 4.0.

Encrypt will not allow other user to open and read the file.

To work with files and directory, Microsoft provides System.IO namespace. Here we will use the inbuilt File class to encrypt or decrypt the file.

Encrypt File:

string fileToEncrypt = @”C:\AspDotNetHelp”;

Decrypt File:

string fileToEncrypt = @”C:\AspDotNetHelp”;

You can also check my previous article on how to delete a file in C#.Net.

Similar SharePoint 2013 Tutorials

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply