Vdrio.Security.Encryption
0.9.1
dotnet add package Vdrio.Security.Encryption --version 0.9.1
NuGet\Install-Package Vdrio.Security.Encryption -Version 0.9.1
<PackageReference Include="Vdrio.Security.Encryption" Version="0.9.1" />
<PackageVersion Include="Vdrio.Security.Encryption" Version="0.9.1" />
<PackageReference Include="Vdrio.Security.Encryption" />
paket add Vdrio.Security.Encryption --version 0.9.1
#r "nuget: Vdrio.Security.Encryption, 0.9.1"
#addin nuget:?package=Vdrio.Security.Encryption&version=0.9.1
#tool nuget:?package=Vdrio.Security.Encryption&version=0.9.1
Vdrio .NET Standard AES Encryption
Simplify your 256-bit AES Encryption for all your .NET projects
Table of contents
General info
I use AES Encryption in most of my projects and this makes it much easier to get going.
Setup
Once you have this installed and referenced in your project you just need to referece Vdrio.Security.Encryption in the files you wish to use it in. The previous version utilized a static AESEncryptor class. This static class still works and still contains some useful functions (see examples), but it is now recommended to use the EncryptionManager class to perform encryption and decryption. See examples for usage.
Code Examples
Encryption Examples:
//the secret info we are going to encrypt
string secretInfo = "mySuperSecretPassword";
string encryptedSecretInfo = null;
//this is your 64-bit key string
string myKeyString = AESEncryptor.CreateNewKey();
using (var manager = new EncryptionManager(myKeyString))
{
//This is your initializor, or public key
string iv = AESEncryptor.CreateInitializor();
//This is how you encrypt with your specified key and iv
encryptedSecretInfo = manager.Encrypt(secretInfo, iv);
}
//you can also encrypt with private keys of int a, b and c
using (var manager = new EncryptionManager(100,50,10))
{
//This is your initializor, or public key
string iv = AESEncryptor.CreateInitializor();
//This is your second public key, used with a, b, and c to compute the private key
long ticks = DateTime.Now.Ticks;
//This is how you encrypt with your specified key and iv
encryptedSecretInfo = manager.Encrypt(secretInfo, iv, ticks);
}
//Make sure you save your public and private keys so you can decrypt the data!
Decryption Example:
//When trying to decrypt your data, you will need your public key (iv) and optionally a second public key (time in ticks)
public static string DecryptMySecret(string encryptedData, string iv, long ticks)
{
//this is your 64-bit key string
string myKeyString = AESEncryptor.CreateNewKey();
string decryptedSecretInfo = null;
//create EncryptionManager with your key string
using (var manager = new EncryptionManager(myKeyString))
{
//This is how you decrypt with your keyString (private key) and iv (public key)
decryptedSecretInfo = manager.Decrypt(encryptedData, iv);
}
//you can also decrypt with private keys of int a, b and c
using (var manager = new EncryptionManager(100, 50, 10))
{
//This is how you decrypt with your specified keys, iv and ticks
decryptedSecretInfo = manager.Decrypt(encryptedData, iv, ticks);
}
return decryptedSecretInfo;
}
To-do list:
- Do more testing before official v1.0 release
Status
Project is: in progress
Contact
Created by @Vdrio - feel free to contact me!
Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Vdrio.Security.Encryption:
Package | Downloads |
---|---|
Vdrio.Security.Encryption.AzureTable
This library comes with a class EncryptedTableEntity. This class is the same as TableEntity, but understands the [EncryptedProperty] attribute that will encrypt the data for that property when it goes to Azure Table. Also, use the [EncryptionKey(a,b,c)] attribute on the class that inherits EncryptedTableEntity to set the encryption key. |
GitHub repositories
This package is not used by any popular GitHub repositories.