Extension Methods for
String hasing and Encryption

Stefan Prodan

Since MD5 and SHA1 are not consider secure any more, the hashing is done using SHA256 with a random salt. The salt can be hardcoded into your code or stored in a database. You can call the method with ref null as salt and the code will generate a random one using RNGCryptoServiceProvider.
The string encryption / decryption methods uses Rijndael algorithm. Rijndael has been approved by NSA to be used for classified information protection.