Generate a Scrypt Hash — Free Key Derivation Tool

N, r, and p — those three cost parameters, plus a password and salt, are everything the Scrypt Hash Generator needs to derive your key. Leave the salt blank for a random one, adjust N (16384 through 131072) to trade speed for brute-force resistance, and click Derive Key to run the computation — powered by scrypt-js and verified against all three official RFC 7914 test vectors. Because scrypt is deliberately slow, higher settings can take a few seconds to finish; that's the point, not a bug.

Powered by scrypt-js -- verified against all 3 official RFC 7914 test vectors before shipping. Higher N/r/p values take longer to compute; this runs entirely in your browser, so very high settings may take several seconds.

When you need to generate a scrypt hash for a password, the decisions you make about parameters directly determine how resistant that password hash is to attacks involving brute force techniques, GPU mining rigs, and large-scale hardware assaults. This scrypt hash generator online runs entirely in your browser — nothing leaves your device, no data is sent to a server, and every hash is computed through client-side execution so your credentials stay completely private. Whether you're a developer debugging an integration, validating parameters for a production deployment, or simply learning how password hashing works, understanding the output this tool produces is what turns a raw hash string into a meaningful decision in applied cryptography.

Generate & Verify Scrypt Password Hashes Online — scrypt hash generator online

The scrypt hash generator accepts a plain-text password, a salt, and three configurable cost parameters (N, r, p) to produce a derived key that is computationally and memory expensive to reverse or crack. Every output is a one-way cryptographic transformation — not an encryption — so there is no scrypt decrypt online path; you can only verify candidate passwords against a saved output to confirm a match. The tool also includes a verify mode (a hash verification tab) where you paste an encoded scrypt hash alongside the original password and confirm whether they match. These kinds of online tools are invaluable for developers testing and decoding parameter configurations safely.

Scrypt Hash Parameters — Salt, N, r, and p Explained

Each parameter in a scrypt password hash serves a distinct purpose in controlling protection and performance. The salt is a cryptographically random value appended to the password before processing. A unique salt value ensures that two identical passwords produce completely different hashes, defeating rainbow table and dictionary attack strategies. You should use a minimum salt length of 16 bytes (128-bit) — anything shorter is insufficient for modern cybersecurity standards. The tool generates a fresh random salt automatically on every execution, so the encoded output string changes even when the plain-text input does not.

The three cost parameters together control the memory cost, CPU difficulty, and parallelization of the process:

  • N — CPU/Memory Cost Factor: The primary n parameter controlling overall resource usage. Must always be a power of 2 (a power of two). Doubling N doubles both time and memory. Higher values mean greater resistance to cracking attempts but slower interactive login times. Common values: N=16384 (~16 MB), N=32768 (~32 MB), N=65536 (~64 MB), N=1048576 (~1 GB).
  • r — Block Size Parameter: The r parameter fine-tunes memory throughput usage by controlling the block size read in each round. The block size parameter affects memory per-block and, at very high values, may reduce parallelism benefits. Standard default is r=8.
  • p — Parallelization Factor: The p parameter controls how many independent processing lanes run simultaneously. Each parallel thread needs N×r memory. On multi-core systems, increasing p allows parallel computation without increasing per-thread memory beyond the N×r budget. For most related password hashing scenarios, p=1 is sufficient since N already dominates the cost.

Generated Scrypt Hash Output and RFC-Style Format

The tool outputs an encoded scrypt string in a modular-style format that bundles all the information needed for future verification. The RFC-style scrypt format follows this structure:

$scrypt$N,r,p$salt$hash

This scrypt format acts as a self-describing encoded result — the identifier tag, tuning values, salt representation, and derived key are all embedded in a single string. When you later need to verify a password, your code can extract parameters directly from this string rather than relying on separately stored configuration values. The output representation can be hex or base64 depending on your application's needs, and the output size (controlled by dklen) sets the result length in bytes — 32 bytes is a common default, equivalent to a 256-bit derived key.

