# Integrity

> Source: Courseiva IT Certification Glossary — https://courseiva.com/glossary/integrity

## Quick definition

Integrity means that the information you are looking at is exactly what it was when it was created or sent, with no changes made by anyone who should not have changed it. It is like a sealed envelope that shows clear signs if it has been opened and resealed. In IT, maintaining integrity ensures that files, messages, and databases stay correct and trustworthy.

## Simple meaning

Imagine you write a letter to a friend. You fold it, put it in an envelope, and seal it with a wax stamp. You hand it to a messenger. Along the way, someone could open the envelope, read the letter, change some words, and reseal it with a new stamp. Your friend would receive the letter, but it would no longer say what you originally wrote. That loss of trust, where the message is no longer as you sent it, is a breach of integrity. 

 In the digital world, integrity is a core security goal. It means that data stays whole and unchanged throughout its entire journey. When you download a file from a website, integrity ensures that the file you get is exactly the same as the file that was uploaded. When you send an email, integrity means no one in the middle can alter the message without detection. Integrity does not necessarily keep the data secret, that is confidentiality, but it does tell you whether the data has been messed with. 

 We rely on integrity in everyday digital life without even thinking about it. When you see the padlock icon in your browser, part of what that means is that the web server and your computer have agreed on a way to check that no information was changed during transit. Integrity is crucial for financial transactions, legal documents, medical records, and any situation where knowing that data is exactly as it should be is critical for trust and decision-making.

## Technical definition

In information security, integrity is one of the three primary pillars of the CIA triad, alongside confidentiality and availability. Integrity refers to the protection of data from unauthorized modification or destruction, ensuring that data remains accurate, consistent, and trustworthy over its entire lifecycle. This includes data at rest (stored on disks or databases), data in transit (moving across networks), and data in use (being processed by applications). 

 Achieving integrity relies on several cryptographic mechanisms. The most common is hashing. A hash function (such as SHA-256 or MD5) takes an input of any size and produces a fixed-length string of characters called a hash value or digest. Any change to the input, even a single bit, produces a completely different hash. By computing the hash of data before and after transmission and comparing the two, you can detect any alteration. However, hashing alone does not prove who performed the alteration or who sent the data. That is where message authentication codes (MACs) and digital signatures come in. 

 A keyed-hash message authentication code (HMAC) uses a shared secret key combined with a hash function to create a unique authentication tag. Only parties who know the secret key can generate a valid tag. This provides both integrity verification and origin authentication in symmetric-key systems. For asymmetric systems, digital signatures are used. A sender signs a message with their private key, and the recipient verifies the signature with the sender’s public key. A valid signature proves the message was not altered and came from the claimed sender. This is foundational in PKI (Public Key Infrastructure) and SSL/TLS certificates. 

 In practice, integrity is enforced at multiple layers. At the network layer, IPsec uses integrity check values (ICVs) on packets. At the transport layer, TLS uses HMACs (or modern AEAD ciphers) to ensure data stream integrity. At the application layer, file integrity monitoring tools (like Tripwire or AIDE) compute hashes of critical system files and alert administrators when those hashes change, indicating possible tampering. Database systems enforce integrity through constraints such as primary keys, foreign keys, and unique constraints, ensuring data consistency. Version control systems like Git rely heavily on SHA-1 hashes to guarantee the integrity of the entire project history. 

 Integrity also applies to software distribution. Code signing uses digital signatures to verify that a software application has not been modified since it was signed by the developer. Operating systems and browsers check these signatures before allowing installation, reducing the risk of malware. Without integrity, attackers could inject malicious code into legitimate updates, as seen in supply chain attacks. Thus, integrity is not just a theoretical concept but a practical, enforced requirement in countless IT systems and protocols.

## Real-life example

Think about sending a sealed package through a courier service. You place an expensive watch inside a box, seal it with tamper-evident tape, and write your signature across the tape. The courier picks it up and delivers it to your friend. When your friend receives the package, they first check that the tape is still intact and that your signature has not been broken or smudged. If everything looks fine, they open it confident that the watch inside is exactly what you sent. If the tape is torn or the signature is missing, they know someone may have opened the package, possibly swapped the watch for a fake, and resealed it poorly. 

 This real-world package delivers the same idea as integrity in IT. The tamper-evident tape and signature are like a cryptographic hash or a digital signature. They provide a way for the recipient to verify that the contents have not been changed. The courier is like the network path, which you cannot fully trust to be honest. Integrity does not prevent someone from opening the package it only ensures you can detect if someone did. 

 Another everyday analogy is the checksum you see when downloading a large program from the internet. The website provides a long string of characters (a hash). After your download finishes, your download manager computes its own hash of the downloaded file. If the two match, the file is intact. If they differ, you know the file was corrupted or tampered with during transfer. This is exactly like checking the tamper-evident tape on your package. Both examples show that integrity is about detection, not prevention, but detection is powerful because it allows you to reject bad data before it causes harm.

