Vdrio.Security.Encryption
0.6.0
See the version list below for details.
dotnet add package Vdrio.Security.Encryption --version 0.6.0
NuGet\Install-Package Vdrio.Security.Encryption -Version 0.6.0
<PackageReference Include="Vdrio.Security.Encryption" Version="0.6.0" />
<PackageVersion Include="Vdrio.Security.Encryption" Version="0.6.0" />
<PackageReference Include="Vdrio.Security.Encryption" />
paket add Vdrio.Security.Encryption --version 0.6.0
#r "nuget: Vdrio.Security.Encryption, 0.6.0"
#addin nuget:?package=Vdrio.Security.Encryption&version=0.6.0
#tool nuget:?package=Vdrio.Security.Encryption&version=0.6.0
Vdrio AES Encryption
Simplify your 256-bit AES Encryption with one static class and easy-to-use methods
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.
Code Examples
Initialization Example:
using Vdrio.Security.Encryption;
//Initialize with random 256-bit encryption key
AESEncryptor.Initialize();
//Gets the private key so you can save it for decryption later
string key = AESEncryptor.GetCurrentKey();
//Initialize with a known private key in the format of Base64 string
AESEncryptor.Initialize(keyString);
//Note: initialization will happen automatically when any method is called
Encryption Example:
//Secret string to Encrypt
string secretInfo = "mySuperSecretPassword";
//Create Initialization Vector (aka Public Key)
iv = AESEncryptor.CreateInitializor();
//Create new public key and keep reference
key = AESEncryptor.CreateNewKey();
//Encrypt secretInfo to Base 64 string. Encrypt can return Base 64 string or byte[] and has overloads to have byte[] or string inputs
encryptedSecretInfo = AESEncryptor.EncryptTo64String(secretInfo, iv);
Values in the above example:
key = "bvXeawD4xTVI9SmxjSXtBm8X/7hrdb0qdmQHXJO4cRc="
iv = "sVhK0HBOyrRTcRALzbxecg=="
encryptedSecretInfo = "rQN2NmmzqtL9uHx3p9Ajch28EOtYkmrjIbKp871kvuE="
Decryption Example:
//Encrypted string to Decrypt from previous example
encryptedSecretInfo = AESEncryptor.EncryptTo64String(secretInfo, iv);
//Set key to previous used key (only necessary when switching Private Keys)
AESEncryptor.SetKey(key);
//Decrypt info using the iv (public key) from previous example
string decryptedSecretInfo = AESEncryptor.Decrypt(encryptedSecretInfo, iv);
Values in the above example:
encryptedSecretInfo = "rQN2NmmzqtL9uHx3p9Ajch28EOtYkmrjIbKp871kvuE="
decryptedSecretInfo = "mySuperSecretPassword"
To-do list:
- Ability to store keys in encrypted file at specified location
- Non-static implementation to make it easier to use multiple private keys
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
- Microsoft.Azure.Cosmos.Table (>= 1.0.7)
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.