The tool also displays a report block that rates your chosen parameters against established guidelines, including OWASP 2026 and NIST SP 800-132 recommendations. A timing badge in milliseconds shows the actual execution time for the process in your browser, which helps you calibrate parameters against your latency targets.

Scrypt Hash Verification — Confirm Matches in Verify Mode

Switching to verify mode turns the tool into a hash tester and scrypt checker. You paste an existing encoded scrypt string, enter the plain-text password you want to test, and the tool parses the saved output to extract its parameters and salt, recomputes the derived result for the plain text, then reports whether they match. This verify mode is particularly useful for debugging integrations — if your framework fails to confirm a hash, the tool helps you isolate whether the problem is a parameter mismatch (different N/r/p values), a representation mismatch (hex vs. base64), or whitespace line endings trimmed differently in your stack. The confirmation process does not send any data to a server; everything runs browser-side.

Privacy guarantee: All operations run entirely on your device. No passwords leave the browser, no server upload occurs, and your private keys and credentials are never stored. The tool is served over HTTPS with no data transmitted to any server-side component.

Tuning N, r, and p with the Online Scrypt Hash Generator — online scrypt hash generator

Choosing the right scrypt parameters is one of the most critical decisions in credential protection. Too low and your scrypt password hashes become economically prohibitive to store but trivially easy to crack with modern GPUs; too high and logins feel sluggish and your servers risk running out of memory during traffic spikes. The parameter guide below maps common scenarios to recommended parameter sets based on a memory calculation driven by the formula:

$$\text{Memory} = 128 \times N \times r \text{ bytes}$$

For example, with a cost factor value equivalent to N=16384 and r=8: \(128 \times 16384 \times 8 = 16{,}777{,}216\) bytes = ~16 MB. With N=32768 and r=8: \(128 \times 32768 \times 8 = 33{,}554{,}432\) bytes = ~32 MB. This illustrates that doubling N doubles memory consumption and processing time proportionally — a property known as sequential memory hardness that underpins scrypt's resistance to GPU and custom hardware attacks.

Memory-Hard Parameter Tuning — Choosing N for Your Security Level

Use CaseNrpMemoryNotes
Interactive login (modest hardware)16384 (214)81~16 MBFast enough for web login latency targets; minimum recommended baseline
Standard web authorization32768 (215)81~32 MBRecommended default for most web applications in 2026
Sensitive storage / vault65536 (216)81~64 MBHigher protection; expect 250–500ms on production hardware
High security / offline key derivation131072 (217)81~128 MiBSuitable for protecting private keys, full-disk credentials
Maximum / paranoid1048576 (220)81~1 GBHigh protection; not suitable for interactive logins

The memory = 128 × N × r bytes formula is the core of parameter tuning. When you're targeting login latency of 100–300 ms for interactive sessions, start with a cost factor of N=16384 or N=32768 on your production hardware and benchmark with live timing. For sensitive storage like wallet protection or credential vaults, push N to 65536 or higher. Setting N = 2^17 with r=8 and p=1 gives you 128 MiB of RAM requirements per hash attempt — a figure that makes large-scale attacks extremely costly even with custom hardware attacks requiring significant investment.

Tip: Always use a unique salt per password. Reusing salts across users allows attackers to crack multiple accounts with a single pass. Use cryptographically secure salt generation (e.g., crypto.randomBytes(16) in Node.js or os.urandom(16) in Python) to produce a fresh nonce for every new hash.

Key Derivation Parameters — Block Size and Parallelization Factor

While N dominates the memory cost, the r value and p value each play supporting roles that matter in specific deployment contexts. The block size parameter r scales how much data is read from memory on each mixing operation — increasing r from 8 to 16 doubles throughput demands without changing the N-driven cpu memory cost. The degree of parallelism p distributes work across independent processing lanes, making the scrypt KDF more suitable for multi-core systems where you want to exploit available CPU cores. For most web scenarios, r=8 and p=1 remain the standard choice; increasing p is most beneficial when your server has multiple cores idle during a login attempt and you want to keep N lower for latency while still increasing overall computational difficulty.

