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

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [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/k82/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.
