***

title: "PasswordHashingStrategy"
generated: true
---------------

<GenerationInfo sourceFile="packages/core/src/config/auth/password-hashing-strategy.ts" sourceLine="22" packageName="@vendure/core" since="1.3.0" />

Defines how sensitive user credentials like passwords and API-Keys get hashed.

:::info\[Config]

Hashing for passwords when using the [NativeAuthenticationStrategy](/current/core/reference/typescript-api/auth/native-authentication-strategy#nativeauthenticationstrategy) can be
configured via the `authOptions.passwordHashingStrategy` property of
your VendureConfig.

Hashing for API-Keys can be configured via the [ApiKeyStrategy](/current/core/reference/typescript-api/auth/api-key-strategy#apikeystrategy),
more specifically `authOptions.adminApiKeyStrategy.hashingStrategy` and
`authOptions.shopApiKeyStrategy.hashingStrategy`.

:::

```ts title="Signature"
interface PasswordHashingStrategy extends InjectableStrategy {
    hash(plaintext: string): Promise<string>;
    check(plaintext: string, hash: string): Promise<boolean>;
}
```

* Extends: [`InjectableStrategy`](/current/core/reference/typescript-api/common/injectable-strategy#injectablestrategy)

<div className="members-wrapper">

### hash

\<MemberInfo kind="method" type={`(plaintext: string) => Promise<string>`}   />

### check

\<MemberInfo kind="method" type={`(plaintext: string, hash: string) => Promise<boolean>`}   />

</div>
