Invalid length for a Base-64 char array or string. in UserManager.CheckPasswordAsync(user, password)
<p>I'm learning MVC and for creating Login and Register with Custom Existing Database I followed <a href="http://www.jamessturtevant.com/posts/ASPNET-Identity2.0-Custom-Database/" rel="nofollow">this tutorial</a> and created custom User Manager and Sign In Manager. It allowed me to register a user properly and users are saved in my db properly. But <em>password is saved as string without encryption as user</em> entered it and also while login CheckPasswordAsync returns <em>System.FormatException: Invalid length for a Base-64 char array or string.</em> For Implementing UserPasswordStore I followed <a href="https://dzone.com/articles/simple-implementation" rel="nofollow">this tutorial</a> 
code for my custom signinmanager and User store is</p>

<pre><code>public class CustomUserManager : UserManager&lt;MyAppUser&gt;
{
    public CustomUserManager(IUserStore&lt;MyAppUser&gt; store) : base(store) { }

    internal static CustomUserManager Create()
    {
        return new CustomUserManager(new CustomUserStore());
    }

    public override Task&lt;bool&gt; CheckPasswordAsync(MyAppUser user, string password)
    {
        return base.CheckPasswordAsync(user, password);
    }
}

public class CustomUserStore : IUserStore&lt;MyAppUser&gt;, IUserPasswordStore&lt;MyAppUser&gt;
{
    private LearningDBContext database;

    public Task CreateAsync(MyAppUser user)
    {
        try
        {
            var context = userStore.Context as LearningDBContext;
            context.MyAppUsers.Add(user);
            context.Configuration.ValidateOnSaveEnabled = false;
            return context.SaveChangesAsync();
        }
        catch { }
        return Task.FromResult&lt;bool&gt;(true);
    }

    #endregion


    #region Password Store Region
    public Task SetPasswordHashAsync(MyAppUser user, string passwordHash)
    {
        var identityUser = ToIdentityUser(user);
        var task = userStore.HasPasswordAsync(identityUser);
        setMyAppUser(user, identityUser);
        return Task.FromResult(0);
    }

    private void setMyAppUser(MyAppUser user, IdentityUser identityUser)
    {
        user.Password = identityUser.PasswordHash;
        user.Id = identityUser.Id;
        user.UserName = identityUser.UserName;
    }

    public Task&lt;string&gt; GetPasswordHashAsync(MyAppUser user)
    {
        var identityUser = ToIdentityUser(user);
        var task = userStore.GetPasswordHashAsync(identityUser);
        setMyAppUser(user, identityUser);
        return task;
    }

    public Task&lt;bool&gt; HasPasswordAsync(MyAppUser user)
    {
        var identityUser = ToIdentityUser(user);
        var task = userStore.HasPasswordAsync(identityUser);
        setMyAppUser(user, identityUser);
        return task;
    }

    private IdentityUser ToIdentityUser(MyAppUser user)
    {
        return new IdentityUser()
        {
            Id = user.Id,
            PasswordHash = user.Password,
            UserName = user.UserName
        };
    }
    #endregion
}
</code></pre>

<p>and in controller I'm calling</p>

<pre><code>var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, false);
</code></pre>

<p>I can't figure out the reason. Can anybody help?</p>