What Adds Complexity Before One-Way Hashing? Salting vs Key Stretching
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
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
- https://www.comptia.org/en-us/certifications/security/
- https://pages.nist.gov/800-63-3/sp800-63b.html
- https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
These links open the official vendor documentation in a new tab.
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?
Does salting make a password hash reversible?
Can salting and key stretching be used together?
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
-
lauren2wright 👍 24D. 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.
-
MAKOhunter33333333 👍 7 Answered DKey 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
-
JackExam2025 👍 5 Answered DSalting 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.
-
Laraa 👍 3 Answered DSalting 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.
-
7d6fad2 👍 2 Answered DD. 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
-
id1setiawabs 👍 2 Answered Dyes 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.
-
JunetGoyal 👍 2 Answered DSalting 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.
-
buzzor 👍 1salting 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).
-
Alive 👍 1 Answered AEnhancing 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.
-
Cheenzz 👍 1 Answered DD 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
-
Hasss 👍 1 Answered CThe extra complexity added before a one-way data transformation algorithm is salting,
-
AryzBeats 👍 1 Answered DSalting is used to add complexity to the input of a one-way hash
-
Temkeheight 👍 1 Answered BData masking is to make complexity.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SY0-701 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SY0-701 Practice Test →