Online Learning Platform

Information SEcurity > Multilevel Security (MLS) > Different Techniques

Different Techniques for Inference Control, Integrity Principle and Mechanism.

What is a Checksum?

A checksum is a small-sized value, usually numeric, computed from a block of data which used to detect accidental data corruption.

Checksum is common use to detect bit-level errors in data during transmission or storage. It is simple and fast, and suitable for physical integrity checks.

Example of the use of Checksum:

  • A file stored in the database has a checksum stored alongside it.
  • When retrieved, a new checksum is computed and compared with the stored one.
  • If they differ indicates the data was altered or corrupted.

In Databases:

  • Some storage engines (like MySQL’s InnoDB) use checksums to detect corrupted pages.
  • Transaction logs often use checksums to validate consistency.
  • Backup and replication tools use checksums to confirm data consistency.

Limitations:

  • Simple checksums are not cryptographically secure.
  • They can miss intentional tampering or hash collisions.

What is Hash function?

A hash function is a mathematical process that converts any amount of input data into a short, fixed-length value called a hash value, hash code, or message digest.

The input can be very small, such as a single word, or very large, such as a movie or an entire database. No matter how large or small the input is, the output (hash) is always the same fixed length.

For example:

  • Input: Hello
  • Hash (SHA-256): 185f8db32271fe25f561a6fc938b2e264306ec304eda518007

If even one letter of the input changes, the hash value changes completely.

Important Characteristics of a Cryptographic Hash Function

  1. Deterministic: A hash function always produces the same hash for the same input. For example, if you hash the word "Computer" today or next year, you will always get exactly the same hash value.
  2. Fast to Compute: Hash functions can generate the hash value very quickly, even for large files. This makes them suitable for checking the integrity of large amounts of data.
  3. One-Way (Irreversible): A hash function works in only one direction. It is easy to generate a hash from the original data, but it is practically impossible to recover the original data from the hash alone. For example, if you know the hash of a password, you cannot determine the actual password from that hash.
  4. Collision Resistant: A collision occurs when two different inputs produce the same hash value. A good cryptographic hash function makes collisions extremely difficult to find, ensuring that different files almost always produce different hashes.

Common Hash Functions

Some widely used hash functions include:

  • SHA-256 – Very secure and widely used today.
  • SHA-3 – A newer and highly secure hash function.
  • BLAKE2 – Fast and secure, often used in modern applications.
  • MD5 – An older hash function that is no longer considered secure because attackers can create collisions.

Example: Using a Hash Function to Check File Integrity

Suppose a company stores an important document in its database.

  1. When the document is first saved, the system calculates its SHA-256 hash and stores the hash value.
  2. Later, when someone opens or downloads the document, the system calculates a new SHA-256 hash for the current version.
  3. The new hash is compared with the previously stored hash:
  • If both hash values are identical, the document has not been changed.
  • If the hash values are different, it means the document has been modified, corrupted, or tampered with.

 

Feature

Checksums

Hash Functions

Purpose

Detect accidental data corruption

Detect tampering and verify integrity

Security Level

Low (not cryptographic)

High (if cryptographic hash is used)

Speed

Very fast

Fast, but slower than checksums

Usage Example

Disk block verification

Password hashing, digital signatures

Common Algorithms

CRC32, Adler-32, XOR

SHA-256, SHA-3, MD5 (not recommended)

 

Prev
Architectures of Database Integrity
Next
Different Techniques: Digital Signature
Feedback
ABOUT

Statlearner


Statlearner STUDY

Statlearner