What Is Hashing? Security Definition
This page mentions older exam versions. See the Current Exam Context and Legacy Exam Context sections below for the updated mapping.
On This Page
What do you want to do?
Quick Definition
Hashing takes data of any size and turns it into a short, fixed-size code. This code, called a hash, is unique to that data and cannot be reversed to get the original data. It's used to check if files or passwords have been changed or to store passwords safely. Think of it like a digital fingerprint for data.
Common Commands & Configuration
certutil -hashfile C:\path\to\file.exe SHA256Computes the SHA-256 hash of a file on Windows. This is a native command available on all Windows systems, useful for verifying downloaded files against provided checksums.
The MD-102 and MS-102 exams may test your knowledge of Windows native hashing tools. Certutil is often the fastest built-in option without needing third-party software.
sha256sum /path/to/linux.isoComputes the SHA-256 hash of a file on Linux. This is part of the GNU coreutils and is the standard method for file integrity verification in Linux environments.
Security+ and CySA+ exams often use Linux examples for integrity checks. Knowing sha256sum and md5sum commands is expected for file verification scenarios.
Get-FileHash -Path C:\path\to\file.exe -Algorithm SHA256PowerShell cmdlet to compute file hash. Supports multiple algorithms including SHA1, SHA256, MD5, and SHA512. More flexible than certutil.
MD-102 and AZ-104 exams: PowerShell is the preferred scripting tool for Azure automation and Windows management. This cmdlet is tested in scenarios involving file integrity monitoring.
openssl dgst -sha256 -hmac "mysecretkey" myfile.txtComputes an HMAC-SHA256 tag for a file using a secret key. OpenSSL is cross-platform and commonly used for testing cryptographic operations.
CISSP and CySA+: HMAC usage is a key concept. This command demonstrates how HMAC combines key and hash. Exams may ask why HMAC is preferred over plain hashing for API authentication.
mkpasswd -m sha-512 mysupersecretpasswordGenerates a salted SHA-512 password hash on Linux. Used for /etc/shadow password storage. The command automatically adds a random salt.
Security+: Understand that Linux uses salted SHA-512 by default (yescrypt on newer systems). The exam tests the difference between salted and unsalted hashing.
bcrypt hash -c 10 mysupersecretpasswordGenerates a bcrypt hash with a cost factor of 10 (2^10 rounds). The output includes the salt, cost, and hash in a single string.
CISSP and CySA+: bcrypt is often preferred over SHA-based methods for passwords. The cost factor is testable: higher cost means slower hashing, making brute force harder.
Get-AADIntPasswordHash -UserPrincipalName user@domain.comAzure AD PowerShell module command to retrieve the password hash (as stored in Azure AD). Used in hybrid identity scenarios to verify synchronization.
MS-102: Password hash sync is a key concept. This command helps troubleshoot synchronization issues. Exam questions may ask about the hash format (SHA256 with salt) and how it differs from on-premises NTLM.
Hashing appears directly in 19exam-style practice questions in Courseiva's question bank — one of the most-tested concepts on CompTIA CySA+. Practise them →
Must Know for Exams
Hashing appears in virtually every major IT certification exam, often as a core objective. For CompTIA Security+ (SY0-601), hashing is listed under cryptography and PKI objectives. Expect questions about when to use hashing versus encryption, which algorithms are secure, and the concept of salting. The exam frequently presents a scenario: an organization needs to store passwords, verify software integrity, or ensure non-repudiation, and you must identify the right tool. Be ready to explain why SHA-256 is preferred over MD5 and why NTLM hashes are considered weak.
For CISSP, hashing is a critical part of the Cryptography domain. Questions can be deeper, covering HMAC, collision resistance, and the difference between MAC and hash functions. You may be asked to identify which algorithm provides the best collision resistance or which is appropriate for digital signatures versus password storage. The CISSP exam also expects you to know that salting is required for password hashes and that the use of unsalted hashes (like in older Windows systems) is a security flaw.
For AWS Solutions Architect Associate (SAA-C03), hashing relates to data integrity in services like S3 (you can enable checksum verification), DynamoDB (consistent reads), and the use of pre-signed URLs (which rely on hashing for signatures). The AWS exam may ask how to ensure data integrity when uploading to S3 using hashing features.
For Microsoft exams like MD-102, MS-102, SC-900, and AZ-104, hashing appears in the context of password storage, authentication protocols (NTLM, Kerberos), and security features like BitLocker (which uses hash-based integrity verification). You may need to understand how Windows stores local account password hashes and the role of hash functions in certificate services. Azure AD uses password hash synchronization for hybrid identities, and the SC-900 exam covers how hashing protects user credentials during that process.
For CySA+, hashing is relevant in forensic analysis: you must hash evidence to maintain chain of custody, verifying that the original evidence hasn't changed. The exam may present a scenario where you need to identify file tampering through mismatched hashes. For ISC2 CC, the core concepts align with Security+ basics.
Across all exams, expect multiple-choice questions that test your ability to differentiate hashing from encryption, recognize deprecated algorithms, and understand the practical application of salt. Simulation-style questions might ask you to select the correct command (like Get-FileHash on Windows or sha256sum on Linux) to verify file integrity. Memory tricks: remember that US secure standards = SHA, weak = MD5, password = bcrypt/scrypt/Argon2, integrity = SHA-256, MAC = HMAC.
Simple Meaning
Imagine you have a magic machine that can shrink any object, no matter how big, down to a small, unique keychain charm. You put in a whole car, and it gives you a tiny plastic car that looks exactly like it. You put in a single grain of sand, and it gives you a tiny speck. The important thing is that the machine always gives you the same tiny charm for the same object, and it never works backwards, you can't take the tiny charm and rebuild the car. That magic machine is like a hash function.
In the digital world, every file, password, or piece of information can be put through a hash function. The result is a short string of letters and numbers, called a hash or digest. If you change even one letter in the original file, the hash changes completely. This makes hashing perfect for checking if a file has been tampered with, if the hash matches, the file is exactly the same. It's also great for passwords: instead of storing your actual password, a system stores its hash. When you log in, it hashes what you type and compares it to the stored hash. That way, even if hackers steal the database, they only get the hashes, not your actual password.
Hashing is different from encryption because encryption is a two-way process: you can encrypt data and then decrypt it with a key. Hashing is one-way, there is no key to reverse it. This one-way property is what makes it so valuable for security. It's used in everything from verifying software downloads to building the blockchain that powers cryptocurrencies. For IT professionals, understanding hashing is essential for securing systems and passing certification exams.
Full Technical Definition
Hashing is a cryptographic process that takes an input of arbitrary length and produces a fixed-size output, known as a hash value, hash code, or digest, using a deterministic mathematical algorithm. The core principle is that the same input always yields the same hash, but even a tiny change in input produces a completely different hash, a property known as the avalanche effect. Hash functions are designed to be one-way (preimage resistant), collision-resistant, and computationally efficient.
There are several widely used hashing algorithms, each with different strengths and weaknesses. MD5 (Message Digest Algorithm 5) produces a 128-bit hash and was once popular, but it is now considered broken because collisions (two different inputs producing the same hash) can be created deliberately. SHA-1 (Secure Hash Algorithm 1) produces a 160-bit hash and suffered a similar fate. The SHA-2 family, which includes SHA-224, SHA-256, SHA-384, SHA-512, is currently the standard for many applications, including TLS/SSL certificates and digital signatures. SHA-3 is the newest NIST standard but is less widely deployed. For password storage specifically, specialized algorithms like bcrypt, PBKDF2, scrypt, and Argon2 are designed to be slow and memory-hard, making brute-force attacks computationally expensive.
In practical IT implementation, hashing appears in several key areas. Integrity checking: utilities like md5sum or sha256sum compute hashes for files; administrators distribute hashes alongside files so users can verify they haven't been corrupted or tampered with. Digital signatures: a message is hashed, then the hash is encrypted with the signer's private key; verifying the signature involves decrypting the hash and recomputing the hash of the original message. Password storage: /etc/shadow files on Linux store hashes of passwords using formats like $6$ for SHA-512. Windows uses NTLM hashes (which are actually extremely weak) and more modern Kerberos with hash-based authentication. Network security: protocols like IPsec and TLS use hashing within HMAC (Hash-Based Message Authentication Code) to verify that data hasn't been modified in transit.
Standards bodies like NIST (National Institute of Standards and Technology) publish and approve hash functions. For example, FIPS 180-4 defines SHA-1 and SHA-2, and FIPS 202 defines SHA-3. IT professionals must ensure that their systems use approved, current algorithms. Certifications like Security+ and CISSP emphasize choosing the right hash function for the job, for example, using SHA-256 or higher for forensic integrity, never MD5 for security purposes, and using salted hashes for passwords. A salt is a random value added to the input before hashing, ensuring that two users with the same password don't get the same hash, thwarting rainbow table attacks. Hashing is a pillar of modern cybersecurity, and a deep understanding is critical for both operations and exam success.
Real-Life Example
Think of hashing like mailing a letter through a very strict post office. You write your letter on a piece of paper, place it in an envelope, and seal it. Before you mail it, you weigh it on a special scale that tells you the exact weight in milligrams. You write that weight on your own copy of the letter. When your friend receives the envelope, they weigh it on an identical scale. If the weight matches exactly what you recorded, they know nobody opened the envelope or changed the letter inside. If someone added even a single extra sheet of paper, the weight would be different, and your friend would know it's been tampered with.
In this analogy, the letter is your data. The post office scale is the hash function, and the weight is the hash value. The scale gives you a single number (weight) that represents the entire contents of the envelope. If even one word is changed, the weight changes. The scale is one-way, you can't take the weight and reconstruct the letter. And the scale is consistent: the same letter always produces the same weight.
Now imagine a more advanced scenario. You send a whole library of books to a friend by shipping each book separately. To make sure none get swapped or tampered with, you weigh each book and create a list: "Book A: 342 grams, Book B: 511 grams, ..." Your friend can then weigh each received book against your list. But what if an attacker replaces one book with another of exactly the same weight? That's where a better scale comes in, one that weighs to the microgram, or one that also measures thickness and dimensions. In IT, hash functions like SHA-256 are so sensitive that the chance of two different inputs having the same hash is astronomically small. The analogy extends further: a salt is like spraying each book with a unique, invisible perfume before weighing. Even if two books are identical, their perfumed versions weigh differently, so the attacker can't guess the original weight just by knowing the scent. This is how salted hashes protect passwords.
Why This Term Matters
Hashing matters because it is one of the fundamental tools for ensuring data integrity and protecting secrets in IT systems. Without hashing, you wouldn't be able to verify that a downloaded software package isn't infected with malware, because you'd have no way to know if the file was modified after release. Imagine downloading a critical security update and getting a ransomware-laced copy instead, hashing allows your system to automatically reject any file whose hash doesn't match the official one.
In password security, hashing is the difference between a breach that exposes millions of real passwords (like the infamous Adobe breach) and one where attackers get only useless hash values. Properly hashed passwords with salts force attackers to spend enormous computational resources to crack even a single password, making mass theft impractical. For compliance frameworks like PCI DSS, HIPAA, and GDPR, hashing is often mandated for protecting sensitive data.
In network and system operations, hashing is used in almost every protocol for authentication and integrity. SSH uses hashing to verify that the server you are connecting to is the real one. Git uses hashing to track every version of your code. Blockchain technology relies entirely on hashing. For cloud engineers working with AWS S3, hashing ensures the integrity of data in transit and at rest. For administrators using Active Directory, Kerberos tickets are built on hash-based cryptography. Understanding hashing helps you choose the right algorithm, recognize when an outdated algorithm (like MD5) is a vulnerability, and implement password policies that actually protect users.
How It Appears in Exam Questions
Hashing questions in certification exams follow several common patterns. The most frequent is the 'choose the right tool' scenario: a system administrator needs to verify that a critical configuration file hasn't been modified after a suspected breach. The answer choices might include encryption, digital signatures, hashing, and compression. The correct answer is hashing with SHA-256, because you just need integrity, not confidentiality. Another common pattern involves password storage: a case study describes a company that stores passwords in plaintext (or using MD5) and you need to recommend the most secure alternative. The answer typically involves salting and using a slow hash function like bcrypt.
Another question type tests your understanding of the one-way property. The question might say: 'A security team has the hash of a known malware sample. They want to find the original malware executable from the hash. Which statement is true?' The correct answer explains that hashing is one-way, so you cannot reverse the hash, but you can compare the hash against a database of known malware hashes. A variation asks about collision resistance: 'Two different files produce the same SHA-256 hash. What is this called, and what is the risk?' The answer is a collision, and the risk is that an attacker could substitute a malicious file for a legitimate one.
Configuration-related questions appear in cloud exams. For AWS SAA, you might get: 'A company uploads files to S3 and needs to ensure they are not corrupted during transfer. Which feature should be enabled?' The answer is S3 checksums (using SHA-256 or CRC-32). Or: 'An application stores user passwords. The development team wants to use a hash function that is resistant to rainbow table attacks. What should they implement?' The answer is to add a random salt to each password before hashing. Troubleshooting questions may involve mismatched hashes during software deployment or file copies, requiring you to identify that a file was corrupted or tampered with.
For Microsoft exams, you might see: 'A security audit finds that Windows domain controllers use NTLMv1 hashes. What is the vulnerability, and how should it be addressed?' The answer involves the weakness of the hash algorithm and the recommendation to enable Kerberos or at least NTLMv2. Another question: 'An Azure AD tenant is configured for password hash synchronization. What is the purpose of the hash?' The answer is to allow authentication without storing the actual password in the cloud. These questions reward understanding of both the theory and the practical deployment context of hashing.
Practise Hashing Questions
Test your understanding with exam-style practice questions.
Example Scenario
You are an IT administrator for a mid-sized company. Your manager asks you to implement a system where employees can securely log into the company portal without storing their actual passwords in the database. You decide to use hashing.
First, you create a registration page. When a new employee, Alice, creates an account, she types her password 'Purpl3D0lphin!'. Your code immediately generates a random 16-character string, for example 'xK7#mQ9!zL2&vB5$'. This is the salt. Then, your code combines the password and the salt: 'Purpl3D0lphin!xK7#mQ9!zL2&vB5$'. This combined string is fed into the SHA-256 hash function, producing a 256-bit hash value like 'a1b2c3d4e5f6...'. Your system stores the salt and the hash, but never the actual password. The next day, when Alice logs in, she types her password again. Your system retrieves the salt, combines them, and hashes the result. If the hash matches the stored hash, access is granted. If she mistypes, the hash will be completely different and the login fails.
Now consider an attacker who steals the database. They see only 'xK7#mQ9!zL2&vB5$' and 'a1b2c3d4e5f6...'. They cannot reverse the hash to get 'Purpl3D0lphin!'. Even if Alice had used a simple password like 'password', the salt makes it unique, so precomputed rainbow tables are useless. However, if you had used MD5 instead of SHA-256, and if you had not salted the hash, the attacker could quickly crack many passwords because MD5 is fast and unsalted hashes are vulnerable. Your choice of hash algorithm and your use of salting directly determine how secure your users' passwords are.
Common Mistakes
Believing hashing and encryption are the same thing.
Encryption is reversible with a key, while hashing is one-way. Using encryption for password storage means the decryption key could be compromised, exposing all passwords.
Remember: encryption protects confidentiality (secrecy), hashing protects integrity (verification) and is used for password storage because it cannot be reversed.
Using MD5 or SHA-1 for security-sensitive operations like password storage or digital signatures in modern systems.
MD5 and SHA-1 have known collision vulnerabilities. An attacker can intentionally create two different inputs that produce the same hash, breaking integrity guarantees.
Always use a member of the SHA-2 family (like SHA-256 or SHA-512) or SHA-3 for security purposes. For passwords, use bcrypt, PBKDF2, scrypt, or Argon2.
Storing password hashes without a salt.
Without a salt, the same password always produces the same hash. Attackers can use precomputed rainbow tables to quickly reverse common passwords.
Always generate a unique, random salt for each user and store it alongside the hash. Combine the salt and password before hashing.
Thinking a longer input always produces a longer hash.
Hash functions produce a fixed-size output regardless of input length. SHA-256 always yields 256 bits, whether the input is one byte or one gigabyte.
Understand that fixed-length output is a feature, not a bug. It allows efficient verification of any file size.
Assuming hashing guarantees data confidentiality (secrecy).
Hashing does not hide the input if the input is short or predictable. An attacker can guess a password, hash it, and compare the hash to the stored hash (brute force attack).
Use hashing for integrity and password verification, but combine it with salts and slow algorithms to mitigate brute force. Never rely on hashing alone for secrecy.
Reusing a hash algorithm across different contexts without considering performance trade-offs.
Fast hash functions like SHA-256 are great for integrity checking, but terrible for passwords because attackers can also compute them quickly. Slow algorithms are needed for passwords.
Match the hash algorithm to the use case: fast SHA-256 for file integrity, slow bcrypt for passwords.
Exam Trap — Don't Get Fooled
{"trap":"The exam describes a scenario where a company stores passwords using the SHA-256 algorithm and claims it is secure because SHA-256 is a strong hash function. The correct answer is that this is still insecure without salting.","why_learners_choose_it":"Learners know SHA-256 is strong and assume that any use of a strong hash is automatically secure.
They may overlook the requirement for salting because the scenario didn't explicitly mention it.","how_to_avoid_it":"Always check if salting is mentioned. Even the best hash function (SHA-3) is vulnerable to rainbow table attacks if used without a salt.
On the exam, if the scenario says 'stored using SHA-256 only,' the missing salt is the vulnerability."
Commonly Confused With
Encryption is a two-way process that transforms data using a key so that it can be decrypted back to its original form. Hashing is one-way and cannot be reversed. Encryption protects confidentiality, while hashing protects integrity. If you encrypt a password, you must store the decryption key (bad for security). If you hash a password, no key exists (better).
Encryption: sending a secret message that can be read by the recipient with a key. Hashing: checking if a file was modified by comparing its digital fingerprint.
A checksum is a simple error-detection code used to detect accidental changes in data, like a corrupted download. It is not cryptographically secure, meaning an attacker can intentionally alter data and recalculate the checksum. A cryptographic hash (like SHA-256) is designed to resist intentional tampering. For security-sensitive integrity checks, always use a cryptographic hash.
Checksum: used in network packets to detect random noise. Hashing: used to verify that a downloaded ISO is the official, unmodified release.
HMAC combines a cryptographic hash function with a secret key. While a plain hash provides integrity (data hasn't changed), HMAC provides both integrity and authentication (the data came from a party that knows the key). HMAC is used in protocols like TLS and IPsec. A plain hash without a secret key does not verify the source of the data.
Hashing: verifying a downloaded file's integrity using the publisher's posted hash. HMAC: ensuring that a message sent between two systems hasn't been modified and actually came from the authorized sender.
A digital signature uses asymmetric cryptography: the sender hashes a message, then encrypts the hash with their private key. The receiver decrypts the hash with the sender's public key and compares it to a freshly computed hash. A digital signature provides non-repudiation (the sender cannot deny sending it) in addition to integrity. A simple hash, without encryption, does not offer non-repudiation.
Hashing: you compute SHA-256 of a contract to later prove it hasn't changed. Digital signature: you sign the contract with your private key so the recipient can prove it came from you and hasn't changed.
Encoding transforms data into a different format using a reversible algorithm. It is not designed for security at all. Base64 encoding can be trivially reversed. Hashing is designed to be one-way and secure. Confusing encoding with hashing can lead to false sense of security.
Encoding: converting binary image data into ASCII text for email attachment. Hashing: converting a password into a fixed-length digest that cannot be converted back.
Step-by-Step Breakdown
Select the Input Data
The process begins with any digital data: a file, a message, a password, or an entire database. The input can be of any length, from a single character to gigabytes of information. The hash function will operate on this input.
Apply the Hash Function
The hash function (like SHA-256) processes the input through a series of mathematical operations, including bitwise operations, modular additions, and compression functions. This is the core algorithm that produces a fixed-size output. The specific calculations depend on the algorithm, but the result is always the same length for that function.
Generate the Hash Value (Digest)
The output of the hash function is a fixed-length string, typically represented in hexadecimal form or Base64. For SHA-256, this is 256 bits (32 bytes) long, often shown as 64 hex characters (e.g., 'a1b2c3d4e5f6...'). This value is the digital fingerprint of the input data.
Store or Transmit the Hash
The hash value can be stored alongside data (like a password hash in a database) or published separately (like a checksum file on a software download page). The hash itself does not need to be kept secret, but it must be protected from unauthorized modification to maintain integrity verification.
Verify Integrity by Re-hashing
Later, when you need to verify that the original data has not changed, you run the same hash function again on the current data. If the new hash matches the original stored hash, the data is intact. If even one bit has changed, the hash will be completely different.
Salting (for Passwords)
Before hashing a password, a unique random value called a salt is generated for each user. The salt is concatenated with the password (e.g., password + salt), and then that combined string is hashed. The salt is stored alongside the hash in plaintext. This ensures that the same password yields different hashes for different users and makes rainbow table attacks infeasible.
Use Keyed Hash (HMAC) for Authentication
If you need to ensure both integrity and that the message came from a specific sender, you use an HMAC. Instead of hashing just the message, you hash the message combined with a secret key. The receiver, who has the same key, can recompute the HMAC and verify it. This prevents an attacker without the key from creating a valid hash for a tampered message.
Practical Mini-Lesson
In practice, hashing is something you will configure, verify, and rely on daily as an IT professional. When you download a Linux ISO from the internet, you should always check the SHA-256 checksum. The command on Linux is 'sha256sum downloaded-file.iso' then compare the output with the hash provided on the official website. On Windows, you can use 'certutil -hashfile downloaded-file.iso SHA256' or the PowerShell cmdlet 'Get-FileHash'. This simple step prevents you from using modified or corrupted software.
For password storage, the best practices are evolving. As of 2025, you should not write your own hashing code. Instead, use a library function like PHP's password_hash() which defaults to bcrypt, or Python's hashlib with PBKDF2. These libraries handle salting and algorithm selection for you. In databases, the hash and salt are stored together in a single string format (e.g., $2y$10$salt$hash for bcrypt). Never truncate or modify this string.
What can go wrong? If you use an outdated algorithm like MD5 for a new system, your security audit will flag it. If you forget to salt passwords, a breach could expose user credentials almost instantly. If you use a fast hash function like SHA-256 for passwords, attackers can guess billions of passwords per second on modern hardware. If your application compares hashes using a simple string equality check, it may be vulnerable to timing attacks, an attacker can measure how long the comparison takes to narrow down the correct hash. The secure alternative is to use a constant-time comparison function.
For forensic investigators, hashing is used to preserve the chain of custody. When you acquire a disk image, you compute its hash immediately and document it. Later, you can re-hash the image to prove it hasn't been altered since acquisition. In incident response, you may hash a suspicious file and compare it against VirusTotal or other threat intelligence databases. If the hash matches a known malware signature, you can identify the threat rapidly.
In the cloud, AWS S3 supports automatically calculating checksums for uploaded objects using various algorithms, including SHA-256. You can enable S3 server side encryption with checksums to ensure data integrity during transfer and storage. In Azure, storage accounts offer checksum verification for blob storage. Understanding these features can help you answer cloud certification questions and implement secure cloud architectures.
Collision Resistance in Cryptographic Hash Functions
Collision resistance is one of the foundational security properties of a cryptographic hash function. It guarantees that it is computationally infeasible to find two distinct inputs that produce the same hash output. This property is critical in digital signatures, file integrity verification, and password storage because any collision undermines the uniqueness and trustworthiness of the hash. For example, if an attacker could find two different messages with the same hash, they could substitute a legitimate digital signature with a fraudulent one without detection.
In exam contexts, especially for Security+ and CISSP, collision resistance is often tested alongside preimage resistance and second-preimage resistance. Preimage resistance means given a hash, you cannot find any input that produces it. Second-preimage resistance means given an input, you cannot find a different input with the same hash. Collision resistance is the strongest of the three because it allows the attacker to choose both inputs. Modern hash functions like SHA-256 provide 128 bits of collision resistance, meaning the attacker would need roughly 2^128 attempts to find a collision by brute force.
Weaknesses in older hash functions, such as MD5 and SHA-1, are well-documented. MD5 has known collision attacks that can be executed in seconds on consumer hardware. SHA-1 collisions, demonstrated in the SHAttered attack (2017), required significant but feasible computation. As a result, both are deprecated and should not be used in new systems. The use of SHA-256 or SHA-3 is recommended for applications requiring collision resistance.
Exam questions often ask which property is broken when two files share the same hash. The correct answer is collision resistance. Another common scenario involves certificate authorities and digital signatures: if a hash collision is found, an attacker could create a rogue certificate with the same hash as a legitimate one. This is exactly why CA/Browser forums have moved to require SHA-256 certificates. Understanding collision resistance helps security professionals evaluate the strength of hashing algorithms in protocols like TLS, SSH, and IPsec.
Collision resistance also applies to message authentication codes (HMAC) and blockchain technologies. In blockchain, each block’s hash includes the previous block’s hash, creating a chain. A collision would break the entire chain because two blocks could have the same identifier. This is why Bitcoin uses double SHA-256 and Ethereum uses Keccak-256, both designed with high collision resistance. Security professionals must be able to identify when collision resistance is required versus when a simpler hash (like for non-cryptographic checksums) is acceptable.
Password Hashing vs General Purpose Hashing
A common mistake in security is using a general-purpose cryptographic hash like SHA-256 for password storage. While SHA-256 is perfectly fine for file integrity and digital signatures, it is completely unsuitable for passwords because it is designed to be fast. Attackers can compute billions of SHA-256 hashes per second using GPUs, making brute-force and dictionary attacks trivial. Password storage requires slow, adaptive hash functions specifically designed to resist such attacks.
Password-specific hashing algorithms, such as bcrypt, scrypt, PBKDF2, and Argon2, incorporate key stretching and salting. Salting adds a unique random value to each password before hashing, ensuring that identical passwords produce different hashes. This prevents attackers from using precomputed rainbow tables. Key stretching means the algorithm is intentionally slow: bcrypt uses a cost factor (e.g., 10 or 12) that doubles the work for each increment. Argon2, the winner of the Password Hashing Competition, also allows tuning memory usage, CPU time, and parallelism.
In exam scenarios for Security+, CISSP, and CySA+, you might see questions about why a company should switch from SHA-256 to bcrypt for password storage. The answer focuses on the speed of SHA-256 and the lack of built-in salting. Another common question asks about the purpose of a salt: to prevent rainbow table attacks. It is also important to understand that password hashes should never be used for integrity checks because they are designed to be slow, which would be inefficient for large file verification.
Modern identity systems like Active Directory use NT LAN Manager (NTLM) and NTLMv2 hashes, but these are considered weak. Azure AD and Office 365 use password hash synchronization with SHA-256 internally, but only after applying a salt and multiple iterations (effectively PBKDF2-like). The MS-102 and SC-900 exams may test your understanding of how Azure AD Connect handles password hashes and the importance of enabling password hash sync with additional security features like password protection.
For AWS SAA, the scenario often involves using AWS Secrets Manager or DynamoDB to store hashed passwords. The exam note is that Lambda functions should handle password hashing with bcrypt or similar, not plain SHA-256. The key takeaway: never reuse general-purpose hashing for passwords; always use a dedicated password hashing function with salting and a work factor.
File Integrity Verification with Hashing
File integrity verification is one of the most fundamental uses of cryptographic hashing. By computing a hash of a file at a known good state and later recomputing it, you can detect any unauthorized modification. This is a core concept in security operations, incident response, and compliance. Tools like Tripwire, AIDE, and Windows File Integrity Checks (sfc) rely on hashing to monitor critical system files.
In the context of exam domains such as Security+ and CySA+, you will encounter scenarios where an administrator uses hashes to verify downloaded software or firmware. For example, after downloading a Linux ISO, the website provides a SHA-256 checksum. The administrator computes the hash and compares it. If they match, the file is intact. If they differ, the file may be corrupted or tampered with. The exam tests your understanding that this method ensures integrity, not confidentiality or authenticity. To guarantee authenticity, you would also need a digital signature from the publisher.
Another common use is in incident response. When analyzing a compromised machine, a responder takes forensic images and calculates their hashes (e.g., SHA-256). These hashes serve as evidence that the image has not been altered during analysis. In court, the hash is used to prove the chain of custody. The CISSP and CySA+ exams may ask which property of hashing makes it suitable for forensic evidence: collision resistance and deterministic output.
Windows systems use the system file checker (sfc /scannow) which compares file hashes against an authoritative baseline stored in %WinDir%\System32\dllcache. If a hash mismatch is found, the tool restores the original file. The MD-102 exam covers this as part of device management and security baselines. In Azure, you can use Azure File Integrity Monitoring, which leverages hashing to detect changes to critical files on virtual machines. The AZ-104 exam may ask how to enable guest-level file integrity monitoring using Log Analytics.
For AWS SAA, you might use Amazon S3 object tags and hashing to verify cloud storage objects. S3 supports bitrot detection using the MD5 checksum (ETag), but for stronger integrity, you can compute your own SHA-256 hash as a metadata field. The exam emphasizes that hashing alone does not protect against man-in-the-middle attacks during transfer; you need TLS or client-side encryption. Always verify the hash over a trusted out-of-band channel.
Hashing in Digital Signatures and HMAC
Hashing is the engine behind digital signatures and Hash-Based Message Authentication Codes (HMAC). A digital signature does not sign the entire message, which would be inefficient; instead, it signs the hash of the message. The signer creates a hash, encrypts it with their private key, and sends the signature along with the message. The verifier computes the hash of the received message, decrypts the signature using the public key, and compares the two. If they match, the message is authentic and integrity is confirmed.
This process relies on the collision resistance and preimage resistance of the hash function. If an attacker can find a collision, they could swap messages without detection. The security of RSA, ECDSA, and EdDSA signatures all depend on the underlying hash algorithm. For example, RSA with SHA-256 is standard, while older signatures using SHA-1 are considered vulnerable. The CISSP and Security+ exams frequently ask which algorithm is used for the hash in a digital signature: typically SHA-256 or SHA-3.
HMAC is a specific construction used for message authentication without public-key cryptography. It combines a secret key with the hash function to produce a tag. HMAC-SHA256 is widely used in API authentication (e.g., AWS Signature V4), TLS handshakes, and OAuth tokens. The strength of HMAC depends on the hash function and the secrecy of the key. A common exam question for AWS SAA is: why does AWS use HMAC-SHA256 for signing requests? The answer: it provides both integrity and authentication without requiring a full digital certificate.
In the context of MS-102 and SC-900, Microsoft uses HMAC for token validation in Azure AD. For example, the ID token and access token in OpenID Connect and OAuth 2.0 are signed using HMAC or RSA depending on the key type. The exam tests your understanding of token signing and validation as part of identity security. You should know that hashing is used in both the signing key and the payload hash.
For CySA+ and incident response, understanding HMAC is crucial for analyzing log integrity. Many log management systems use HMAC to ensure that logs have not been altered between generation and analysis. If a log entry is tampered with, the HMAC tag will not match, alerting the analyst. The exam may present a scenario where an attacker modifies a log file and the HMAC validation fails, indicating a breach. The takeaway: hashing is not just about passwords; it is the bedrock of modern authentication and integrity.
Troubleshooting Clues
Password Hash Sync Failing
Symptom: Users cannot authenticate via Azure AD with their on-premises password, and AAD Connect reports a sync error.
Azure AD Connect uses a salted SHA-256 hash derived from the on-premises password hash. If the sync fails, the hash may be incomplete or the connection to Azure AD is broken. Common causes include network issues, proxy settings, or the password hash sync feature being disabled.
Exam clue: MS-102 exam: Questions test your ability to troubleshoot password hash sync by checking the AAD Connect health dashboard and event logs for sync failures.
File Hash Mismatch After Download
Symptom: After downloading a software ISO, the computed SHA-256 hash does not match the published hash on the vendor site.
This indicates the file has been altered either due to a corrupted download, a man-in-the-middle attack, or a compromised vendor server. The hash mismatch warns that integrity is compromised; the file should not be used.
Exam clue: Security+ exam: This scenario tests understanding of integrity verification. The correct response is to discard the file and re-download from a trusted source over a secure connection.
Collision Attack on MD5 Certificates
Symptom: Certificate revocation list (CRL) shows many certificates were revoked due to 'MD5 collision detected'.
Attackers leveraged the known collision weakness in MD5 to generate two certificates with identical hashes, one legitimate and one malicious. The CA had to revoke all MD5-signed certificates. This is a textbook failure of collision resistance.
Exam clue: CISSP exam: Questions about MD5 and SHA-1 deprecation are common. Recognize that collisions break trust in certificates, and SHA-256 is the minimum required.
bcrypt Hash Verification Fails on Login
Symptom: User enters correct password but login fails; bcrypt compare returns false.
Possible causes: 1) The stored hash was generated with a different cost factor than the verification function expects. 2) The user database has a malformed hash string (e.g., missing salt). 3) The application code has a bug in how it extracts the hash from the database.
Exam clue: CySA+ exam: Troubleshooting authentication involves checking the hash format, salt inclusion, and cost parameter consistency. The candidate should know that bcrypt hashes include all required info in the string.
HMAC Token Validation Fails in AWS
Symptom: AWS API calls return 'SignatureDoesNotMatch' error even though the access key and secret key are correct.
The HMAC signature computation is sensitive to the exact string-to-sign, including the HTTP method, URI, query string, headers, and timestamp. A common mistake is an incorrect header order (especially x-amz-date) or a missing newline. The secret key must be exactly the same as stored.
Exam clue: AWS SAA exam: Tested via scenario questions about IAM permissions or API request signing. The candidate must understand that HMAC signs the request payload and headers, and any deviation causes a mismatch.
Salted Hash Not Matching Across Systems
Symptom: Two systems generate different hashes for the same password even though both use SHA-256.
If each system uses a random salt (as they should), the same password will produce different hashes. This is expected behavior for password storage. The only way to verify a password is to store the salt alongside the hash and recompute the hash with that specific salt.
Exam clue: Security+ exam: Questions about salts and why they make hashes unique per system. The candidate should know that comparing raw hashes is useless; salts must be stored to enable verification.
BitTorrent Hash Mismatch (Bit Rot)
Symptom: During download, the hash of a file chunk does not match the expected hash recorded in the torrent metadata.
This is a classic example of hash-based integrity verification in peer-to-peer networks. The mismatch indicates the chunk is corrupted, either due to storage bit rot, transmission errors, or malicious modification. The client will re-request the chunk from a different peer until a valid hash is obtained.
Exam clue: CySA+ exam: Understanding how BitTorrent uses hashing for integrity is analogous to forensic hashing. The candidate should recognize that hashing alone cannot fix the problem, it only detects it.
Memory Tip
HASH: Hashing is a one-way street to a Fixed-size Digest – use SHA-2 for Integrity, Salt for Passwords, HMAC for Authentication.
Learn This Topic Fully
This glossary page explains what Hashing means. For a complete lesson with labs and practice, see the topic guide.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
CISSPCISSP →CS0-003CompTIA CySA+ →SY0-701CompTIA Security+ →MD-102MD-102 →MS-102MS-102 →AZ-104AZ-104 →SC-900SC-900 →ISC2 CCISC2 CC →200-301Cisco CCNA →SAA-C03SAA-C03 →N10-009CompTIA Network+ →220-1102CompTIA A+ Core 2 →SOA-C02SOA-C02 →CDLGoogle CDL →Legacy Exam Context
Older materials may mention these exam versions, but learners should use the current objectives for their target exam.
SY0-601SY0-701(current version)Related Glossary Terms
Two-factor authentication (2FA) is a security method that requires two different types of proof before granting access to an account or system.
AAA (Authentication, Authorization, and Accounting) is a security framework that controls who can access a network, what they are allowed to do, and tracks what they did.
An A record is a type of DNS resource record that maps a domain name to an IPv4 address.
A/B testing is a controlled experiment that compares two versions of a single variable to determine which one performs better against a predefined metric.
Quick Knowledge Check
1.Which property of a cryptographic hash function ensures that it is computationally infeasible to find two different inputs that produce the same output?
2.Why is SHA-256 considered unsuitable for storing passwords?
3.What is the primary purpose of adding a salt to a password before hashing?
4.In the context of digital signatures, what does the signer actually encrypt?
5.An audit finding shows that a server uses MD5 to verify file integrity. What is the primary security risk?
Frequently Asked Questions
What is the difference between a hash and a checksum?
A checksum is a simple error-detection code used to detect accidental changes, like a corrupted file after a download. A cryptographic hash is designed to be secure against intentional tampering. Always use a cryptographic hash (like SHA-256) for security-sensitive purposes.
Can a hash be reversed to get the original data?
No, hash functions are one-way by design. You cannot mathematically reverse a hash to discover the original input. The only way to find the input is to guess possible inputs, hash them, and compare the results, which is called brute force or dictionary attack.
Why is MD5 considered insecure?
MD5 has known collision vulnerabilities, meaning an attacker can create two different files that produce the same MD5 hash. This breaks the integrity guarantee and allows an attacker to substitute a malicious file for a legitimate one without detection.
What is a salt in hashing?
A salt is a random, unique value added to the input (like a password) before hashing. It ensures that even if two users have the same password, their hashes will be different. Salting prevents attackers from using precomputed tables (rainbow tables) to crack many passwords at once.
Why is bcrypt preferred over SHA-256 for passwords?
bcrypt is designed to be computationally slow, making brute force attacks take much longer. SHA-256 is very fast, allowing attackers to test billions of password guesses per second. bcrypt also automatically includes a salt. For password storage, always use a slow, salted hash function.
Does hashing provide any kind of confidentiality?
No, hashing does not hide the input. If the input is short or predictable, an attacker can guess it and hash their guess to compare. Hashing is for integrity verification, not for secrecy. For confidentiality, use encryption.
What is a rainbow table attack?
A rainbow table is a precomputed list of hashes for common passwords. If a system stores unsalted password hashes, an attacker can simply look up the hash in the table to find the original password. Salting makes rainbow tables useless because each user's password has a unique salt added before hashing.
Summary
Hashing is a foundational concept in IT security, serving as a one-way mathematical function that converts any data into a fixed-size digital fingerprint. Its primary purpose is to verify data integrity and securely store passwords. Unlike encryption, hashing is not reversible, which makes it ideal for scenarios where the original data should never be retrieved, such as password verification.
In certification exams, hashing appears across multiple domains including cryptography, security operations, cloud computing, and identity management. Candidates must understand the differences between hash functions (MD5, SHA-1, SHA-2, SHA-3), recognize deprecated algorithms that create vulnerabilities, and know when to apply salting and keyed hashes (HMAC). Common exam traps include confusing hashing with encryption, neglecting to use a salt, or assuming that a fast hash like SHA-256 is appropriate for password storage.
The key takeaway for exam success is to always match the hash algorithm to the use case: fast SHA-256 for integrity checks of files, slow bcrypt/Argon2 for password storage, and HMAC for authenticated communications. By mastering these distinctions and the practical steps of salting and verification, you will be well-prepared for any hashing question across the major IT certification exams.