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** .. list-table:: :header-rows: 1 :widths: 15 10 10 65 * - Name - In - Required - Description * - ``input`` - body - yes - The string to hash **Example** .. code-block:: bash 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"}' .. code-block:: json { "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** .. list-table:: :header-rows: 1 :widths: 15 10 10 65 * - Name - In - Required - Description * - ``input`` - body - yes - The password to hash * - ``rounds`` - body - no - Cost factor (default 12, range 4--31) **Example** .. code-block:: bash 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}' .. code-block:: json { "algorithm": "bcrypt", "hash": "$2b$12$LJ3m4ys3Lz0YHDtP6Wi0ceB7eat/lnS5z3FGbO2rGkSMo0In5muS6" } POST /api/v1/hash/scrypt ^^^^^^^^^^^^^^^^^^^^^^^^^ Hash a password with scrypt. **Parameters** .. list-table:: :header-rows: 1 :widths: 15 10 10 65 * - Name - In - Required - Description * - ``input`` - body - yes - The password to hash * - ``n`` - body - no - CPU/memory cost parameter (default 16384) * - ``r`` - body - no - Block size (default 8) * - ``p`` - body - no - Parallelism factor (default 1) **Example** .. code-block:: bash 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"}' .. code-block:: json { "algorithm": "scrypt", "hash": "$scrypt$ln=14,r=8,p=1$c2FsdHNhbHQ$..." } POST /api/v1/hash/argon2id ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Hash a password with Argon2id. **Parameters** .. list-table:: :header-rows: 1 :widths: 15 10 10 65 * - Name - In - Required - Description * - ``input`` - body - yes - The password to hash * - ``time_cost`` - body - no - Number of iterations (default 3) * - ``memory_cost`` - body - no - Memory usage in KiB (default 65536) * - ``parallelism`` - body - no - Degree of parallelism (default 4) **Example** .. code-block:: bash 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"}' .. code-block:: json { "algorithm": "argon2id", "hash": "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHQ$..." }