CryptoHives.Foundation.Security.Cryptography
0.5.34-preview
dotnet add package CryptoHives.Foundation.Security.Cryptography --version 0.5.34-preview
NuGet\Install-Package CryptoHives.Foundation.Security.Cryptography -Version 0.5.34-preview
<PackageReference Include="CryptoHives.Foundation.Security.Cryptography" Version="0.5.34-preview" />
<PackageVersion Include="CryptoHives.Foundation.Security.Cryptography" Version="0.5.34-preview" />
<PackageReference Include="CryptoHives.Foundation.Security.Cryptography" />
paket add CryptoHives.Foundation.Security.Cryptography --version 0.5.34-preview
#r "nuget: CryptoHives.Foundation.Security.Cryptography, 0.5.34-preview"
#:package CryptoHives.Foundation.Security.Cryptography@0.5.34-preview
#addin nuget:?package=CryptoHives.Foundation.Security.Cryptography&version=0.5.34-preview&prerelease
#tool nuget:?package=CryptoHives.Foundation.Security.Cryptography&version=0.5.34-preview&prerelease
🛡️ CryptoHives Open Source Initiative 🐝
An open, community-driven cryptography and performance library collection for the .NET ecosystem, developed and maintained by The Keepers of the CryptoHives.
CryptoHives.Foundation.Security.Cryptography
Fully managed, OS-independent implementations of cryptographic hash, MAC, KDF, and cipher algorithms for .NET — written from NIST/RFC/ISO specifications and verified against official test vectors.
No OS crypto dependency — deterministic results on every platform. Hardware acceleration via AES-NI, PCLMULQDQ, VPCLMULQDQ, SSE2, SSSE3, and AVX2 intrinsics is automatically enabled on supported hardware.
📦 Installation
dotnet add package CryptoHives.Foundation.Security.Cryptography
✨ Key Features
- OS-independent — identical results on Windows, Linux, macOS, and any .NET-supported platform
- Standards-based — implemented from NIST, RFC, and ISO specifications; validated against official test vectors
- Hardware-accelerated — automatic AES-NI, AVX2, SSSE3 dispatch; scalar fallback always available
- Allocation-free hot paths —
Span<byte>-based APIs,stackalloc-friendly - XOF streaming —
IExtendableOutputinterface (Absorb/Squeeze/Reset) on all XOF algorithms HashAlgorithmcompatible — drop-in for any existingSystem.Security.Cryptography.HashAlgorithmconsumer- Comprehensive algorithm coverage — SHA-2/3, Keccak, SHAKE, BLAKE2/3, Ascon, regional ciphers, and more
🔐 Supported Algorithms
| Family | Algorithms |
|---|---|
| SHA-2 | SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 |
| SHA-3 | SHA3-224, SHA3-256, SHA3-384, SHA3-512 |
| Keccak | Keccak-256, Keccak-384, Keccak-512 (Ethereum-compatible) |
| SHAKE / cSHAKE | SHAKE128, SHAKE256, cSHAKE128, cSHAKE256 |
| TurboSHAKE / KT | TurboSHAKE128, TurboSHAKE256, KT128, KT256 |
| ParallelHash (SP 800-185) | ParallelHash128, ParallelHash256 |
| BLAKE | BLAKE2b, BLAKE2s (SIMD-accelerated), BLAKE3 |
| Ascon | Ascon-Hash256, Ascon-XOF128 (NIST SP 800-232 lightweight) |
| Regional hash | SM3, Streebog, Kupyna, LSH, Whirlpool, RIPEMD-160 |
| Legacy | SHA-1, MD5 (backward compatibility only) |
| MAC | HMAC-SHA-256/384/512, HMAC-SHA3-256, AES-CMAC, AES-GMAC, Poly1305, KMAC128/256, BLAKE2/3 keyed |
| Cipher (AEAD) | AES-GCM (128/192/256), AES-CCM (128/192/256), ChaCha20-Poly1305, XChaCha20-Poly1305, Ascon-AEAD128 |
| Cipher (block/stream) | AES-128/192/256 (ECB/CBC/CTR), ChaCha20 |
| Cipher (regional) | SM4, ARIA, Camellia, Kuznyechik, Kalyna, SEED |
| KDF | HKDF, KBKDF, ConcatKDF, PBKDF2 |
🚀 Quick Examples
Allocation-Free Hash (Blake3)
using CryptoHives.Foundation.Security.Cryptography.Hash;
using var blake3 = Blake3.Create();
Span<byte> hash = stackalloc byte[32];
blake3.TryComputeHash(data, hash, out _);
XOF Streaming (Shake256)
using CryptoHives.Foundation.Security.Cryptography.Hash;
// Variable-length output via IExtendableOutput
using var shake = Shake256.Create(outputLength: 64);
shake.Absorb(context);
shake.Absorb(message);
Span<byte> output = stackalloc byte[64];
shake.Squeeze(output);
shake.Reset(); // Reuse the instance
Keyed Hash / MAC (HMAC-SHA-256)
using CryptoHives.Foundation.Security.Cryptography.Mac;
using var hmac = new HmacSha256(key);
Span<byte> tag = stackalloc byte[32];
hmac.TryComputeHash(message, tag, out _);
Authenticated Encryption (AES-GCM)
using CryptoHives.Foundation.Security.Cryptography.Cipher;
using var aesGcm = new AesGcm256(key);
// Encrypt
Span<byte> ciphertext = new byte[plaintext.Length];
Span<byte> tag = stackalloc byte[16];
aesGcm.Encrypt(nonce, plaintext, ciphertext, tag, associatedData);
// Decrypt — throws if tag verification fails
Span<byte> recovered = new byte[ciphertext.Length];
aesGcm.Decrypt(nonce, ciphertext, tag, recovered, associatedData);
cSHAKE — Domain-Separated XOF
using CryptoHives.Foundation.Security.Cryptography.Hash;
using var cshake = CShake128.Create(
functionName: "MyApp"u8,
customization: "v1"u8,
outputLength: 32);
cshake.Absorb(input);
Span<byte> derived = stackalloc byte[32];
cshake.Squeeze(derived);
📚 Documentation
| Resource | Link |
|---|---|
| Full package documentation | cryptohives.github.io/Foundation/packages/security/cryptography |
| Hash algorithms guide | cryptohives.github.io/…/hash-algorithms |
| Cipher algorithms guide | cryptohives.github.io/…/cipher-algorithms |
| XOF mode guide | cryptohives.github.io/…/xof-mode |
| Hash benchmarks | cryptohives.github.io/…/benchmarks-hash |
| Cipher benchmarks | cryptohives.github.io/…/benchmarks-cipher |
| API reference | cryptohives.github.io/Foundation/api |
| Source repository | github.com/CryptoHives/Foundation |
🔐 Security Policy
Standards-based implementations, validated against official test vectors. Threat-modeled by design — all public APIs assume hostile input.
If you discover a vulnerability, please do not open a public issue. Follow the guidelines on the CryptoHives Security Page.
⚖️ License
MIT — © 2026 The Keepers of the CryptoHives
| 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 is compatible. 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 is compatible. 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 is compatible. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. 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. |
-
.NETFramework 4.6.2
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Bcl.Memory (>= 10.0.8)
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
- System.Memory (>= 4.6.3)
-
.NETFramework 4.7.2
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Bcl.Memory (>= 10.0.8)
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
- System.Memory (>= 4.6.3)
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Bcl.Memory (>= 10.0.8)
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
- System.Memory (>= 4.6.3)
-
.NETStandard 2.1
- Microsoft.Bcl.Memory (>= 10.0.8)
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
-
net10.0
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
-
net8.0
- Microsoft.Extensions.ObjectPool (>= 10.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.34-preview | 53 | 6/2/2026 |
| 0.5.21-preview | 116 | 5/2/2026 |
| 0.5.13-preview | 79 | 4/2/2026 |
| 0.4.21-preview | 74 | 3/1/2026 |
| 0.4.11-preview | 72 | 2/14/2026 |
| 0.3.19-preview | 81 | 1/26/2026 |