Hi <@U04UQ68083H> i there a way to setup SSHA512 f...
# ory-copilot
b
Hi @chilly-king-10285 i there a way to setup SSHA512 for hashers, so that i can use its hashers when user creation( from admin api / selfservice)
b
A message from kapa.ai
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the [Ory Kratos documentation on importing identities](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords) for more information on supported hashing algorithms and formats. This documentation provides details on how to handle hashed passwords, including SSHA512, during the import process.
b
@chilly-king-10285 this is for import scenario , how about setting password hasher for user creation?
b
A message from kapa.ai
To configure the password hashing algorithm for user creation in Ory Kratos, you can set the desired algorithm in the
config.yml
file. By default, Ory Kratos uses the BCrypt algorithm for hashing passwords, but you can change this to another supported algorithm like Argon2id. However, SSHA512 is not listed as a configurable option for password hashing during user creation in the provided knowledge sources. Here is how you can configure the BCrypt or Argon2id algorithm: ### BCrypt Configuration
Copy code
yaml hashers:   algorithm: bcrypt   bcrypt:     cost: 12
### Argon2id Configuration
Copy code
yaml hashers:   algorithm: argon2   argon2:     parallelism: 1     memory: 128MB     iterations: 3     salt_length: 16     key_length: 32
For more details on configuring password hashing algorithms, you can refer to the [Ory Kratos Passwords Settings documentation](https://www.ory.sh/docs/self-hosted/kratos/configuration/password). If you need to use SSHA512 specifically, it might be necessary to handle it as part of an import process rather than during user creation, as the configuration for user creation does not explicitly support SSHA512.
b
@chilly-king-10285 handle it as part of an import process rather than during user creation, what do you mean?
b
A message from kapa.ai
When I mention handling SSHA512 as part of an import process rather than during user creation, I refer to the ability to import existing user credentials that have been hashed using the SSHA512 algorithm into Ory Kratos. This is different from setting up a hashing algorithm for new user creation, which typically involves hashing passwords at the time of user registration or creation using a configured algorithm like BCrypt or Argon2id. In the context of importing, you can provide the hashed password directly in the JSON payload when importing user identities. Ory Kratos supports comparing stored SSHA512 hashes and can migrate them to the configured hasher if needed. Here is an example of how you might structure the JSON payload for importing a hashed password:
Copy code
json {   "schema_id": "<preset://email>",   "traits": {     "email": "[email protected]"   },   "credentials": {     "password": {       "config": {         "hashed_password": "{SSHA512}xPUl/px+1cG55rUH4rzcwxdOIPSB2TingLpiJJumN2xyDWN4Ix1WQG3ihnvHaWUE8MYNkvMi5rf0C9NYixHsE6Yh59M="       }     }   } }
This example shows how to import a user with an SSHA512 hashed password. The hashed password is provided directly, and Ory Kratos can handle it during the import process. For more information on importing identities and supported hashing algorithms, you can refer to the [Ory Kratos documentation on importing identities](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords).