How is the salting technique used in hashing for enhanced security?

2023

How is the salting technique used in hashing for enhanced security?

  1. A.

    It converts plain text into hashed text using the MD5 algorithm without adding any extra data.

  2. B.

    It adds a random value to the input data before hashing to make each hash unique.

  3. C.

    It encrypts the hashed data using a symmetric encryption algorithm.

  4. D.

    It stores the hash directly without any modification or additional data.

  5. E.

    It compresses the hash to reduce storage space.

Attempted by 59 students.

Show answer & explanation

Correct answer: B

Concept

Salting is a defence used with password hashing: a salt is a unique, random value generated per record and combined with the input before the hash function runs. The salt is stored alongside the resulting digest. Hashing on its own is deterministic, so identical inputs always produce identical digests; salting breaks that determinism per record.

Application

Because a distinct random salt is mixed into each input before hashing, two users who happen to choose the same password end up with completely different stored digests. This is exactly the behaviour described by adding a random value to the input before hashing so each hash becomes unique — it removes the one-to-one mapping between an input and its digest.

Why it strengthens security

  • Precomputed lookup tables (rainbow tables) become useless, because an attacker would need a separate table for every possible salt.

  • Two equal passwords no longer reveal that they are equal, since their digests differ.

  • Brute-force and dictionary attacks must be repeated per record instead of being amortised across all users at once.

Contrast with the other ideas

Idea

Why it does not match

Fixed algorithm (e.g. MD5) with no extra data

Stays deterministic: identical inputs collide to the same digest, so it adds no per-record uniqueness.

Symmetric encryption of the digest

That is reversible-with-a-key encryption layered after hashing, not randomness mixed into the input before a one-way hash.

Store the digest unchanged

Keeps the deterministic mapping and gives no protection against precomputed tables.

Compress the digest

Only changes storage size; does nothing for security.

Explore the full course: Niacl Ao It Specialist

Loading lesson…