## Why it matters

Integrity is critical for trust in virtually every aspect of IT. Without integrity, you cannot trust that the software you install is actually from the vendor you think it is. You cannot trust that your bank statement reflects your actual transactions. You cannot trust that an email from your boss is genuinely from them and has not been altered by an attacker. In cybersecurity, many attacks succeed because victims assume data integrity is intact when it is not. For example, a man-in-the-middle attack can modify a webpage in transit, injecting malicious scripts. If the user has no way to verify integrity, they may unknowingly execute the malicious code. 

 In regulated industries, integrity violations can lead to legal and compliance penalties. Standards like HIPAA for healthcare, PCI DSS for payment card data, and GDPR for personal data all require integrity controls. Auditors check whether organizations have implemented mechanisms to detect unauthorized changes to sensitive data. A breach of integrity in medical records could lead to incorrect diagnoses or treatments, which is not only a security issue but a life safety issue. 

 For IT professionals, maintaining integrity means using hashing, digital signatures, access controls, and logging. It means configuring file integrity monitoring on servers, enabling checksums on backups, verifying SSL/TLS certificates, and auditing database changes. It also means understanding that integrity is not just about data but also about systems themselves. A compromised operating system kernel has lost its integrity, and you cannot trust any subsequent data it processes. This is why secure boot and measured boot are used to verify system integrity from the moment the computer powers on. 

integrity is the bedrock of trust in digital systems. It enables secure e-commerce, reliable software updates, accurate data analysis, and safe communication. When integrity fails, confusion, fraud, and system instability follow. For anyone pursuing an IT certification, understanding how to protect and verify integrity is not optional it is essential.

## Why it matters in exams

Integrity is a foundational concept in almost every major IT certification exam. It appears prominently in CompTIA Security+ (SY0-601 and SY0-701), where the CIA triad is one of the first topics covered. Exam objectives explicitly require candidates to explain integrity, differentiate it from confidentiality and availability, and identify technologies that provide integrity. Questions often ask which cryptographic method ensures integrity (answer: hashing) or which technology provides integrity for data in transit (answer: TLS, IPsec). 

 In the CISSP exam, integrity is treated as a deep concept. Candidates must know the difference between data integrity and system integrity. They need to understand models like the Bell-LaPadula model (which primarily addresses confidentiality) versus the Biba model (which addresses integrity). The Biba model prevents subjects with lower integrity from writing to objects with higher integrity, preventing contamination. This is a classic exam question. Integrity also appears in discussions of separation of duties, least privilege, and audit trails, all of which help preserve integrity. 

 For Cisco certifications like CCNA and CCNP, integrity is central to network security. Questions explore how IPsec uses HMAC to verify packet integrity, how OSPF uses authentication to prevent route manipulation, and how EtherChannel load balancing must ensure frame order integrity. In the CompTIA Network+ exam, integrity appears in the context of data transmission, network hardening, and remote access protocols. 

 Even entry-level exams like CompTIA A+ touch on integrity when discussing system file protection, checksums for driver downloads, and BIOS/UEFI security. Cloud certifications like AWS Certified Solutions Architect cover integrity in the context of S3 bucket versioning, object lock, and CloudTrail logs. In every case, the exam expects you to know not just the definition, but the practical implementation the tools, protocols, and configurations that maintain integrity. 

 Questions are often scenario based. For example, a company finds that a configuration file changed without authorized access. Which security goal was violated? (Integrity). Or, a security professional needs to ensure that a downloaded firmware image has not been tampered with. What should they do? (Compare the hash against the vendor’s published hash). Recognizing these patterns is key to scoring well.

## How it appears in exam questions

