pwCryptoLibrary 1.1.0

dotnet add package pwCryptoLibrary --version 1.1.0
                    
NuGet\Install-Package pwCryptoLibrary -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="pwCryptoLibrary" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="pwCryptoLibrary" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="pwCryptoLibrary" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add pwCryptoLibrary --version 1.1.0
                    
#r "nuget: pwCryptoLibrary, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package pwCryptoLibrary@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=pwCryptoLibrary&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=pwCryptoLibrary&version=1.1.0
                    
Install as a Cake Tool

pwCryptoLibrary

A C# library to encrypt and decrypt data with AES, RSA, TripleDES algorithms.

**How to use 😗*

string textToEncrypt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus.";
string passPhrase = "your passphrase";
string cryptedText;
string decryptedText;
string RSAPublicKey = "";
string RSAPrivateKey = "";

Console.WriteLine("AES");
Console.WriteLine("---");
cryptedText = CryptoService.Encrypt(CryptoService.CryptoServiceEnum.AES, passPhrase, textToEncrypt);
Console.WriteLine(cryptedText);
decryptedText = CryptoService.Decrypt(CryptoService.CryptoServiceEnum.AES, passPhrase, cryptedText);
Console.WriteLine(decryptedText);

Console.WriteLine();

Console.WriteLine("RSA");
Console.WriteLine("---");
CryptoService.RSAGenerateKeys(2048, ref RSAPublicKey, ref RSAPrivateKey);
cryptedText = CryptoService.Encrypt(CryptoService.CryptoServiceEnum.RSA, "", textToEncrypt, RSAPublicKey);
Console.WriteLine(cryptedText);
decryptedText = CryptoService.Decrypt(CryptoService.CryptoServiceEnum.RSA, "", cryptedText, RSAPrivateKey);
Console.WriteLine(decryptedText);

Result :

alt text

**Important note 😗*

For RSA, the passphrase is not needed.
You must generate public and private key before using the method

CryptoService.RSAGenerateKeys

Then, you must send public key to encrypt and private key to decrypt.

Product Compatible and additional computed target framework versions.
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6

    • 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.1.0 130 7/1/2025
1.0.0 279 3/24/2023

Version 1.1.0 (01-07-2026)
Added SHA256, SHA512, MD5 crypt methods

Version 1.0.0
   First version