# Importing users with custom password hash

**URL:** <https://community.auth0.com/t/importing-users-with-custom-password-hash/77415>\
**Category:** Get Help\
**Tags:** bulk-user-import, password-hash\
**Created:** [February 1, 2022, 11:18am UTC](https://community.auth0.com/t/importing-users-with-custom-password-hash/77415 "2022-02-01T11:18:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauricioromero](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mauricioromero](https://community.auth0.com/u/mauricioromero)\
**Post date:** [February 1, 2022, 11:18am UTC](https://community.auth0.com/t/importing-users-with-custom-password-hash/77415/1 "2022-02-01T11:18:29Z")

</div>

Hello!  
I am trying to test Bulk User Imports but I can’t find the best way to send a basic encryption method.  
For testing purposes lets say I’m using sha256 to encrypt password+salt with 100 iterations:

A password in the DB would look like this  
**1234** 35e7f5fc530c66ee830fd7d53f8d489b467a3edd81fbd2412947897d6bef12c0  
The first 4 digits would be the salt we used for creating the encryption, and the rest is the actual result after 100 iterations (password+salt)

Example code would be

```auto
const getHash = (string) => crypto
  .createHash('sha256')
  .update(string)
  .digest('hex');

    const passwordPlain = 'hello'
    const salt = '1234'
    let passwordToHash = salt + passwordPlain

    for (let i = 0; i < 100; i++) {
      passwordToHash = getHash(passwordToHash);
    }
    console.log(passwordToHash)
// 35e7f5fc530c66ee830fd7d53f8d489b467a3edd81fbd2412947897d6bef12c0

```

Would it be possible to use bulk import with custom\_password\_hash with an approach like this?  
We are trying to avoid configuring reset password email.  
Even though this is not exactly how the final solution will be, it will give us an idea for the real implementation.  
Thanks!

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [January 29, 2025, 9:16pm UTC](https://community.auth0.com/t/importing-users-with-custom-password-hash/77415/3 "2025-01-29T21:16:41Z")

</div>

Hi @mauricioromero,

Welcome to the Auth0Community and thank you for posting your question.

The [Bulk User Import](https://auth0.com/docs/manage-users/user-migration/bulk-user-imports#prerequisites) is an available option for your use case as well, given that Auth0 supports this type of migration for custom hashed passwords with supported algorithms, such as the SHA256. For this reason users will also **not** have to go through the reset password flow.

You can also rely on the secure hashing process provided by Auth0, in which case you would not need to implement any server-side implementation from your end, since from what I can see above this is just a sample code.

More documentation on this matter can be found [here](https://auth0.com/docs/manage-users/user-migration/bulk-user-import-database-schema-and-examples?_gl=1*1iqprnk*_gcl_au*MTEzMjcyMTIxNS4xNzM0NTI1MDYz*_ga*MTk5NDI5MjUzNy4xNzM0NTI1MDYz*_ga_QKMSDV5369*MTczODE4MjIyOC4xMDcuMS4xNzM4MTg0ODE2LjU1LjAuMA..#custom-password-hash).

I hope this helped.  
Best regards,  
Remus

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 12, 2025, 9:21pm UTC](https://community.auth0.com/t/importing-users-with-custom-password-hash/77415/5 "2025-02-12T21:21:42Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
