---
title: Custom password calculation
related:
  - https://docs.kentico.com/k10/custom-development/customizing-providers/registering-providers-using-assembly-attributes.md
---

> **Documentation indexes**
> The indexes below list current page URLs with titles and descriptions. Links on this page point to the Markdown versions of the linked pages.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

If you want to calculate the passwords in your own way, follow this procedure. You can find more information in the [Customizing providers](https://docs.kentico.com/k10/custom-development/customizing-providers.md).

1. Create a new class in the App\_Code folder.
2. Set the class to inherit from the **UserInfoProvider** class.
3. Override the _GetPasswordHashInternal_ method.
4. Add the **RegisterCustomProvider** assembly attribute above the class declaration to register the provider.

   ```csharp

   using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Web;

   using CMS;
   using CMS.Helpers;
   using CMS.Membership;

   // Registers the custom provider
   [assembly: RegisterCustomProvider(typeof(MyUserInfoProvider))]

   /// <summary>
   /// Customized UserInfoProvider for password calculation.
   /// </summary>
   public class MyUserInfoProvider : UserInfoProvider
   {
       protected override string GetPasswordHashInternal(string password, string passwordFormat, string salt)
       {
           return SecurityHelper.GetSHA1Hash(password + "CustomSalt");
       }
   }

   ```

The system now uses the customized provider (MyUserInfoProvider) instead of the default one.
