Skip to content

Bcrypt vs Scrypt

In-Depth Technical Comparison & Architecture Guide

Bcrypt and Scrypt both slow down password verification deliberately, but they do it in fundamentally different ways: Bcrypt spends CPU cycles alone, while Scrypt deliberately consumes large amounts of memory alongside CPU time. That single architectural difference — memory-hardness — is the whole reason Scrypt exists, and it's the lens this comparison uses throughout.

Quick Reference Matrix

FeatureBcryptScrypt
Year Published19992009
StandardDe facto standard, no dedicated RFCRFC 7914
Resource FocusCPU-bound onlyCPU and memory bound (memory-hard)
Tuning Parameters1: Cost factor3: N (cost), r (block size), p (parallelism)
ASIC/GPU ResistanceLow — tiny memory footprintHigh — large configurable memory footprint
Max Password Length72 bytes (silently truncated)No practical limit
Ecosystem MaturityExtremely high, near-universal library supportHigh, but less default usage than Bcrypt or Argon2

Technology Overview

Bcrypt, designed in 1999 by Niels Provos and David Mazières and built on the Blowfish cipher, was the first widely-adopted password hashing function to deliberately slow itself down via an adjustable cost factor. For two decades it was the default recommendation for storing passwords, and it remains a reasonable, well-tested choice today — but its design predates the threat model it now has to defend against.

Scrypt, published by Colin Percival in 2009 (originally to protect his Tarsnap backup service, and later formalized as RFC 7914), was designed specifically to answer a weakness Bcrypt doesn't address at all: Bcrypt's memory footprint is tiny (a few kilobytes), which means an attacker can build custom hardware — GPUs, and eventually purpose-built ASICs — that runs thousands of Bcrypt guesses in parallel far more cheaply than a general-purpose CPU could. Scrypt forces every guess to allocate and repeatedly access a large, configurable block of memory, which makes that same parallel hardware advantage dramatically more expensive to build and operate.

This is the same problem Argon2 (see the Bcrypt vs Argon2 and Argon2 vs Scrypt comparisons) was later designed to solve, and Scrypt deserves credit as the algorithm that established memory-hardness as a serious password-hashing requirement in the first place — Argon2 refined the idea rather than inventing it. Scrypt remains a legitimate, still-recommended choice today, particularly in systems and libraries where it's already deeply embedded (it's also used as a proof-of-work function in several cryptocurrencies, including Litecoin's original mining algorithm, a use case unrelated to password storage but built on the same memory-hard construction).

Memory Hardness and Custom Hardware Resistance

Bcrypt's Blowfish-based core requires only around 4 KiB of working memory regardless of how high its cost factor is set — the cost factor scales CPU rounds, not memory. This is exactly what makes Bcrypt attractive to attackers building dedicated cracking hardware: a chip with very little memory per core can still run a Bcrypt guess, so thousands of cores can be packed onto a single board.

Scrypt's defining feature is that its cost function scales three separate parameters: N (a CPU/memory cost factor, required to be a power of two), r (block size, affecting memory bandwidth usage per iteration), and p (parallelization). Raising N forces the algorithm to allocate and repeatedly read/write a memory buffer whose size grows with N — commonly tens of megabytes for password-hashing configurations. An attacker's custom hardware now needs that same large memory allocation per parallel guess, which is vastly more expensive to fabricate at scale than adding pure compute cores.

The practical result: Scrypt-cracking hardware exists, but it's meaningfully more expensive per guess-per-second than Bcrypt-cracking hardware, because memory (not raw logic gates) is the more costly resource to scale in custom silicon.

Tuning Complexity and Practical Limits

Bcrypt has exactly one tuning knob — the cost factor, an exponent controlling the number of Blowfish key-setup rounds. This simplicity is a genuine advantage: there's very little a developer can misconfigure, and every mainstream language has a mature, well-tested Bcrypt library.

