SingularFrameworkCore.DataProcessor.SymmetricEncryptor
                              
                            
                                0.1.0-beta
                            
                        
                    dotnet add package SingularFrameworkCore.DataProcessor.SymmetricEncryptor --version 0.1.0-beta
NuGet\Install-Package SingularFrameworkCore.DataProcessor.SymmetricEncryptor -Version 0.1.0-beta
<PackageReference Include="SingularFrameworkCore.DataProcessor.SymmetricEncryptor" Version="0.1.0-beta" />
<PackageVersion Include="SingularFrameworkCore.DataProcessor.SymmetricEncryptor" Version="0.1.0-beta" />
<PackageReference Include="SingularFrameworkCore.DataProcessor.SymmetricEncryptor" />
paket add SingularFrameworkCore.DataProcessor.SymmetricEncryptor --version 0.1.0-beta
#r "nuget: SingularFrameworkCore.DataProcessor.SymmetricEncryptor, 0.1.0-beta"
#:package SingularFrameworkCore.DataProcessor.SymmetricEncryptor@0.1.0-beta
#addin nuget:?package=SingularFrameworkCore.DataProcessor.SymmetricEncryptor&version=0.1.0-beta&prerelease
#tool nuget:?package=SingularFrameworkCore.DataProcessor.SymmetricEncryptor&version=0.1.0-beta&prerelease
SingularFrameworkCore.DataProcessor.SymmetricEncryptor
A C# library that provides an Encryption layer implementation for the SingularFrameworkCore.DataProcessor.IDataProcessorLayer<byte[]> interface. This library uses System.Security.Cryptography library to offer generic-robust Symmetric Encryption support.
Features
- Generic Symmetric Encryption: Supports any Symmetric encryptor that uses 
ICryptoTransform. - System.Security.Cryptography: Utilizes the standard 
System.Security.Cryptographylibrary for symmetric encryption operations. 
Installation
The package is available on NuGet. To install it, use the following command:
Install-Package SingularFrameworkCore.DataProcessor.SymmetricEncryptor
Or using the .NET CLI:
dotnet add package SingularFrameworkCore.DataProcessor.SymmetricEncryptor
Usage
NOTE: Both Encryption and Decryption processes must have same Key and IV for the same Object
using System.Security.Cryptography;
using SingularFrameworkCore;
using SingularFrameworkCore.DataProcessor.SymmetricEncryptor;
Aes aes = Aes.Create();
Singular<T, byte[]> secret = new Singular<T, byte[]>(
            repository,
            serializer,
            preProcessors,
            new List<IDataProcessorLayer<byte[]>>()
            {
                new SymmetricEncryptor(
                    () =>
                    {
                        aes.Key = GetEncryptionKey();
                        aes.IV = GetEncryptionIV(); 
                        return aes.CreateEncryptor();
                    },
                    decryptorFactory: () =>
                    {
                        aes.Key = GetEncryptionKey();
                        aes.IV = GetEncryptionIV(); 
                        return aes.CreateDecryptor();
                    }
                ),
            }
        );
Requirements
- .NET Standard 8.0+
 - System.Security.Cryptography
 
Contributing
Contributions are welcome! Please feel free to submit a Pull Request to the development branch.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Author
Created by Mohammad Ayaad
Related Projects
- SingularFrameworkCore - The core framework this implementation is built for
 
| 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
- SingularFrameworkCore (>= 0.1.0-alpha)
 
 
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.1.0-beta | 112 | 2/21/2025 |