SimpleEncryption 1.0.0
See the version list below for details.
dotnet add package SimpleEncryption --version 1.0.0
NuGet\Install-Package SimpleEncryption -Version 1.0.0
<PackageReference Include="SimpleEncryption" Version="1.0.0" />
paket add SimpleEncryption --version 1.0.0
#r "nuget: SimpleEncryption, 1.0.0"
// Install SimpleEncryption as a Cake Addin #addin nuget:?package=SimpleEncryption&version=1.0.0 // Install SimpleEncryption as a Cake Tool #tool nuget:?package=SimpleEncryption&version=1.0.0
SimpleCryptography
SimpleCryptography is a modular library for cryptographic operations, designed to make encryption, hashing, and key derivation simple, flexible, and efficient.
✨ Features
- 🔒 Encryption:
- AES (256-bit) with configurable cipher modes and padding.
- ChaCha20-Poly1305 for authenticated encryption.
- 🔑 Hashing:
- Secure hashing algorithms: SHA-256 and SHA-512.
- 🧩 Key Derivation:
- Argon2i, Argon2d, and Argon2id for advanced password hashing.
- PBKDF2-based key derivation as a fallback.
- ⚙️ Salt and Nonce Generation:
- Generate secure salts and nonces dynamically.
- 💡 Thread-safe and configurable.
📦 Installation
Install SimpleCryptography via NuGet:
dotnet add package SimpleCryptography
📚 Overview
🔒 AES Encryption
Encrypt and decrypt strings and byte arrays using AES (256-bit):
using SimpleCryptography.Encryption;
byte[] key = Aes.GenerateKey("password", "salt");
byte[] iv = Aes.GenerateIv("password", "salt");
string encrypted = Aes.Encrypt("Hello, World!", key, iv);
string decrypted = Aes.Decrypt(encrypted, key, iv);
Console.WriteLine($"Decrypted: {decrypted}");
⚡ ChaCha20-Poly1305 Encryption
Lightweight and secure encryption with associated data (AAD):
using SimpleCryptography.Encryption;
byte[] key = ChaCha20.GenerateKey("password", "salt");
byte[] nonce = ChaCha20.GenerateNonce();
string encrypted = ChaCha20.Encrypt("Hello, World!", key, nonce);
string decrypted = ChaCha20.Decrypt(encrypted, key);
Console.WriteLine($"Decrypted: {decrypted}");
🔑 Hashing (SHA-256 and SHA-512)
Hash strings securely with or without salt:
using SimpleCryptography.Hashing;
string sha256Hash = Sha256.Hash("password");
string sha512Hash = Sha512.Hash("password");
Console.WriteLine($"SHA-256 Hash: {sha256Hash}");
Console.WriteLine($"SHA-512 Hash: {sha512Hash}");
🧩 Argon2 Key Derivation
Derive secure keys with Argon2 (i, d, id):
using SimpleCryptography.Derivation.Argon2;
string argon2Key = Argon2i.DeriveKey("password", "salt", keyLength: 32);
Console.WriteLine($"Argon2i Derived Key: {argon2Key}");
🤝 Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.
📜 License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on SimpleEncryption:
Package | Downloads |
---|---|
SimpleFiles
The SimpleFiles is a powerful and easy-to-use solution for handling file and folder operations in .NET. With built-in encryption and flexibility, it simplifies file management while keeping your data secure. 🔒 |
|
SimpleSecureData
SimpleSecureData is a library designed to provide enhanced security for local applications by ensuring data remains encrypted in memory at all times. It uses platform-specific secure storage mechanisms |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release:
- AES encryption (256-bit) with customizable modes and padding.
- ChaCha20-Poly1305 encryption with AAD support.
- Secure hashing (SHA-256 and SHA-512).
- Advanced key derivation (Argon2 and PBKDF2).