FlowEncrypt 1.0.0
See the version list below for details.
dotnet add package FlowEncrypt --version 1.0.0
NuGet\Install-Package FlowEncrypt -Version 1.0.0
<PackageReference Include="FlowEncrypt" Version="1.0.0" />
paket add FlowEncrypt --version 1.0.0
#r "nuget: FlowEncrypt, 1.0.0"
// Install FlowEncrypt as a Cake Addin #addin nuget:?package=FlowEncrypt&version=1.0.0 // Install FlowEncrypt as a Cake Tool #tool nuget:?package=FlowEncrypt&version=1.0.0
FlowEncrypt
Description
FlowEncrypt is a C# library providing robust encryption and decryption functionalities for files and in-memory data. Utilizing AES encryption with support for asymmetric key encryption of the salt, this library ensures secure handling of sensitive data.
Features
- Encrypt and decrypt data streams, files and byte arrays (IEnumerable).
- Support for RSA public/private key pair for salt encryption in AES.
- Simple and intuitive API.
- Secure and efficient implementation.
Getting Started
Prerequisites
- .NET 8.0 or later.
Installation
Clone the repository to your local machine:
git clone https://github.com/yourusername/FlowEncrypt.git
Usage
File Encryption and Decryption
string inputFile = "path/to/input.txt";
string encryptedFile = "path/to/encrypted.txt";
string decryptedFile = "path/to/decrypted.txt";
string password = "yourStrongPassword";
// Encrypting a file
EncryptFiles.Encrypt(inputFile, eoutputFile, password);
// Decrypting a file
EncryptFiles.Decrypt(inputFile, outputFile, password);
In-Memory Data Encryption and Decryption
string originalText = "Hello, World!";
IEnumerable<byte> data = Encoding.UTF8.GetBytes(originalText);
// Encrypting data
IEnumerable<byte> encryptedData = EncryptData.Encrypt(data, password);
// Decrypting data
IEnumerable<byte> decryptedData = EncryptData.Decrypt(encryptedData, password);
Usage with streams
Basic Decryption
using MemoryStream memoryStream = new MemoryStream(encryptedData);
using DecryptingStream decryptStream = new DecryptingStream(memoryStream, password);
using StreamReader reader = new StreamReader(decryptStream);
string decryptedText = reader.ReadToEnd();
Decryption with Private Key
If the data was encrypted using a public key:
X509Certificate2 privateKey = // Load your private key
using MemoryStream memoryStream = new MemoryStream(encryptedDataWithPublicKey);
using DecryptingStream decryptStream = new DecryptingStream(memoryStream, password, privateKey);
using StreamReader reader = new StreamReader(decryptStream);
string decryptedTextWithPrivateKey = reader.ReadToEnd();
Notes
- Ensure that the
EncryptStream
andDecryptStream
are properly disposed of to release all resources. - For encryption with a public key, ensure the corresponding private key is available for decryption.
- These classes are designed to work seamlessly with streams, making them versatile for various data sources.
Contributing
Contributions are welcome! Please read our Contributing Guide for more information.
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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FlowEncrypt:
Package | Downloads |
---|---|
SimpleBackup
SimpleBlackup is an easy to use, simple and lightweight backup and restore library for creating and restoring file backups. supports plain, compressed and encrypted backups. |
GitHub repositories
This package is not used by any popular GitHub repositories.