Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jscarle/cryptoextensions.net
Useful Cryptography Extensions
https://github.com/jscarle/cryptoextensions.net
crypto cryptography csharp dotnet
Last synced: about 1 month ago
JSON representation
Useful Cryptography Extensions
- Host: GitHub
- URL: https://github.com/jscarle/cryptoextensions.net
- Owner: jscarle
- License: mit
- Created: 2019-08-24T17:36:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T05:45:27.000Z (12 months ago)
- Last Synced: 2024-02-16T06:35:46.917Z (12 months ago)
- Topics: crypto, cryptography, csharp, dotnet
- Language: C#
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# CryptoExtensions.NET - Useful Cryptography Extensions
A collection of four extensions using the current best practices for strong hashing and encryption.[![MSBuild](https://github.com/jscarle/CryptoExtensions.NET/actions/workflows/msbuild.yml/badge.svg)](https://github.com/jscarle/CryptoExtensions.NET/actions/workflows/msbuild.yml)
## QuickStart
Be sure to first add the using statement
```csharp
using System.Security.Cryptography;
```### Encrypting text
```csharp
var plainText = "Some text to encrypt";
var encryptedText = plainText.Encrypt("encryptionPassword");
```### Decrypting text
```csharp
var encryptedText = "U29tZSB0ZXh0IHRvIGRlY3J5cHQ=";
var plainText = encryptedText.Decrypt("encryptionPassword");
```### Hashing a password
```csharp
var password = "Some password to hash";
var passwordHash = password.Hash();
```### Comparing a password hash
```csharp
var storedPasswordHash = "U29tZSBvdGhlciBwYXNzd29yZCBoYXNo";
var password = "Some password to compare";
var isValidPassword = password.CompareToHash(storedPasswordHash);
```