UniversalSecureEncriptor 1.0.4
dotnet add package UniversalSecureEncriptor --version 1.0.4
NuGet\Install-Package UniversalSecureEncriptor -Version 1.0.4
<PackageReference Include="UniversalSecureEncriptor" Version="1.0.4" />
<PackageVersion Include="UniversalSecureEncriptor" Version="1.0.4" />
<PackageReference Include="UniversalSecureEncriptor" />
paket add UniversalSecureEncriptor --version 1.0.4
#r "nuget: UniversalSecureEncriptor, 1.0.4"
#:package UniversalSecureEncriptor@1.0.4
#addin nuget:?package=UniversalSecureEncriptor&version=1.0.4
#tool nuget:?package=UniversalSecureEncriptor&version=1.0.4
UniversalSecureEncriptor
UniversalSecureEncriptor is a robust C# library for secure encryption and decryption of files and text using modern cryptographic standards. It is designed to be easy to use, highly secure, and suitable for a wide range of applications.
Project Information
- Project Name: UniversalSecureEncriptor
- Author: Ifeanyi Nwodo
- License: Apache-2.0
Features
- AES-GCM Encryption: Uses AES-GCM for authenticated encryption, ensuring both confidentiality and integrity.
- Password-Based Key Derivation: Keys are derived securely from user passwords using PBKDF2 (SHA-256).
- File & Text Support: Encrypt and decrypt both files and text strings.
- Base64 & Binary Output: Supports output as Base64 strings or raw bytes.
- Hashing Utility: Compute SHA-256 hashes for data integrity checks.
- Simple API: High-level static methods for easy integration.
How It Works
Encryption Process
- Key Derivation: A cryptographic key is derived from the password and a random salt using PBKDF2.
- AES-GCM Encryption: Data is encrypted using AES-GCM with a random nonce and authentication tag.
- Output Format: The salt, nonce, tag, and ciphertext are combined and returned as either a Base64 string or byte array.
Decryption Process
- Extract Parameters: Salt, nonce, tag, and ciphertext are extracted from the encrypted data.
- Key Derivation: The key is re-derived from the password and salt.
- AES-GCM Decryption: Data is decrypted and integrity is verified using the authentication tag.
API Overview
Main Class: SecureEncryptor
Text Encryption
string encrypted = SecureEncryptor.EncryptText("Hello World", "password123");
string decrypted = SecureEncryptor.DecryptText(encrypted, "password123");
File Encryption
string base64 = SecureEncryptor.EncryptFileToBase64("input.txt", "password123");
byte[] bytes = SecureEncryptor.EncryptFileToBytes("input.txt", "password123");
File Decryption
SecureEncryptor.DecryptFromBase64ToFile(base64, "output.txt", "password123");
byte[] decryptedBytes = SecureEncryptor.DecryptFromBytes(bytes, "password123");
Utility Methods
EncryptToBase64ToFile(inputFile, password)EncryptToBytesToFile(inputFile, password)DecryptFromBase64FileToFile(inputFile, outputFile, password)DecryptFromBytesFileToFile(inputFile, outputFile, password)
Hashing
string hash = HashUtility.ComputeSHA256(dataBytes);
Security Details
- AES-GCM: Provides authenticated encryption, protecting against tampering.
- PBKDF2 (SHA-256): Secure key derivation with configurable iterations (default: 100,000).
- Random Salt & Nonce: Ensures unique encryption for each operation.
- Authentication Tag: Verifies data integrity during decryption.
Usage Example
// Encrypt a file and save as Base64
SecureEncryptor.EncryptToBase64ToFile("myfile.txt", "strongpassword");
// Decrypt from Base64 file to original file
SecureEncryptor.DecryptFromBase64FileToFile("myfile_encrypted.txt", "myfile_decrypted.txt", "strongpassword");
// Encrypt and decrypt text
string encrypted = SecureEncryptor.EncryptText("Secret Message", "strongpassword");
string decrypted = SecureEncryptor.DecryptText(encrypted, "strongpassword");
Folder Structure
UniversalSecureEncriptor/
│
├── Helper/
│ ├── Services/
│ │ ├── FileEncryptor.cs
│ │ ├── KeyManager.cs
│ │ └── TextEncryptor.cs
│ └── Utilities/
│ └── HashUtility.cs
├── SecureEncryptor.cs
├── LICENSE
├── README.md
└── ...
Installation
Add the source files to your C# project or compile as a library. No external dependencies are required beyond .NET's standard cryptography libraries.
License
This project is licensed under the Apache-2.0 License.
Author
Ifeanyi Nwodo
Contributing
Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request.
Disclaimer
This library is provided as-is. Always review and test cryptographic code for your specific use case and security requirements.
| 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. 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. |
-
net8.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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4 | 340 | 9/18/2025 |