You will see integrity tested in several distinct question formats across certification exams. The first is the direct definition question: Which of the following is the primary security goal that ensures data has not been altered? The answer choices typically include confidentiality, integrity, availability, and non-repudiation. This is common in CompTIA Security+ and Network+ exams. A slight variation asks: A user receives a file that appears to be from a trusted source, but the system reports that the digital signature is invalid. Which security goal is most likely compromised? Again, integrity is the correct answer. 

 The second format is protocol-specific. Which protocol provides integrity for IP packets? Options might be SSL, TLS, IPsec, or SSH. The correct answer is IPsec, and if the question specifies the transport layer, TLS is correct. Another question: Which component of IPsec ensures that packets have not been modified in transit? The answer is ESP (Encapsulating Security Payload) in transport mode or AH (Authentication Header), depending on the context. You must know the exact protocol and function. 

 The third format is tool-based. Which command-line tool can you use to verify the integrity of a downloaded Linux ISO? Options include md5sum, sha256sum, gpg, and wget. The correct approach is to compute a hash using sha256sum and compare it to the published checksum. A related question: Which Windows utility can be used to verify file integrity? The answer is certutil -hashfile. 

 The fourth format is scenario-based troubleshooting. A system administrator notices that a critical database record was modified incorrectly. Audit logs show that no user logged in at the time of the change. What is the most likely root cause? This tests understanding that integrity can be violated by malware, unauthorized access via stolen credentials, or a bug in the application. The candidate must identify the appropriate control to prevent recurrence, such as database triggers, file integrity monitoring, or stronger access controls. 

 Finally, there are configuration-based questions. For example: A network engineer is configuring OSPF and wants to ensure that routing updates are not tampered with. Which authentication method should they use? Options are null authentication, simple password authentication, or MD5 authentication. MD5 (or HMAC-SHA) is correct because it provides message integrity, while simple password sends the password in clear text and provides no integrity verification. 

 Being prepared for these question styles means not only memorizing the definition but also knowing the specific cryptographic mechanisms, protocols, and tools that operationalize integrity in real network and system environments.

## Example scenario

A small business uses a cloud file storage service to share project plans with remote employees. The project manager, Alice, uploads a critical design document and then sends a link to the team. One of the employees, Bob, downloads the file and starts working on it. However, unbeknownst to everyone, an attacker intercepted the file during upload and replaced the original with a modified version that contains incorrect measurements. Bob builds a prototype based on the flawed data. When the prototype fails testing, the team is confused because they followed the document exactly. 

 Later, a security audit reveals that the file storage service did not use hashing or digital signatures to verify file integrity during upload or download. The team had no way to detect that the file was altered. As a result, the company wasted time and money building the wrong product. To fix this, the IT team enables file versioning and integrity checks on the storage platform. Now, every file has a SHA-256 hash stored alongside it. When Bob downloads a file, his computer automatically computes the hash and compares it to the stored value. If they do not match, the download is flagged. 

 This scenario shows the real-world consequences of missing integrity controls. It also illustrates that integrity is not only about malicious tampering, it also guards against accidental corruption, such as a transmission error that flips a bit. In the exam, you might be asked: What security principle was violated when the file was altered? (Integrity). What control could have prevented this? (Hashing, digital signatures, or a checksum process). This example is straightforward but captures the essence of why integrity is a non-negotiable requirement in any data-handling system.

## Common mistakes

- **Mistake:** Confusing integrity with confidentiality.
  - Why it is wrong: Integrity is about data being correct and unchanged, while confidentiality is about keeping data secret. A file can be perfectly confidential (encrypted) but still have lost integrity if someone modified it before encryption. The two are separate security goals.
  - Fix: Ask yourself: 'Is the problem that data was read by the wrong person (confidentiality) or that data was changed by someone who should not have changed it (integrity)?' That distinction leads to the correct answer.
- **Mistake:** Thinking that encryption provides integrity.
  - Why it is wrong: Encryption changes the appearance of data, but it does not guarantee that the data was not modified before or after encryption. An attacker can alter ciphertext, causing decryption to produce garbage, but the system might not know the original plaintext was tampered with. Encryption alone is not integrity protection.
  - Fix: Use a MAC or digital signature in addition to encryption (or use an authenticated encryption mode like GCM or CCM that combines both). Encryption protects secrecy; hashing plus signing protects integrity.
- **Mistake:** Assuming that hash matching proves the sender's identity.
  - Why it is wrong: If you only compare a hash value, you know the data has not changed, but you do not know who created it. An attacker could replace both the file and its hash with their own malicious file and a matching hash. The recipient would see a matching hash and believe the file is legitimate.
  - Fix: Use a digital signature. The hash is signed with the sender's private key, so anyone with the public key can verify both the integrity and the sender’s identity. Always pair hashing with authentication in untrusted environments.
- **Mistake:** Believing that integrity checks are only needed for data in transit.
  - Why it is wrong: Data at rest and data in use also need integrity protection. A file stored on a server can be modified by malware or a malicious insider. A database record might be altered by a SQL injection attack. Relying only on network-level integrity (like TLS) is insufficient.
  - Fix: Implement integrity checks at every stage: file integrity monitoring for stored files, checksums for backups, database audit logs for changes, and code signing for software. Treat integrity as a continuous requirement, not a one-time check.

