EasyEncrypt 1.0.3

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package EasyEncrypt --version 1.0.3
NuGet\Install-Package EasyEncrypt -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyEncrypt" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyEncrypt --version 1.0.3
#r "nuget: EasyEncrypt, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EasyEncrypt as a Cake Addin
#addin nuget:?package=EasyEncrypt&version=1.0.3

// Install EasyEncrypt as a Cake Tool
#tool nuget:?package=EasyEncrypt&version=1.0.3

Welcome to the EasyEncrypt wiki!

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

Getting started

Example of encrypting a string or byte[] with Aes encryption:

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

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

PASSWORD is the password used to create the key.

SALT is used for making the generated key more random.

KEYSIZE is the size of the key in bits. Example 1 takes the keysize from the algorithm. In example 3 we using Unicode for decoding the string instead of UTF8(Default).

Example of decrypting a string or byte[] with Aes encryption:

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

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

When decrypting the PASSWORD, SALT and KEYSIZE need to be the same for generating the same key.

More advanced

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));

Example of encrypting/decrypting with the other algorithms:

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

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

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

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

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(ENCRYPTED_INPUT);

File encryption.

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

Example of encrypting decrypting a file:

FileEncryption EasyEncryption = new FileEncryption(Aes.Create(),PASSWORD,SALT);
EasyEncryption.Encrypt(INPUTFILE1,OUTPUTFILE1);
EasyEncryption.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 functions:

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)

byte[] GetKey()

Overloads of the FileEncryption functions:

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

byte[] GetKey()
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EasyEncrypt:

Package Downloads
FastPushClient.NET

FastLivePush Server SDK for C#

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated

- Added GetKey()
Wich returns the current encryption key.