Fondness.Cipher
1.0.1
dotnet add package Fondness.Cipher --version 1.0.1
NuGet\Install-Package Fondness.Cipher -Version 1.0.1
<PackageReference Include="Fondness.Cipher" Version="1.0.1" />
<PackageVersion Include="Fondness.Cipher" Version="1.0.1" />
<PackageReference Include="Fondness.Cipher" />
paket add Fondness.Cipher --version 1.0.1
#r "nuget: Fondness.Cipher, 1.0.1"
#addin nuget:?package=Fondness.Cipher&version=1.0.1
#tool nuget:?package=Fondness.Cipher&version=1.0.1
Fondness.Cipher
A simple, high-performance string encryption and decryption extension library using AES (Advanced Encryption Standard) cryptography.
🚀 Features
- Simple API: Easy-to-use extension methods for string encryption/decryption
- AES Encryption: Uses industry-standard AES encryption algorithm
- Custom Keys: Support for custom encryption keys
- High Performance: Optimized for speed and efficiency
- Multi-Framework: Supports .NET 6.0, 7.0, 8.0, and 9.0
- Secure: Implements proper cryptographic practices
📦 Installation
Package Manager Console
PM> install-package Fondness.Cipher
.NET CLI
dotnet add package Fondness.Cipher
💡 Usage
Install this package using the NuGet package manager. You don't need any configuration on the application, just call the string extension methods:
string input = "Hello World!";
var encryptedValue = value.ToEncrypt();
var decryptValue = encryptedValue.ToDecrypt();
You can also provide your custom encryption key as follows:
string input = "Hello World!";
string encryptionKey = "abc123";
var encryptedValue = value.ToEncrypt(encryptionKey);
var decryptValue = encryptedValue.ToDecrypt(encryptionKey);
Make sure you provide the same encryption key for both encryption and decryption.
⚠️ Important Notes
- Key Consistency: Always use the same encryption key for both encryption and decryption
- Key Security: Store your custom encryption keys securely (environment variables, key vaults, etc.)
- Key Length: Custom keys should be sufficiently long for security (recommended: 32+ characters)
- Exception Handling: Handle potential exceptions for invalid inputs or wrong keys
🔐 Security Considerations
- Uses AES encryption with PBKDF2 key derivation
- Generates unique encrypted outputs for the same input (due to IV usage)
- Invalid decryption attempts with wrong keys will result in garbled output or exceptions
- Base64 encoding is used for the encrypted output string format
🧪 Exception Handling
try
{
string encrypted = "invalid-base64-string";
string decrypted = encrypted.ToDecrypt();
}
catch (FormatException)
{
// Handle invalid Base64 input
}
catch (ArgumentNullException)
{
// Handle null input
}
catch (CryptographicException)
{
// Handle decryption failures
}
🎯 Supported Frameworks
- .NET 6.0
- .NET 7.0
- .NET 8.0
- .NET 9.0
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📊 Changelog
Version 1.0.0
- Initial release
- Basic encryption/decryption functionality
- Support for custom encryption keys
Version 1.0.1
- Multi-framework support
🛡️ License
©Fondness Open Source. Licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 is compatible. 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 is compatible. 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. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.