dg-hashing-technique 1.0.1

dotnet add package dg-hashing-technique --version 1.0.1
                    
NuGet\Install-Package dg-hashing-technique -Version 1.0.1
                    
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="dg-hashing-technique" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="dg-hashing-technique" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="dg-hashing-technique" />
                    
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 dg-hashing-technique --version 1.0.1
                    
#r "nuget: dg-hashing-technique, 1.0.1"
                    
#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 dg-hashing-technique@1.0.1
                    
#: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=dg-hashing-technique&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=dg-hashing-technique&version=1.0.1
                    
Install as a Cake Tool

Hashing Tool

Overview

Hashing Tool is a .NET library that provides methods to generate MD5 / SHA256 / SHA512 / RSA /Encrypt / Decrypt hash from string, object. It uses the System.Security.Cryptography class to generate the hash.

dotnet add package dg-hashing-technique --version 1.0

Include

using Hashing;

MD5 Usage

// hash Dictionary<string,string> with hash secret key
var hashString = Technique.MD5Hash(keyValuePair, secretKey);

//Hash string with hash secret key
var hashString = Technique.MD5Hash(stringToHash, secretKey);

// Hash string
var hashString = Technique.MD5Hash(stringToHash);

// Hash and verify sign (Dictionary<string,string> with hash secret key)
(bool result, string messaage) = VerifySign(keyValuePair, sign, secretKey);

// Hash and verify sign (hashString with hash secret key)
(bool result, string messaage) = VerifySign(hashString, sign, secretKey);

// Hash and verify sign (hashString)
(bool result, string messaage) = VerifySign(hashString, sign);

SHA256 Usage

// hasing Dictionary<string,string> with hash secret
var hashString = Hash_SHA256(keyValuePair,secretKey);

// hasing string with hash secret
var hashString = Hash_SHA256(stringToHash,secretKey);

// hasing string
var hashString = Hash_SHA256(keyValuePair);

SHA512 Usage

// hasing Dictionary<string,string> with hash secret
var hashString = Hash_SHA512(keyValuePair,secretKey);

// hasing string with hash secret
var hashString = Hash_SHA512(stringToHash,secretKey);

// hasing string
var hashString = Hash_SHA512(keyValuePair);

RSA

// hasing string with private key
var hashString = RSASign(stringToHash,privateKey);

// Verify RSA Sign
bool verifyResult = RSA_Sign_Verify(stringToHash, signString, publicKey);

Encrypt / Decrypt

// Encrypt string with key
var encryptedstring = Encrypt(stringToEncrypt,secretKey);

// Decrypt string with key
bool decrptedString = Decrypt(stringToDecrypt, secretKey);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This library is licensed under the MIT License. See the LICENSE file for more details.

Contributions

Contributions to this library are welcome. Please open an issue or submit a pull request with your changes

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.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.1 218 1/19/2025
1.0.0 175 1/19/2025