Batch Processing Multiple Passwords

The tool supports batch processing via a "batch by newline" toggle. In hash mode, each non-empty line of plain text is treated as a separate input and receives its own unique nonce value, producing a corresponding list of encoded scrypt strings — one per line. In verify mode, each line of plain text is compared against the corresponding line of encoded hashes, and the tool reports the exact number of matches and mismatches across all entries. This makes the tool efficient for validating migrated outputs, running test configurations, or generating multiple lines of test data for integration testing across server-side services, APIs, and login pipelines.

Scrypt vs Argon2id vs PBKDF2 vs bcrypt — scrypt hasher Algorithm Comparison

Choosing between scrypt, argon2id, bcrypt, and pbkdf2 is a question of threat model, regulatory adherence, and runtime library availability. Each algorithm reflects a different era and philosophy of password hashing tools design. The comparison below synthesizes guidance from OWASP cheat sheet recommendations and NIST SP 800-63B guidelines to help you select the right algorithm for your scenario in 2026.

AlgorithmMemory-HardGPU ResistantConfigurableUse CaseNotes
ScryptYesHighN, r, pWeb auth, sensitive storage, key derivationProven in production (Litecoin, Tarsnap); scrypt well-studied; good for existing deployments
Argon2idYes (strongest)Very HighMemory, Time, ParallelismNew systems, modern credential storagePHC winner 2015 (password hashing competition); recommended for new systems; combines Argon2i and Argon2d
bcryptLimitedMediumCost onlyLegacy systems, compatibility fallbackFixed memory at ~4kb; $2b$ format widely deployed; still safe but showing age
PBKDF2NoLowIterationsFIPS adherence, legacy compatibilityNIST recommended; gpu-vulnerable; iteration count must be very high (600,000+) to compensate; widely supported

Why Scrypt Is a Memory-Hard Function — Defense Against GPU and ASIC Attacks

Scrypt was designed by Colin Percival in 2009, originally built for the Tarsnap backup service as a password-based derivation function that would resist the kind of hardware attack that fast cryptographic hashes like SHA-256 are vulnerable to. The core insight is its memory-hard function design: by requiring a large amount of RAM to compute — not just CPU cycles — scrypt makes GPU attacks, ASIC attacks, and FPGA attacks prohibitively expensive. A GPU can run thousands of parallel computation threads, but if each thread requires significant dedicated RAM, the number of simultaneous password cracking attempts the GPU can sustain drops dramatically. This design directly defeats the parallel attacks that make older algorithms comparatively easier to target with custom hardware attacks.

The memory difficulty introduced by the N and r parameters forces attackers to provision RAM equivalent to \(128 \times N \times r\) bytes for every candidate password they test. At N=32768, that is roughly 32 MB per guess. An attacker trying to evaluate millions of candidate passwords simultaneously faces a combinatorial RAM requirement that becomes economically prohibitive — even with mining rigs optimized for cryptocurrency workloads that exploit gpu mining infrastructure. Litecoin adopted scrypt specifically for this resistant property, providing real-world proof of its computational difficulty at scale.

When NOT to Use Scrypt — Constraints and Alternatives

Despite its strengths, scrypt is not the universally correct choice for every deployment scenario:

  • FIPS compliance environments: PBKDF2 with SHA-256 or SHA-512 is the FIPS compliant option recognized by NIST. Scrypt is not listed in FIPS 140-2/3 approved algorithms, making it unsuitable in regulated environments requiring strict adherence to those standards.
  • Low-memory environments: Embedded systems, IoT devices, and serverless platforms with strict memory limits cannot allocate the RAM that scrypt's design demands.
  • Modern credential storage for new projects: Argon2id is the current OWASP baseline recommendation and phc winner — if you're starting fresh, Argon2id provides better defense against side-channel attacks and is the preferred choice from both OWASP and infosec practitioners. The argon2id library is available across all major runtimes.
  • Legacy framework constraints: Some older frameworks only support bcrypt (via the prefix $2b$) or pbkdf-based mechanisms. In those cases, bcrypt remains a safe legacy choice; pbkdf2 works as a compatibility fallback where FIPS adherence is required.

