What Adds Complexity Before One-Way Hashing? Salting vs Key Stretching

SY0-701 By islever Editorial Last updated

Short answer

D Salting adds random data to a password before a one-way hash, making identical passwords produce different digests and defeating precomputed rainbow tables.

Question

Which of the following is used to add extra complexity before using a one-way data transformation algorithm?
  1. Key stretching
  2. Data masking
  3. Steganography
  4. Salting Correct Answer

Key Takeaways

The item tests whether you can distinguish pre-hash salting from repeated-hash key stretching; the trap is that both strengthen password storage but act at different stages.

Salting is the mechanism that adds unique random data to input before a one-way hash; this page establishes D as the answer and differentiates it from key stretching.

Common mistake: A is tempting because key stretching also strengthens password storage, but it repeats the one-way transformation to slow guessing rather than adding random data before the transformation.

Expert Analysis

Decoding the stem The phrase "one-way data transformation algorithm" is a deliberate synonym for a hash function: the output cannot be reversed to recover the input. The question asks what is applied to add complexity before that transformation, not what makes the transformation computationally expensive after the fact. That distinction decides between D. Salting and A. Key stretching.

Why salting fits Salting combines a unique random value with the password or other input before it is hashed. Two users with the same password then produce different digests, and a precomputed rainbow table built for the unsalted hash no longer works. Comments repeatedly describe exactly this: one notes that the salt is random data "combined with the input data... before applying a one-way transformation algorithm"; another explains that identical inputs no longer produce identical outputs. The operational consequence is direct: unsalted password stores make credential-stuffing and rainbow-table attacks cheap because the attacker can reuse one cracking effort across every matching hash.

Why the near miss fails A. Key stretching is adjacent and often deployed with salting, but it changes the number of iterations of the one-way function—hash the password, then hash the hash—to slow brute-force guessing. A comment accurately contrasts the two: key stretching "will hash the pw, then hash that, then hash the hash of the hash," whereas salting puts random material on the input. If the stem asked how to make a weak key harder to brute-force by repeatedly processing it, A would be the better answer. That is the scenario change that flips the choice. C. Steganography hides data inside a carrier and is unrelated to hash input. B. Data masking substitutes or redacts values for display/testing and does not protect a password hash.

Exam consequence In a real design review, confusing these controls leads to storing unsalted hashes or believing masking is cryptographic protection. The correct selection is D: salt first, then hash; add key stretching as a separate, complementary hardening layer when the standard requires it.

Official Reference

Exam Strategy

When a stem mentions a one-way transformation, translate it to hashing and ask where the extra material is applied. If it is combined with the password before hashing, choose salting; if the hash is repeated many times to slow guessing, choose key stretching. Eliminate steganography because it hides data in carriers, and data masking because it redacts fields for non-production use. Anchor each option to its stage—pre-hash input, post-hash iteration, or data display—rather than just whether it improves security.

Frequently Asked Questions

Why isn't key stretching the answer if it also strengthens password hashes?

Key stretching repeats the one-way transformation many times to slow guessing; it does not add unique random data to each input before hashing, which is the stem's "before" condition.

Does salting make a password hash reversible?

No. Salting ensures identical passwords produce different hashes and defeats precomputed rainbow tables, but hashing remains one-way; an attacker can still guess and hash candidate passwords.

Can salting and key stretching be used together?

Yes. A password-storage scheme often combines a unique salt with an adaptive/key-stretching function such as PBKDF2, bcrypt or Argon2 to make each guess slow.

More SY0-701 FAQ →

Discussion 13 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 13

  1. lauren2wright 👍 24
    D. Salting Salting involves adding random data to the input of a one-way hash function to ensure that the same input will produce different hash values, thus making it more difficult for attackers to use precomputed hash tables (rainbow tables) to reverse engineer the original input.
  2. MAKOhunter33333333 👍 7 Answered D
    Key stretching is used for weak keys, it will hash the pw, then hash that, then hash the hash of the hash and so forth. Makes the cracking process longer for the attacker Salting is adding random or unique extra character to the password so when cracked it is not the actual PW the attacker thinks
  3. JackExam2025 👍 5 Answered D
    Salting is primarily used to ensure that even if two users have the same password, their hashes will differ due to the unique random salt added to each password before hashing. This helps prevent attacks like rainbow table attacks, where precomputed hash values are used to reverse the hash back to the original password.
  4. Laraa 👍 3 Answered D
    Salting is a technique used to add extra complexity to data, such as passwords, before applying a one-way transformation algorithm like hashing. The salt is a random value that is combined with the input data (e.g., a password) to produce a unique output even if the input data is the same. This process prevents attacks such as rainbow table attacks and ensures that identical inputs do not result in identical hashes.
  5. 7d6fad2 👍 2 Answered D
    D. Salting - a one-way data transformation algorithm refers to a hashing function. Salting adds random data BEFORE hashing to increase complexity. Salting prevents rainbow table attacks, and hash reuse across identical passwords. Key Stretching repeats hashing, hashing the password, then hashing the hash, and hashing the hashed hash, and so forth.
Show 8 more comments
  1. id1setiawabs 👍 2 Answered D
    yes sirr.... Salting involves adding random data to the input of a one-way hash function to ensure that the same input will produce different hash values, thus making it more difficult for attackers to use precomputed hash tables or rainbow tables to do reverse engineer the original input.
  2. JunetGoyal 👍 2 Answered D
    Salting is correct: it involve to add random string of character to make hash value different for same input. Example if two users pick same password then hash value will be same but adding salting make those hash values different.
  3. buzzor 👍 1
    salting is adding of random data to an existing hash to in order to increase the integrity of the hash by then performing a hash function producing hash values. it is used to prevent rainbow table attack (using precomputed hash tables).
  4. Alive 👍 1 Answered A
    Enhancing the security of a password or key to make it harder and time consuming before it is processed by a one-way data transformation algorithm (such as a hash function). With more resistant to brute-force attacks.
  5. Cheenzz 👍 1 Answered D
    D as it is used in encryption to increase complexity to a password. Key stretching is related to increasing length of password, Data masking is hiding a portion of data like in credit card
  6. Hasss 👍 1 Answered C
    The extra complexity added before a one-way data transformation algorithm is salting,
  7. AryzBeats 👍 1 Answered D
    Salting is used to add complexity to the input of a one-way hash
  8. Temkeheight 👍 1 Answered B
    Data masking is to make complexity.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All SY0-701 Questions

Access 100 questions with complete answers and detailed explanations.

View Full SY0-701 Practice Test →

← Back to SY0-701 Study Guide