A collection of four extensions using the current best practices for strong hashing and encryption.
Be sure to first add the using statement
using System.Security.Cryptography;
var plainText = "Some text to encrypt";
var encryptedText = plainText.Encrypt("encryptionPassword");
var encryptedText = "U29tZSB0ZXh0IHRvIGRlY3J5cHQ=";
var plainText = encryptedText.Decrypt("encryptionPassword");
var password = "Some password to hash";
var passwordHash = password.Hash();
var storedPasswordHash = "U29tZSBvdGhlciBwYXNzd29yZCBoYXNo";
var password = "Some password to compare";
var isValidPassword = password.CompareToHash(storedPasswordHash);