SafeCrypt.Data.Security
1.0.1
See the version list below for details.
dotnet add package SafeCrypt.Data.Security --version 1.0.1
NuGet\Install-Package SafeCrypt.Data.Security -Version 1.0.1
<PackageReference Include="SafeCrypt.Data.Security" Version="1.0.1" />
paket add SafeCrypt.Data.Security --version 1.0.1
#r "nuget: SafeCrypt.Data.Security, 1.0.1"
// Install SafeCrypt.Data.Security as a Cake Addin #addin nuget:?package=SafeCrypt.Data.Security&version=1.0.1 // Install SafeCrypt.Data.Security as a Cake Tool #tool nuget:?package=SafeCrypt.Data.Security&version=1.0.1
SafeCrypt Library
A C# library for encryption and decryption.
Overview
The Encryption library provides a set of methods for encrypting and decrypting data using the Advanced Encryption Standard (AES) algorithm, and other algorithm. It is designed to be easy to use and can be integrated into C# applications that require secure data transmission or storage.
Table of Contents
Installation
To use the SafeCrypt library in your C# project, follow these steps:
Clone the repository:
git clone https://github.com/selfmadecode/SafeCrypt cd SafeCrypt
Build the project:
dotnet build
Now, you can reference the SafeCrypt library in your C# project.
Basic Usage
To use the library in your C# application, instantiate the AesEncryption
or AesDecryption
class and call the provided methods. Here's a simple example:
using SafeCrypt.AESDecryption;
using SafeCrypt.AESEncryption;
using SafeCrypt.Models;
class Program
{
static void Main()
{
var aesEncryptor = new AesEncryption();
var encryptedData = aesEncryptor.EncryptToBase64String("Hello, World!", "gdjdtsraewsuteastwerse=="
Console.WriteLine($"Encrypted Data: {encryptedData.EncryptedData}");
Console.WriteLine($"Initialization Vector: {encryptedData.Iv}");
var aesDecryptor = new AesDecryption();
var parameterToDecrypt = new DecryptionParameters
{
DataToDecrypt = encryptedData.EncryptedData,
SecretKey = encryptedData.SecretKey,
IV = encryptedData.IV
};
var data = aesDecryptor.DecryptFromBase64String(parameterToDecrypt)
Console.WriteLine($"Decrypted Data: {data.DecryptedData}");
Console.WriteLine($"Initialization Vector: {data.Iv}");
}
}
-------------------------------------------------------------------------------------------------------
using SafeCrypt.AESDecryption;
using SafeCrypt.AESEncryption;
using SafeCrypt.Models;
class Program
{
static void Main()
{
var dataToEncrypt = "Data to Encrypt";
var iv = "gyrthusdgythisdg";
var secret = "hghjuytsdfraestwsgtere==";
var encryptionParam = new EncryptionParameters
{
DataToEncrypt = dataToEncrypt,
IV = iv,
SecretKey = secret
};
var encryptor = new AesEncryption();
var response = encryptor.EncryptToBase64String(encryptionParam.DataToEncrypt, secret);
Console.WriteLine(response.EncryptedData);
Console.WriteLine(response.Iv);
Console.WriteLine(response.SecretKey);
var decryptorParam = new DecryptionParameters
{
IV = response.Iv,
SecretKey = secret,
DataToDecrypt = response.EncryptedData
};
var decryptor = new AesDecryption();
var decryptionData = decryptor.DecryptFromBase64String(decryptorParam);
Console.WriteLine(decryptionData.DecryptedData);
Console.WriteLine(decryptionData.Iv);
Console.WriteLine(decryptionData.SecretKey);
}
}
Contributing
If you would like to contribute to the development of the SafeCrypt library, follow these steps:
Create an issue to discuss the proposed changes or bug fixes.
Fork the repository and create a new branch for your work:
git checkout -b feature/my-feature
Make your changes and commit them with clear and concise messages.
Push your changes to your fork.
Create a pull request from your branch to the main repository.
Ensure that your pull request follows the contribution guidelines and includes necessary tests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
SafeCrypt Library - Release Notes - Version 1.0.1
This release (version 1.0.1) includes updates to the documentation and namespace changes. We have improved the README document to provide more comprehensive information about the library and made adjustments to the namespaces for better organization.
Changes
- Updated README document with detailed usage instructions, API references, and contribution guidelines.
- Made changes to namespaces for better organization and clarity in the codebase.
Bug Fixes
No bug fixes in this release.
Upgrade Command:
dotnet add package SafeCrypt --version 1.0.1
Feedback and Contributions:
We appreciate your feedback and contributions! If you encounter any issues or have suggestions, please create an issue on GitHub: https://github.com/selfmadecode/SafeCrypt/issues
Thank you for using the SafeCrypt Library!