# Sha512 custom password specifying iterations?

**URL:** <https://community.auth0.com/t/sha512-custom-password-specifying-iterations/186688>\
**Category:** Get Help\
**Tags:** user-import-export, user-management\
**Created:** [May 13, 2025, 8:43pm UTC](https://community.auth0.com/t/sha512-custom-password-specifying-iterations/186688 "2025-05-13T20:43:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcorey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gcorey/32/74761_2.png) [@gcorey](https://community.auth0.com/u/gcorey)\
**Post date:** [May 13, 2025, 8:43pm UTC](https://community.auth0.com/t/sha512-custom-password-specifying-iterations/186688/1 "2025-05-13T20:43:18Z")

</div>

Like the example in this thread entitled `Importing users with custom password hash`

```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

```

Wouldn’t you need to specify 100 iterations when importing? I don’t see in the docs or this example import from the docs where you could specify the number of hash iterations.

```auto
{
        "email": "mary@contoso.com",
        "email_verified": false,
        "custom_password_hash": {
            "algorithm": "sha256",
            "hash": {
                "value": "d24e794fce503c3ddb1cd1ba1dd5d9b250cf9917336a0316fefd87fecf79200f",
                "encoding": "hex"
            },
            "salt": {
                "value": "abc123",
                "position": "prefix"
            }
        }
    },

```

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [May 13, 2025, 9:42pm UTC](https://community.auth0.com/t/sha512-custom-password-specifying-iterations/186688/2 "2025-05-13T21:42:21Z")

</div>

Hi @gcorey

Welcome to the Auth0 Community!

Based on this Knowledge Article → [Importing password hash made by PHP fails](https://community.auth0.com/t/importing-password-hash-made-by-php-fails/108812), Auth0 only accepts the password hashes that were passed through the Algorithm, like SHA256, only once, not looped multiple times.

Thanks!  
Dawid

---

<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:** [May 27, 2025, 9:42pm UTC](https://community.auth0.com/t/sha512-custom-password-specifying-iterations/186688/3 "2025-05-27T21:42:49Z")

</div>

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