https://github.com/jacraig/hashbrowns
A library to help simplify encryption within .Net.
https://github.com/jacraig/hashbrowns
encryption
Last synced: 11 months ago
JSON representation
A library to help simplify encryption within .Net.
- Host: GitHub
- URL: https://github.com/jacraig/hashbrowns
- Owner: JaCraig
- License: apache-2.0
- Created: 2018-11-06T17:59:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:32:14.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:31:19.235Z (over 1 year ago)
- Topics: encryption
- Language: C#
- Homepage: https://jacraig.github.io/HashBrowns/
- Size: 17.7 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# HashBrowns
[](https://github.com/JaCraig/HashBrowns/actions/workflows/dotnet-publish.yml)
HashBrowns is a library to help simplify encryption within .Net.
## Basic Usage
To use the library you first need to set up things on the ServiceCollection. Thankfully this only takes one call to do:
serviceCollection.RegisterHashBrowns();
This is required prior to using the CryptoManager or extension methods class for the first time. Once it is set up, you can use the CryptoManager class after getting an instance from the IoC container:
var Instance = cryptoManagerInstance.Encrypt(...);
However instead of having the IoC container create the class, you can also use the extension methods found in the HashBrowns namespace:
var EncryptedData = "My string that I want to encrypt".Encrypt(Key, Salt, HashingAlgorithm, NumberIterations, InitialVector, KeySize, EncryptionAlgorithm);
Similarly you can decrypt:
var DecryptedData = EncryptedData.Decrypt(Key, Salt, HashingAlgorithm, NumberIterations, InitialVector, KeySize, EncryptionAlgorithm);
Also hashing is available:
var MyHashedValue = "Example data".Hash(HashingAlgorithm);
## Installation
The library is available via Nuget with the package name "HashBrowns". To install it run the following command in the Package Manager Console:
Install-Package HashBrowns