Hashing¶
Cryptographic digest and password KDF hashing.
Digest Hashing¶
Compute a cryptographic digest of an input string. All digest endpoints share the same request and response format.
POST /api/v1/hash/md5¶
POST /api/v1/hash/sha1¶
POST /api/v1/hash/sha256¶
POST /api/v1/hash/sha512¶
Parameters
Name |
In |
Required |
Description |
|---|---|---|---|
|
body |
yes |
The string to hash |
Example
curl -X POST https://api.apicrate.io/api/v1/hash/sha256 \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello world"}'
{
"algorithm": "sha256",
"hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
}
Password KDF Hashing¶
Derive password hashes using industry-standard key derivation functions.
POST /api/v1/hash/bcrypt¶
Hash a password with bcrypt.
Parameters
Name |
In |
Required |
Description |
|---|---|---|---|
|
body |
yes |
The password to hash |
|
body |
no |
Cost factor (default 12, range 4–31) |
Example
curl -X POST https://api.apicrate.io/api/v1/hash/bcrypt \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{"input": "my-secret-password", "rounds": 12}'
{
"algorithm": "bcrypt",
"hash": "$2b$12$LJ3m4ys3Lz0YHDtP6Wi0ceB7eat/lnS5z3FGbO2rGkSMo0In5muS6"
}
POST /api/v1/hash/scrypt¶
Hash a password with scrypt.
Parameters
Name |
In |
Required |
Description |
|---|---|---|---|
|
body |
yes |
The password to hash |
|
body |
no |
CPU/memory cost parameter (default 16384) |
|
body |
no |
Block size (default 8) |
|
body |
no |
Parallelism factor (default 1) |
Example
curl -X POST https://api.apicrate.io/api/v1/hash/scrypt \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{"input": "my-secret-password"}'
{
"algorithm": "scrypt",
"hash": "$scrypt$ln=14,r=8,p=1$c2FsdHNhbHQ$..."
}
POST /api/v1/hash/argon2id¶
Hash a password with Argon2id.
Parameters
Name |
In |
Required |
Description |
|---|---|---|---|
|
body |
yes |
The password to hash |
|
body |
no |
Number of iterations (default 3) |
|
body |
no |
Memory usage in KiB (default 65536) |
|
body |
no |
Degree of parallelism (default 4) |
Example
curl -X POST https://api.apicrate.io/api/v1/hash/argon2id \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{"input": "my-secret-password"}'
{
"algorithm": "argon2id",
"hash": "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHQ$..."
}