Scrypt's three parameters (N, r, p) interact with each other in ways that are easy to get wrong: an under-tuned N provides little real memory-hardness benefit, while an over-tuned N can allocate more memory per login attempt than a server can afford under concurrent load, risking out-of-memory conditions during a traffic spike or a deliberate denial-of-service attempt. Choosing safe, effective Scrypt parameters requires more deliberate thought than Bcrypt's single-value tuning.

Bcrypt also carries its well-documented 72-byte password truncation limit (inherited from Blowfish's key schedule) — any characters beyond the 72nd byte are silently ignored. Scrypt has no such practical length limit, since its construction is built on top of PBKDF2 and HMAC-SHA256 rather than a fixed-size cipher key.

Real-World Adoption and Ecosystem Maturity

Bcrypt's two-decade track record means it's implemented, audited, and battle-tested across effectively every server language and framework, with predictable, well-understood behavior. This maturity is a real security asset in its own right — a newer algorithm with less real-world scrutiny carries more implementation-risk uncertainty, even if its theoretical design is stronger.

Scrypt is also mature and standardized (RFC 7914) and is well-supported in most modern languages' cryptography libraries, though it sees somewhat less default usage in general-purpose web frameworks than Bcrypt or, increasingly, Argon2 — the industry's current default recommendation for new systems (see Bcrypt vs Argon2). Scrypt remains most prominent today in systems that adopted it early for its memory-hardness (certain cryptocurrency wallets and key-derivation contexts) rather than as the default suggestion for a brand-new password database.

Bcrypt Advantages & Disadvantages

Advantages / Pros

  • Extremely mature with over two decades of real-world scrutiny.
  • Trivially simple to configure correctly — one parameter, no interacting variables.
  • Universal, high-quality library support across virtually every language.

Disadvantages / Cons

  • Tiny memory footprint makes it comparatively cheap to attack with custom GPU/ASIC hardware.
  • Silent 72-byte password truncation is an easy-to-miss correctness trap.
  • No path to tune for memory-hardness at all — the algorithm architecturally can't provide it.

Scrypt Advantages & Disadvantages

Advantages / Pros

  • Genuine memory-hardness meaningfully raises the cost of custom cracking hardware.
  • No practical password length limit.
  • Formally standardized (RFC 7914) with mature library support.

Disadvantages / Cons

  • Three interacting parameters are easier to misconfigure than Bcrypt's single value.
  • Poorly-tuned memory allocation can create a denial-of-service risk under concurrent load.
  • Superseded as the default recommendation for new systems by Argon2, which adds side-channel protections Scrypt lacks.

Real-World Use Cases

Bcrypt

Legacy or existing user databases

Maintaining compatibility where Bcrypt is already the established hashing scheme and there's no specific driver to migrate.

Environments without native binary support

Projects where a pure-language Bcrypt implementation is easier to deploy than Scrypt's or Argon2's native bindings.

Scrypt

Cryptocurrency wallets and key derivation

Deriving encryption keys from a passphrase where memory-hardness against custom cracking hardware is a specifically important, well-established requirement.

Systems already standardized on Scrypt

Codebases or platforms where Scrypt is already the established KDF and switching to Argon2 isn't currently justified by a specific driver.

Developer Recommendation

For a brand-new password database in 2026, prefer Argon2id over both of these — it combines Scrypt's memory-hardness with side-channel protections neither Bcrypt nor plain Scrypt provide, and it's the current RFC 9106 / OWASP-recommended default. See Bcrypt vs Argon2 and Argon2 vs Scrypt for that comparison directly.

Between Bcrypt and Scrypt specifically: choose Scrypt whenever GPU/ASIC cracking resistance genuinely matters more than configuration simplicity — it meaningfully raises attacker cost over Bcrypt at the price of three parameters to tune correctly instead of one.

Choose Bcrypt when you're maintaining an existing system already built on it, when your deployment environment can't easily support Scrypt's or Argon2's native memory-tuning behavior, or when the simplicity of a single, well-understood parameter outweighs the additional hardware-resistance Scrypt provides.

Frequently Asked Questions

Why does Bcrypt limit password length to 72 bytes?
Bcrypt is built on the Blowfish cipher, whose key schedule caps out at 72 bytes of input. Anything beyond the 72nd byte is silently ignored rather than raising an error, which can be a subtle correctness trap for very long passphrases.
Is Scrypt actually harder to crack than Bcrypt?
For an attacker using custom hardware (GPUs or ASICs), yes — Scrypt's memory-hard design forces each parallel guess to consume a configurable, meaningfully large amount of memory, which is far more expensive to replicate at scale than Bcrypt's tiny, fixed memory footprint.
What do Scrypt's N, r, and p parameters actually control?
N is the CPU/memory cost factor (must be a power of two, and directly determines the memory buffer size), r controls the block size affecting memory bandwidth per iteration, and p controls parallelization. All three need to be tuned together to balance security against your server's actual available memory and CPU.
Should I choose Scrypt or Argon2 for a new project?
Argon2id is the current recommended default for new systems — it builds on the same memory-hardness idea Scrypt pioneered but adds protection against side-channel timing attacks that Scrypt doesn't provide. See Argon2 vs Scrypt for the direct comparison.
Can Scrypt cause a denial-of-service risk?
If tuned too aggressively for your server's available memory, yes — every concurrent login attempt allocates Scrypt's configured memory buffer, and a flood of simultaneous requests with an over-tuned N value can exhaust server RAM. Tune parameters against your actual expected concurrent load, not just theoretical security.
Is Bcrypt considered broken or insecure?
No — Bcrypt remains cryptographically sound and is still an acceptable choice, particularly for existing systems. Its weakness relative to Scrypt and Argon2 is specifically its lack of memory-hardness, not a break in the underlying Blowfish-based construction itself.

Part of the Hashing & Integrity Developer Hub

This comparison is part of our Hashing & Integrity topic guide, covering related tools, standards, and decision guidance.

Related Comparisons

Other technology decisions in the same topic area as Hashing & Integrity:

SHA256 vs SHA512

Cryptographic hash functions are designed to ingest arbitrary binary inputs and return a fixed-size, deterministic byte sequence called a digest. These functions must be one-way (infeasible to reverse-engineer) and collision-resistant (highly unlikely that two distinct inputs produce the same hash). In modern cryptography, the SHA-2 (Secure Hash Algorithm 2) family is the default choice for data integrity, SSL/TLS certificates, and blockchain networks. Within this family, SHA-256 and SHA-512 are the two most prominent algorithms. Surprisingly, their differences extend beyond digest length to internal block sizes, math architectures, and hardware parsing performance. This guide compares SHA-256 and SHA-512 in detail.

Read Guide

MD5 vs SHA1 vs SHA256

MD5 and SHA-1 are both cryptographically broken — not theoretically weak, but practically broken, with real, demonstrated attacks — while SHA-256 remains secure with no known practical attack. This comparison is less about a tradeoff between three roughly-equivalent options and more about understanding exactly why two of them were retired and what, if anything, they're still safe to use for.

Read Guide

HMAC vs Digital Signatures

Both HMAC and digital signatures let a recipient verify a message wasn't tampered with, but they answer a different second question: HMAC only proves the message came from someone who holds a shared secret, while a digital signature proves it came from the one specific party holding a private key — and only the second property, non-repudiation, actually holds up if the sender later denies sending it.

Read Guide

Argon2 vs Scrypt

Argon2 and Scrypt are both memory-hard — the defining property that separates them from Bcrypt (see Bcrypt vs Scrypt) — but Argon2 refines the idea with a hybrid access pattern specifically designed to resist both GPU cracking and side-channel timing attacks simultaneously, something plain Scrypt's single access pattern can't do at once.

Read Guide