Net Encryption Library
Encrypting Files
Basic Tasks > Encrypting Files

Encrypting Files Overview

The .NET Encryption Library supports several Symmetric algorithms for encrypting and decrytping files.

 

 

C#
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
File.WriteAllText("input.txt", "This is a test");
 
encryption.EncryptFile(EncryptionProvider.Rijndael, "My Password", "input.txt", "encrypted.txt", false);
 
bool decryptedSucessfully = encryption.DecryptFile(EncryptionProvider.Rijndael, "My Password", "encrypted.txt", "decrypted.txt", false);
 
Console.WriteLine("Decrypted successfully: {0}", decryptedSucessfully);

VB.NET
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
File.WriteAllText("input.txt", "This is a test")
 
encryption.EncryptFile(EncryptionProvider.Rijndael, "My Password", "input.txt", "encrypted.txt", False)
 
Dim decryptedSucessfully As Boolean = encryption.DecryptFile(EncryptionProvider.Rijndael, "My Password", "encrypted.txt", "decrypted.txt", False)
 
Console.WriteLine("Decrypted successfully: {0}", decryptedSucessfully)