VOOZH about

URL: https://www.nuget.org/packages/Aoxe.Cryptography.Abstractions/

⇱ NuGet Gallery | Aoxe.Cryptography.Abstractions 2025.2.0




Aoxe.Cryptography.Abstractions 2025.2.0

dotnet add package Aoxe.Cryptography.Abstractions --version 2025.2.0
 
 
NuGet\Install-Package Aoxe.Cryptography.Abstractions -Version 2025.2.0
 
 
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="Aoxe.Cryptography.Abstractions" Version="2025.2.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aoxe.Cryptography.Abstractions" Version="2025.2.0" />
 
Directory.Packages.props
<PackageReference Include="Aoxe.Cryptography.Abstractions" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aoxe.Cryptography.Abstractions --version 2025.2.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Aoxe.Cryptography.Abstractions, 2025.2.0"
 
 
#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.
#:package Aoxe.Cryptography.Abstractions@2025.2.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aoxe.Cryptography.Abstractions&version=2025.2.0
 
Install as a Cake Addin
#tool nuget:?package=Aoxe.Cryptography.Abstractions&version=2025.2.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Aoxe.Cryptography

English |


Provide an easy way to use encryption algorithms. This package support the wraps and extension methods of AES/MD5/SHA/RSA/DSA/ECDSA/DES/TripleDES

  • Symmetric Algorithm
    • AES
    • DES
    • RC2
    • TripleDES
  • Asymmetric Algorithm
    • DSA
    • ECDSA
    • RSA
  • Hash Algorithm
    • MD5
    • SHA1
    • SHA256
    • SHA384
    • SHA512
    • SHA3-256
    • SHA3-384
    • SHA3-512
    • SHAKE128
    • SHAKE256
    • KMAC128
    • KMAC256

1. Quick Start

1.1. Install Package

PM> Install-Package Aoxe.Cryptography

1.2. MD5

var apple = "apple";
var md5String = apple.ToMd5String();
var md5Bytes = apple.ToMd5();

1.3. SHA

var apple = "apple";
//D0BE2DC421BE4FCD0172E5AFCEEA3970E2F3D940
var sha1String = apple.ToSha1String();
var sha1Bytes = apple.ToSha1();
//3A7BD3E2360A3D29EEA436FCFB7E44C735D117C42D1C1835420B6B9942DD4F1B
var sha256String = apple.ToSha256String();
var sha256Bytes = apple.ToSha256();
//3D8786FCB588C93348756C6429717DC6C374A14F7029362281A3B21DC10250DDF0D0578052749822EB08BC0DC1E68B0F
var sha384String = apple.ToSha384String();
var sha384Bytes = apple.ToSha384();
//844D8779103B94C18F4AA4CC0C3B4474058580A991FBA85D3CA698A0BC9E52C5940FEB7A65A3A290E17E6B23EE943ECC4F73E7490327245B4FE5D5EFB590FEB2
var sha512String = apple.ToSha512String();
var sha512Bytes = apple.ToSha512();

1.4. AES

var original = "Here is some data to encrypt!";
var key = AesHelper.GenerateKey();
var vector = AesHelper.GenerateVector();
//Default cipher mode is CBC and padding mode is PKCS7.
var encrypt = original.EncryptByAes(key, vector); // Also you can use Helper like this: AesHelper.Decrypt(encrypt, key, vector);
var decrypt = encrypt.DecryptByAes(key, vector); // Also you can use Helper like this: AesHelper.Decrypt(encrypt, key, vector);
var decryptString = Encoding.UTF8.GetString(decrypt);

1.5. RC2

var original = "Here is some data to encrypt!";
var key = Rc2Helper.GenerateKey();
var vector = Rc2Helper.GenerateVector();
//Default cipher mode is CBC and padding mode is PKCS7.
var encrypt = original.EncryptByRc2(key, vector); // Also you can use Helper like this: Rc2Helper.Decrypt(encrypt, key, vector);
var decrypt = encrypt.DecryptByRc2(key, vector); // Also you can use Helper like this: Rc2Helper.Decrypt(encrypt, key, vector);
var decryptString = Encoding.UTF8.GetString(decrypt);

