First check if password is correct by just authenticating the User:
user = AuthenticationHelper.AuthenticateUser("username", "password", SiteContext.CurrentSiteName);
If user is returned you can update it's password:
CMS.Membership.UserInfoProvider.SetPassword("UserName", "Password");
Kentico API should handle the encryption settings