using System.Web.Security;
string password =FormsAuthentication.HashPasswordForStoringInConfigFile(txtPass.Text,"MD5");