For scrypt vs argon2, the practical guidance in 2026 is: if you're building a new system and your argon2id library or runtime supports it, choose Argon2id. If you have existing deployments already using scrypt with well-tuned parameters, scrypt remains a strong, widely deployed choice with no need to migrate urgently. For scrypt vs bcrypt, scrypt's configurable memory gives it a significant advantage — bcrypt's fixed 4KB footprint makes it far more susceptible to modern GPU cracking. For scrypt vs pbkdf2, scrypt wins on GPU resistance by a wide margin; PBKDF2 requires enormous iteration counts (600,000+) to even approach comparable protection, and it remains vulnerable to gpu mining-style attacks in practice.

Implementing Scrypt in Your Code — scrypt generator Examples

This online scrypt hasher is ideal for testing and validating password outputs in a safe environment, but your production code needs to implement scrypt directly using native libraries. Both Node.js and Python ship with scrypt support in their standard libraries — no third-party dependency required. Below are complete, production-ready scrypt password hashing examples with matching parameters.

Node.js Scrypt Example — Using crypto.scrypt

Node.js exposes scrypt through the built-in crypto module via crypto.scrypt. The following example demonstrates producing a hash with a cost factor of N=16384, block size r=8, parallelism p=1 and a 32-byte output (dklen=32), then verifying it with a timing-safe comparison to prevent side-channel leakage:

const crypto = require('crypto');

// --- Hash a password ---
const password = 'mySecretPassword';
// salt: always use a cryptographically secure salt (16+ bytes)
const salt = crypto.randomBytes(16).toString('hex'); // hex representation

// N: CPU/memory cost (power of 2) | r: block size | p: parallelization
crypto.scrypt(
  password,
  salt,
  32,                        // output length (32 bytes)
  { N: 16384, r: 8, p: 1 }, // configurable n r p parameters
  (err, derivedKey) => {
    if (err) throw err;
    const hashHex = derivedKey.toString('hex'); // hex output
    // Store: salt + '$' + hashHex (or use RFC-style format)
    console.log('Salt:', salt);
    console.log('Hash:', hashHex);

    // --- Verify a password ---
    crypto.scrypt(password, salt, 32, { N: 16384, r: 8, p: 1 },
      (err2, verifyKey) => {
        if (err2) throw err2;
        const keyBuf = Buffer.from(hashHex, 'hex');
        // timing-safe comparison prevents timing side-channel
        const match = crypto.timingSafeEqual(verifyKey, keyBuf);
        console.log('Password matches:', match);
      }
    );
  }
);

Security note: Never store plain text passwords. Always store the full encoded string — including the salt, identifier tag, and tuning values — so that you can recompute the result during login without relying on separately managed configuration. Use crypto.timingSafeEqual for all comparisons to prevent timing leakage that could reveal information about the saved output.

Python Scrypt Example — Using hashlib.scrypt

Python 3.6+ includes hashlib.scrypt natively. The following example shows python scrypt processing with the same parameters, using os.urandom for secure randomness in salt generation:

import hashlib
import os
import hmac

# --- Hash a password ---
password = 'mySecretPassword'
# salt generation: cryptographically secure, 16 bytes minimum
salt = os.urandom(16)  # unique nonce each time

# password encode to bytes before passing to hashlib.scrypt
dk = hashlib.scrypt(
    password.encode('utf-8'),  # plain text input encoded as bytes
    salt=salt,
    n=16384,   # N: CPU/memory cost factor (n parameter, power of 2)
    r=8,       # r: block size parameter
    p=1,       # p: parallelization factor
    dklen=32   # output length in bytes
)

# hex representation for storage
hash_hex = dk.hex()   # key hex output
salt_hex = salt.hex() # store salt alongside hash

print(f"Salt: {salt_hex}")
print(f"Scrypt Hash: {hash_hex}")