## Exam trap

{"trap":"The question says: 'A security administrator needs to ensure that data has not been altered during transmission. Which of the following should they implement?' The options include encryption, hashing, digital signature, and access control. Many learners pick encryption because they associate it with secure transmission.","why_learners_choose_it":"Learners often think that encryption 'protects' data in a general sense, so it must also protect integrity. They have not internalized that confidentiality and integrity are separate, and that encryption alone does not detect modification.","how_to_avoid_it":"Remember that the question specifically asks about detecting alteration, not about preventing observation. Encryption prevents reading but does not prevent or detect changes. Hashing and digital signatures are designed specifically for integrity verification. When you see 'ensuring data has not been altered,' immediately think 'hash' or 'digital signature.' In the exam, read the question carefully for the specific security goal."}

## Commonly confused with

- **Integrity vs Confidentiality:** Confidentiality ensures that data is accessible only to authorized individuals, while integrity ensures that data is accurate and unaltered. A file can be kept secret (confidential) but still be completely tampered with. They are separate CIA triad pillars. For example, encrypting a file protects its confidentiality, but if someone with the key modifies the file before encrypting it, you lose integrity without losing confidentiality. (Example: You put a spy note in a locked safe (confidentiality). But a person with the key replaces the note with a fake one before you open it. The note is still secret, but its integrity is broken.)
- **Integrity vs Non-repudiation:** Non-repudiation is the assurance that someone cannot deny an action, such as sending a message. Integrity focuses on whether the message changed. A digital signature provides both non-repudiation and integrity, but you can have integrity (via a hash) without non-repudiation (since anyone could have created the hash without authentication). (Example: You sign a contract with a pen and make a copy. Non-repudiation means you cannot later say you didn't sign it. Integrity means the signed copy hasn't been altered. Scanning the signed page and comparing the scan to the original tests integrity; the signature on the paper gives non-repudiation.)
- **Integrity vs Availability:** Availability means data and services are accessible when needed. Integrity is about correctness, not accessibility. A system can be perfectly available (up and running) but serving modified or corrupted data, which is an integrity failure. Conversely, a system might have perfect integrity in its stored data but be hacked to become unavailable (a denial of service attack). (Example: A bank's website is up 24/7 (available) but a hacker changes your account balance from $1000 to $10. The data lost integrity, but the system was still available.)

## Step-by-step breakdown

1. **Data Creation or Capture** — Integrity begins at the moment data is created or captured. The original state of the data is defined. Any hash or signature computed at this point serves as the baseline for all future verification. If the original data is already corrupted, no later check will recover it. This step is why it is critical to capture integrity evidence (like a checksum) as early as possible, ideally at the source.
2. **Data Processing or Transmission** — During processing or transmission, the data is vulnerable to intentional or accidental modification. For example, a network packet could be intercepted and altered by a man-in-the-middle, or a disk write could corrupt a file due to hardware error. This step is where integrity is most often threatened. Protocols like TLS and IPsec are designed to protect integrity during this phase.
3. **Integrity Verification** — At the receiving end or after storage, the data is checked against the baseline. A hash is recomputed and compared to the stored hash, or a digital signature is validated using the sender's public key. If the values match, integrity is intact. If they do not match, the data must be discarded or flagged. This step is the active detection that makes integrity actionable.
4. **Alert and Remediation** — When an integrity check fails, the system must generate an alert. In file integrity monitoring, this triggers a notification to the security team. In network protocols, the packet might be dropped and retransmission requested. In version control, the commit is rejected. Remediation may involve restoring data from a known good backup or investigating the cause of the modification.
5. **Audit and Logging** — All integrity checks and failures should be logged. Audit logs provide a record of who accessed what, when, and whether integrity was maintained. This step supports forensics and compliance. For example, if a database record is found to be incorrect, the audit log can show which user last modified it and whether that change violated integrity constraints.

## Practical mini-lesson

In the real world, integrity is not just a checkbox; it is a continuous operational discipline. Professionals must know how to apply integrity mechanisms in different contexts. For stored files, the classic approach is to use a file integrity monitoring (FIM) tool. These tools (like Tripwire, OSSEC, or Windows File Server Resource Manager) take a snapshot of critical files and their cryptographic hashes at installation time. They then periodically rescan and report any differences. For example, on a Linux web server, you would monitor /etc/passwd, /etc/shadow, and the web root directory. If a hash changes outside of a scheduled update, an alert fires. 

 For data in transit, the most common integrity mechanism is the use of HMAC in TLS. When your browser connects to a website, the TLS handshake establishes a session key. Every record sent over the connection is accompanied by an HMAC computed with that key. The recipient recalculates the HMAC and compares it. If it does not match, the record is rejected. This is happening invisibly every time you visit a secure website. 

 For software distribution, code signing is the integrity mechanism of choice. Developers sign their binaries with a certificate issued by a trusted certificate authority (CA). When you download and run the software, the operating system checks the signature. If the signature is missing, invalid, or expired, you get a warning. In corporate environments, administrators often use Group Policy to enforce that only signed executables can run, preventing users from accidentally launching tampered software. 

 What can go wrong? One common issue is that the baseline hash itself gets compromised. If a system is infected with malware before the first integrity scan, the baseline will include the compromised state, and subsequent checks will show everything as 'normal.' That is why it is critical to perform integrity baselines on a known clean system. Another issue is performance. Computing hashes on every file on a large server can be CPU-intensive. Professionals often use techniques like random spot checks or event-driven scanning to mitigate overhead. 

 Finally, integrity mechanisms must be layered with access controls. Even the best hash verification is useless if attackers can disable the monitoring tool or modify the stored hashes. That is why the tools themselves should be protected, ideally running with minimal privileges and storing their databases on read-only media or secure, immutable storage. This layered approach ensures that integrity monitoring remains trustworthy even in the face of an active attack.

## Memory tip

Think 'I' for 'Integrity' and 'I' for 'Inspect' you inspect data to see if it has been tampered with. Integrity is about being the same, not secret.

## FAQ

**What is the difference between data integrity and system integrity?**

Data integrity focuses on the correctness and consistency of stored or transmitted data. System integrity, on the other hand, ensures that the operating system, firmware, and applications are running as intended and have not been tampered with. For example, Secure Boot verifies system integrity by checking digital signatures on boot loaders, while hashing verifies data integrity at the file level.

**Does encryption guarantee integrity?**

No, encryption alone does not guarantee integrity. Standard encryption (like AES in CBC mode) can be modified by an attacker without detection. You need an authentication mechanism such as a MAC or an authenticated encryption mode like GCM, which combines encryption and integrity into one operation.

**Which algorithm is commonly used to verify file integrity?**

SHA-256 is the most widely recommended hash algorithm for file integrity verification today. Older algorithms like MD5 and SHA-1 are considered cryptographically broken and should not be used for security-sensitive integrity checks.

**What is the role of a digital signature in integrity?**

A digital signature provides both integrity and non-repudiation. The sender creates a hash of the message and encrypts it with their private key. The recipient decrypts the hash with the sender's public key and compares it to their own computed hash. If they match, the message has not been altered and the sender cannot deny sending it.

**How does IPsec provide integrity?**

IPsec uses either the Authentication Header (AH) protocol or the Encapsulating Security Payload (ESP) protocol with integrity protection. Both compute an integrity check value (ICV) using a hash-based message authentication code (HMAC) over the packet. The receiver verifies this value to detect any tampering during transit.

**What is a collision in hashing, and why is it a problem for integrity?**

A collision occurs when two different inputs produce the same hash output. If an attacker can find a collision, they could replace a legitimate file with a malicious one that has the same hash, and the integrity check would still pass. That is why cryptographically secure hash functions like SHA-256 are designed to make collisions computationally infeasible.

## Summary

Integrity is one of the three pillars of information security, alongside confidentiality and availability. It ensures that data is accurate, consistent, and has not been tampered with by unauthorized parties. In practice, integrity is maintained using cryptographic tools such as hash functions (like SHA-256), digital signatures, and message authentication codes (HMACs). These tools are embedded in everyday protocols like TLS, IPsec, and code signing, as well as in system tools like file integrity monitors and version control systems. 

 Understanding integrity is critical for any IT professional. It affects how you verify software downloads, how you secure network communications, how you audit system changes, and how you comply with regulations. In certification exams, integrity questions test not only your knowledge of the concept but also your ability to identify the correct technology, protocol, or configuration that provides integrity in a given scenario. 

 The key takeaway from this glossary page is that integrity is about trust. Without integrity, you cannot trust the data your systems produce, the files you transfer, or the software you run. By mastering integrity, you gain the ability to detect when trust has been broken, allowing you to respond before real damage occurs. As you prepare for your certification exam, remember that integrity is not just a definition to memorize it is a mindset of constant verification. In the real world, always verify, never assume.

---

Practice questions and the full interactive page: https://courseiva.com/glossary/integrity
