HashPassword() public static method

Get MD5 hashed/encrypted representation of the password and returns a Base64 encoded string of the hash. This is a one-way hash.
Passwords are case sensitive now. Before they weren't.
public static HashPassword ( string password ) : string
password string Supplied Password
return string
Esempio n. 1
0
        public virtual void UpdatePassword(string password)
        {
            if (String.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException("password");
            }
            var blog = SubtextContext.Blog;

            blog.Password = blog.IsPasswordHashed ? SecurityHelper.HashPassword(password) : password;
            SubtextContext.Repository.UpdateBlog(blog);
        }
Esempio n. 2
0
 public override void UpdatePassword(string password)
 {
     _hostInfo.Password = Config.Settings.UseHashedPasswords ? SecurityHelper.HashPassword(password, _hostInfo.Salt) : password;
     HostInfo.UpdateHost(_repository, _hostInfo);
 }
Esempio n. 3
0
 protected bool IsValidPassword(string password, string storedPassword, bool hashed, string salt)
 {
     return(storedPassword == (hashed ? SecurityHelper.HashPassword(password, salt) : password));
 }