1.6. DES

var original = "Here is some data to encrypt!";
var key = DesHelper.GenerateKey();
var vector = DesHelper.GenerateVector();
//Default cipher mode is CBC and padding mode is PKCS7.
var encrypt = original.EncryptByDes(key, vector); // Also you can use Helper like this: DesHelper.Decrypt(encrypt, key, vector);
var decrypt = encrypt.DecryptByDes(key, vector); // Also you can use Helper like this: DesHelper.Decrypt(encrypt, key, vector);
var decryptString = Encoding.UTF8.GetString(decrypt);

1.7. TripleDES

var original = "Here is some data to encrypt!";
var key = TripleDesHelper.GenerateKey();
var vector = TripleDesHelper.GenerateVector();
//Default cipher mode is CBC and padding mode is PKCS7.
var encrypt = original.EncryptByTripleDes(key, vector); // Also you can use Helper like this: TripleDesHelper.Decrypt(encrypt, key, vector);
var decrypt = encrypt.DecryptByTripleDes(key, vector); // Also you can use Helper like this: TripleDesHelper.Decrypt(encrypt, key, vector);
var decryptString = Encoding.UTF8.GetString(decrypt);

1.8. RSA

The default padding is OaepSHA256 and the default encoding is utf8.

var original = "Here is some data to encrypt!";
var (privateKey, publicKey) = RsaHelper.GenerateParameters();
var originalBytes = Encoding.UTF8.GetBytes(original);
var encryptBytes = originalBytes.EncryptByRsa(publicKey); // Also you can use Helper like this: RsaHelper.Encrypt(originalBytes, publicKey);
var decryptBytes = encryptBytes.DecryptByRsa(privateKey); // Also you can use Helper like this: RsaHelper.Decrypt(encryptBytes, privateKey);
var decrypt = Encoding.UTF8.GetString(decryptBytes);
Assert.True(original, decrypt);

1.9. ECDSA

The default encoding is utf8.

var original = "Here is some data to encrypt!";
//SignData
var (privateKey, publicKey) = EcdsaHelper.GenerateParameters();
var originalBytes = EcdsaHelper.Encoding.GetBytes(original);
var signBytes = originalBytes.SignDataByEcdsa(privateKey, hashAlgorithm);
//True
var result = originalBytes.VerifyDataByEcdsa(signBytes, publicKey, hashAlgorithm);
//SignHash
var (privateKey, publicKey) = EcdsaHelper.GenerateParameters();
var originalBytes = EcdsaHelper.Encoding.GetBytes(original);
var signBytes = originalBytes.SignHashByEcdsa(privateKey);
//True
var result = originalBytes.VerifyHashByEcdsa(signBytes, publicKey);

1.10. DSA

The default encoding is utf8.

var (privateKey, publicKey) = DsaHelper.GenerateParameters();
var originalBytes = DsaHelper.Encoding.GetBytes(original);
var signature = originalBytes.CreateSignatureByDsa(privateKey);
//True
var result = originalBytes.VerifySignatureByDsa(signature, publicKey);

Thank`s for JetBrains for the great support in providing assistance and user-friendly environment for my open source projects.

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aoxe.Cryptography.Abstractions:

Package Downloads
Aoxe.Cryptography

The helpers and extension methods of AES/MD5/SHA/SHA2/SHA3/RSA/RC2/ECDSA/DSA/DES/TripleDES.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.2.0 337 5/21/2025
2025.1.6 298 12/20/2024
2025.1.5 214 12/20/2024
2025.1.4 341 11/15/2024
2025.1.2 221 11/15/2024
2025.1.0 209 11/15/2024
2024.3.0 267 11/5/2024
2024.2.2 408 9/5/2024
2024.2.1 290 8/28/2024
2024.2.0 215 8/28/2024
2024.1.2 255 7/18/2024
2024.1.1 305 6/10/2024