# --- Verify a password ---
def verify_password(password: str, salt_hex: str, stored_hash_hex: str) -> bool:
    salt_bytes = bytes.fromhex(salt_hex)
    # recompute with identical parameters
    dk_verify = hashlib.scrypt(
        password.encode('utf-8'),
        salt=salt_bytes,
        n=16384, r=8, p=1, dklen=32
    )
    # timing-safe comparison to prevent timing attacks
    return hmac.compare_digest(dk_verify.hex(), stored_hash_hex)

print('Verified:', verify_password('mySecretPassword', salt_hex, hash_hex))

Security note: The password.encode() step is mandatory — hashlib.scrypt requires bytes input, not a string. Use hmac.compare_digest rather than == for result comparison to avoid timing leakage. Store both salt_hex and hash_hex in your credential layer — or use the RFC-style format to keep them together.

RFC-Style Scrypt Hash Format and Password Hashing — Storing and Parsing the Full Encoded String

The rfc-style scrypt format embeds all parameters and the salt into a single self-describing string, following the modular crypt format convention used across many password hashing tools:

# RFC-style scrypt hash format:
# $scrypt$N,r,p$<base64-encoded-salt>$<base64-encoded-derived-hash>

# Example:
$scrypt$16384,8,1$c2FsdGhlcmU=$5K4RqoHdHRKCcN3VRGS0SrTLNHBPGkzf8Ygcjz+HEnM=

This modular-style string contains the identifier tag (scrypt), the tuning values (N, r, p), the salt representation (base64 or hex), and the derived output — everything needed to recompute and verify a password without any additional stored configuration. When your framework's verification fails, always check whether the representation format (base64 vs. hex), the n value / r value / p value recorded in the string, or the output size diverges from what your code expects. The scrypt hash tester in verify mode makes this diagnosis fast by parsing the encoded string and showing you its extracted parameters before attempting the comparison.

What's being shared: When you use this tool, no data is sent to any server. All scrypt processing and result verification runs in-browser via the WebCrypto API. Your password, salt, and hash output are never stored, logged, or transmitted. This is a fully client-side, offline tool — suitable even in environments where data privacy policies prohibit sending credentials over the network.

Key Terminology — Understanding Scrypt Password Hashing Concepts

If you're encountering scrypt for the first time or coming from a background in simpler hashing like MD5 or SHA-1, a few terms are essential for understanding what this hash tool produces and why the design choices matter for real-world identity verification.

Key Derivation Function (KDF)
A key derivation function transforms a password (and salt) into a derived key of fixed length. Unlike a general-purpose hash like SHA-256, a KDF is deliberately slow and expensive. Scrypt is a password-based derivation function specifically designed for credential storage and credential protection — not for checksums or data integrity. The term reflects that the output can also be used as a cipher key, not just a saved password hash.
Memory-Hard Function
A memory-hard function requires a large, non-trivially reducible amount of RAM to compute. This property specifically defeats attackers using GPUs, FPGAs, and ASICs — hardware that has far more processing cores than RAM slots. By demanding throughput proportional to the cost factor, scrypt raises the economic floor for large-scale attacks. This sequential memory requirement is the key differentiator from older algorithms like PBKDF2.
Salt
A salt is a unique, cryptographically random value generated for each password before processing. Salts defeat rainbow table attacks (precomputed hash databases) by ensuring that even identical passwords produce completely different results. A salt length of at least 16 bytes (128 bits) is required by modern guidelines. The salt is stored alongside the hash — it is not a secret, but its uniqueness is what provides protection. This process is known as password salting.
One-Way Hash
Scrypt produces a one-way hash — the function is computationally irreversible by design. You cannot decrypt a scrypt hash; there is no scrypt decrypt online route. The only way to verify a password is to re-run scrypt with the same parameters and salt, then compare the output to the saved result. This is how all login verification works: compute and compare, never decrypt.
Work Factor / Cost Factor
The cost factor in scrypt is primarily N. Unlike bcrypt's single integer cost, scrypt's configurable parameters (N, r, p) give you granular control over cpu and memory cost. Increasing N is analogous to increasing rounds in PBKDF2 or the cost factor in bcrypt, but with the added dimension of proportional memory growth — making scrypt's computational difficulty multi-dimensional.
Pepper
A pepper is an optional site-wide secret appended to passwords before processing, stored separately from the database (e.g., in an environment variable). Unlike a salt, a pepper is shared across all users and is kept secret. Peppers add an extra layer of defense if the database is compromised but the application secrets are not. They are not part of the scrypt algorithm itself but are a complementary technique in data protection.
Opportunistic Rehashing
When migrating from bcrypt to Argon2id (or from any weaker algorithm to a stronger one), the recommended approach is opportunistic rehashing: on each successful login, check the saved output version and rehash the user's password with the new algorithm before saving. This is known as rehash on login and requires tracking a per-user hash version flag in your user table. It avoids forcing a password reset while gradually upgrading your credential layer over time.

