I am storing a password in a database (school coursework so nothing too complicated but I want to challenge myself), I am using a one way hash function, is this suitable? It works I just feel there may be nicer ways of storing the password. The database is SQL, language is C#
static class Encryption
{
public static string OneWayEncrpyt(string toEncrypt)
{
byte[] data = System.Text.Encoding.ASCII.GetBytes("password");
data = new System.Security.Cryptography.SHA256Managed().ComputeHash(data);
return System.Text.Encoding.ASCII.GetString(data);
}
}