<< Back to the snippet list

Extension methods for string hasing and ecryption

Published: 15 May 2011 By Stefan Prodan

This collection deals with strings security, with these extensions you can properly use hashing and encryption. 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.

encryption hash Rijndael

Please login to leave a comment.