Understanding these concepts transforms the raw output of a scrypt generator from an opaque hex string into a meaningful artifact. The encoded scrypt string you generate here carries its full settings — identifier tag, N, r, p, salt, and derived key — so that any compatible implementation can perform password verification without any additional configuration. That self-contained design is what makes the modular crypt format so valuable for modern credential storage in web applications and server-side services.

For web developers and programmers evaluating options, this free tool serves as both a developer resource for testing configurations and an educational reference for understanding the tradeoffs between scrypt, argon2id, bcrypt, and pbkdf2. You can also explore related tools for comparison: a bcrypt password generator to inspect bcrypt's $2b$ format and fixed-cost behavior, a bcrypt password checker for framework verification, and general hash calculator tools covering SHA256 hash calculator, SHA512 hash calculator, SHA1 hash calculator, SHA3 hash calculator, MD5 hash calculator, MD2 hash calculator, MD4 hash calculator, MD6 hash calculator, NTLM hash calculator, CRC32 hash calculator, Adler32 hash calculator, Whirlpool hash calculator, RIPEMD hash calculator, and an all hashes calculator for broader comparison. For symmetric protection needs, tools like an AES encryptor, AES decryptor, XOR encryptor, RC4 encryptor, DES encryptor, and Triple DES encryptor round out the web developer tools ecosystem. Additional password utilities include MySQL password generator, MariaDB password generator, Postgres password generator, and random password generator options — all available as web tools for developer workflows.

For identity and access management systems requiring adherence to OWASP or NIST standards, this tool's parameter analysis report and configurable tuning support make it a reliable reference for establishing your scrypt baseline before moving to production deployment. The no ads, no-server-upload design ensures your development use and educational use scenarios remain safe, private, and fast — true browser-side processing with nothing stored and nothing transmitted.

Frequently Asked Questions

What makes scrypt different from PBKDF2 or bcrypt?
Scrypt is deliberately memory-hard, not just CPU-slow -- it requires allocating a large, sequentially-accessed memory buffer proportional to its cost parameter N, which makes it far more expensive to accelerate with GPUs or custom ASICs than PBKDF2 or bcrypt (both of which use very little memory and parallelize well on specialized hardware).
What do N, r, and p control?
N is the CPU/memory cost -- must be a power of 2, and directly controls how much memory and time each derivation requires. r is the block size, affecting memory usage per operation. p is the parallelization factor, letting the work be split across p independent computation threads. Actual memory usage scales roughly as 128 × N × r bytes.
What N value should I use?
It depends on your hardware and acceptable latency budget -- higher is more secure but slower and more memory-intensive. This tool defaults to N=65536 (2^16) with r=8, p=1, a commonly cited baseline; production systems doing this server-side (with more available memory and time budget) often use higher values.
Where is scrypt used in practice?
It's most famously used in cryptocurrency mining (Litecoin and several altcoins chose it specifically for its memory-hardness, to resist ASIC mining dominance) and as a password-hashing option in security-conscious applications, competing with bcrypt and Argon2.
Is my password sent anywhere?
No. The entire derivation runs locally using the scrypt-js library -- your password, salt, and derived key are never transmitted to a server or stored.