Numbers To Know hard
Storing a password using a secure algorithm like bcrypt (cost 10) or Argon2 typically consumes how much storage per user?
- A 8 Bytes
- B 60 Bytes
- C 512 Bytes
- D 1 KB
Answer: B. 60 Bytes
Unlike simple hashing algorithms like MD5 (16 bytes) or SHA-256 (32 bytes), secure password KDFs (Key Derivation Functions) like bcrypt or Argon2 include significant metadata in their output. A standard bcrypt hash is exactly 60 characters long, encoding the algorithm version, the 'work factor' (cost), a 128-bit random salt, and the resulting 184-bit hash. While storing 60 bytes instead of 16 seems like a 4x increase in storage, it is a mandatory trade-off for security. This metadata ensures that even if two users have the same password, their hashes look completely different, preventing attackers from using 'Rainbow Tables' to crack the database.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the maximum allowed downtime per year for a system targeting '99.9%' (Three Nines) availability?
- What is the typical size of a standard ASCII character (e.g., 'A')?
- What is the typical Round Trip Time (RTT) for a single network packet traveling between New York and London (Transatlantic)?
- Network bandwidth is usually denoted in **bits** per second (Gbps), while storage is in **Bytes** (GB). What is the conversion ratio?
- How much power does a typical fully-loaded rack-mount server consume?
- What is the approximate bandwidth of a full PCIe 4.0 x16 slot (e.g., used by GPUs or high-end NVMe RAID)?