EasyEncrypt 1.0.1

Library that makes encrypting strings, byte arrays and files easy. Supports Aes, TripleDES, (.net framework only) Des, RC2 and Rijndael.

There is a newer version of this package available.
See the version list below for details.
Install-Package EasyEncrypt -Version 1.0.1
dotnet add package EasyEncrypt --version 1.0.1
<PackageReference Include="EasyEncrypt" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyEncrypt --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Welcome to the EasyEncrypt documentation!

First download the nuget package and import the namespace "EasyEncrypt".

Examples of encrypting/decrypting a string or byte[]

Example of encrypting a string with Aes encryption:

string EncryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Encrypt(INPUT);
string EncryptedString = new Encryption(Aes.Create(), KEYSIZE, PASSWORD, SALT).Encrypt(INPUT);

//Don't work with a byte[]
string EncryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Encrypt(INPUT, Encoding.Unicode);

Example of decrypting a string with Aes encryption:

string DecryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT);
string DecryptedString = new Encryption(Aes.Create(), KEYSIZE, PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT);

//Don't work with a byte[]
string DecryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT,Encoding.Unicode);

Example of doing this with the other algorithms:

EncryptedString = new Encryption(TripleDES.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(TripleDES.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(DES.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(DES.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(RC2.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(RC2.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(Rijndael.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(Rijndael.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

Encrypting with an already configured algorithm:

SymmetricAlgorithm Algorithm = Aes.Create();
Algorithm.Key = Encryption.CreateKey(Algorithm,PASSWORD,SALT);
Encryption EasyEncryption = new Encryption(Algorithm);

EncryptedString = EasyEncryption.Encrypt(INPUT);
DecryptedString = EasyEncryption.Decrypt(ENCRYPTEDINPUT);

Encrypting with an already created key:

Encryption EasyEncryption = new Encryption(Aes.Create(), Encryption.CreateKey(KEYSIZE, PASSWORD, SALT));
Encryption EasyEncryption = new Encryption(Aes.Create(), Encryption.CreateKey(ALGORITHM, PASSWORD, SALT));

File encryption.

The fileEncryption class constructors are the same as the constructors for the Encryption class.

Example of encrypting decrypting a file:

FileEncryption EaseEncryption = new FileEncryption(Aes.Create(),PASSWORD,SALT);
EaseEncryption.Encrypt(INPUTFILE1,OUTPUTFILE1);
EaseEncryption.Encrypt(INPUTFILE2, OUTPUTFILE2);

INPUTFILE1 is the location of the file to encrypt.
OUTPUTFILE1 is the location where to save the encrypted file.

INPUTFILE2 is the location of the encrypted file.
OUTPUTFILE2 is the location where to save the decrypted file.

Overloads of all functions

Overloads of the constructor:

Encryption(SymmetricAlgorithm Algorithm)
Encryption(SymmetricAlgorithm Algorithm, byte[] Key)
Encryption(SymmetricAlgorithm Algorithm, string Password, string Salt, int Iterations = 10000)
Encryption(SymmetricAlgorithm Algorithm, int KeySize, string Password, string Salt, int Iterations = 10000)

Overloads of the CreateKey method(NOTE, THIS METHOD IS STATIC):

static byte[] CreateKey(int KeySize, string Password, string Salt, int Iterations = 10000)
static byte[] CreateKey(SymmetricAlgorithm Algorithm, string Password, string Salt, int Iterations = 10000)

Overloads of the Encryption class:

string Encrypt(string Text)
string Encrypt(string Text, Encoding Encoder)
byte[] Encrypt(byte[] Data)

string Decrypt(string Text)
string Decrypt(string Text, Encoding Encoder)
byte[] Decrypt(byte[] Data)

Overloads of the FileEncryption class:

Encrypt(string InputFile, string OutputFile, int BufferSize = 1048576)
Decrypt(string InputFile, string OutputFile, int BufferSize = 1048576)

Welcome to the EasyEncrypt documentation!

First download the nuget package and import the namespace "EasyEncrypt".

Examples of encrypting/decrypting a string or byte[]

Example of encrypting a string with Aes encryption:

string EncryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Encrypt(INPUT);
string EncryptedString = new Encryption(Aes.Create(), KEYSIZE, PASSWORD, SALT).Encrypt(INPUT);

//Don't work with a byte[]
string EncryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Encrypt(INPUT, Encoding.Unicode);

Example of decrypting a string with Aes encryption:

string DecryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT);
string DecryptedString = new Encryption(Aes.Create(), KEYSIZE, PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT);

//Don't work with a byte[]
string DecryptedString = new Encryption(Aes.Create(), PASSWORD, SALT).Decrypt(ENCRYPTED_INPUT,Encoding.Unicode);

Example of doing this with the other algorithms:

EncryptedString = new Encryption(TripleDES.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(TripleDES.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(DES.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(DES.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(RC2.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(RC2.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

EncryptedString = new Encryption(Rijndael.Create(), PASSWORD, SALT).Encrypt(INPUT);
DecryptedString = new Encryption(Rijndael.Create(), PASSWORD, SALT).Decrypt(ENCRYPTEDINPUT);

Encrypting with an already configured algorithm:

SymmetricAlgorithm Algorithm = Aes.Create();
Algorithm.Key = Encryption.CreateKey(Algorithm,PASSWORD,SALT);
Encryption EasyEncryption = new Encryption(Algorithm);

EncryptedString = EasyEncryption.Encrypt(INPUT);
DecryptedString = EasyEncryption.Decrypt(ENCRYPTEDINPUT);

Encrypting with an already created key:

Encryption EasyEncryption = new Encryption(Aes.Create(), Encryption.CreateKey(KEYSIZE, PASSWORD, SALT));
Encryption EasyEncryption = new Encryption(Aes.Create(), Encryption.CreateKey(ALGORITHM, PASSWORD, SALT));

File encryption.

The fileEncryption class constructors are the same as the constructors for the Encryption class.

Example of encrypting decrypting a file:

FileEncryption EaseEncryption = new FileEncryption(Aes.Create(),PASSWORD,SALT);
EaseEncryption.Encrypt(INPUTFILE1,OUTPUTFILE1);
EaseEncryption.Encrypt(INPUTFILE2, OUTPUTFILE2);

INPUTFILE1 is the location of the file to encrypt.
OUTPUTFILE1 is the location where to save the encrypted file.

INPUTFILE2 is the location of the encrypted file.
OUTPUTFILE2 is the location where to save the decrypted file.

Overloads of all functions

Overloads of the constructor:

Encryption(SymmetricAlgorithm Algorithm)
Encryption(SymmetricAlgorithm Algorithm, byte[] Key)
Encryption(SymmetricAlgorithm Algorithm, string Password, string Salt, int Iterations = 10000)
Encryption(SymmetricAlgorithm Algorithm, int KeySize, string Password, string Salt, int Iterations = 10000)

Overloads of the CreateKey method(NOTE, THIS METHOD IS STATIC):

static byte[] CreateKey(int KeySize, string Password, string Salt, int Iterations = 10000)
static byte[] CreateKey(SymmetricAlgorithm Algorithm, string Password, string Salt, int Iterations = 10000)

Overloads of the Encryption class:

string Encrypt(string Text)
string Encrypt(string Text, Encoding Encoder)
byte[] Encrypt(byte[] Data)

string Decrypt(string Text)
string Decrypt(string Text, Encoding Encoder)
byte[] Decrypt(byte[] Data)

Overloads of the FileEncryption class:

Encrypt(string InputFile, string OutputFile, int BufferSize = 1048576)
Decrypt(string InputFile, string OutputFile, int BufferSize = 1048576)

  • .NETCoreApp 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3.2 75 5/24/2019
1.0.3.1 109 4/11/2019
1.0.3 93 3/27/2019
1.0.2 106 2/16/2019
1.0.1.3 91 2/15/2019
1.0.1.2 95 2/15/2019
1.0.1.1 87 2/14/2019
1.0.1 100 2/12/2019
Show less