Cryptography & Data Security

Chapter 1
Foundations of Cryptography and Data Security

Diploma in Cyber Security
Cryptography & Data Security   •   Diploma

Foundations of Cryptography and Data Security

Introduction

Modern organisations depend on digital information for communication, finance, healthcare, manufacturing, public services and national infrastructure. This dependence creates a security problem: information must remain useful to authorised people while being protected from unauthorised disclosure, alteration, destruction and misuse. Cryptography is one of the principal technologies used to address this problem, but cryptography alone is not equivalent to security. Secure systems also require sound policies, reliable identity management, secure software, resilient infrastructure, trained users and appropriate governance.

Cryptography is the practice and study of techniques for protecting information by transforming it so that only intended parties, or parties satisfying specified conditions, can use it. Data security is broader. It includes administrative, physical and technical controls that protect data throughout its life cycle: creation, storage, processing, transmission, archival and disposal.

This chapter establishes the vocabulary and reasoning needed for later study of symmetric encryption, public-key cryptography, hashing, digital signatures, key management and secure protocols.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Explain confidentiality, integrity, authentication, authorization, non-repudiation and availability.
  2. Distinguish security objectives from security mechanisms and controls.
  3. Describe threat models, trust boundaries and security assumptions.
  4. Use fundamental cryptographic terminology correctly.
  5. Outline major stages in the historical development of cryptography.
  6. Apply security principles to a realistic organisational scenario.
  7. Recognise the limitations, ethical responsibilities and governance requirements associated with cryptography.

The Security Objectives

A useful starting point is the security objectives commonly represented by the CIA triad: confidentiality, integrity and availability. In professional practice, these objectives are extended by authentication, authorization and non-repudiation.

Confidentiality

Confidentiality means preventing information from being disclosed to unauthorised subjects. Encryption is a major confidentiality control, but it is not the only one. Access permissions, network segmentation, secure disposal, privacy policies and physical security also contribute.

Confidentiality applies to data at rest, data in transit and data in use. For example, a database may be encrypted on disk, a web connection may use TLS during transmission, and an application may restrict which processes can read decrypted data in memory.

Confidentiality is not absolute secrecy. A system must define who is authorised to access particular information and under which conditions. Excessive secrecy can also obstruct legitimate safety, auditing or accountability functions.

Integrity

Integrity is the protection of information and systems against unauthorised or improper modification, deletion or creation. A file may have confidentiality without integrity: an attacker might be unable to read an encrypted file but could still replace it with a different file or alter its metadata.

Cryptographic hash functions, message authentication codes, digital signatures, version controls, database constraints and audit logs can support integrity. A hash value can detect accidental or deliberate changes when the trusted reference hash is protected. A plain hash does not, by itself, prove who made a file or prevent an attacker from replacing both the file and its hash.

Availability

Availability means that authorised users can access information and services when required. Availability is affected by hardware failure, software defects, denial-of-service attacks, ransomware, power loss, natural disasters and poorly planned maintenance.

Availability controls include redundancy, backups, disaster recovery, capacity planning, patch management, rate limiting and incident response. Encryption can sometimes reduce availability if keys are lost, algorithms are implemented inefficiently or systems cannot decrypt data during recovery. Security design therefore requires balancing protection with operational continuity.

Authentication

Authentication is the process of establishing the identity of a user, device, service or message source. It answers the question, “Who or what is presenting this identity?”

Authentication factors are commonly grouped as:

  • Something the subject knows, such as a password or PIN.
  • Something the subject has, such as a hardware security key or authenticator device.
  • Something the subject is, such as a biometric characteristic.
  • Somewhere the subject is, such as a permitted network location.
  • Something the subject does, such as a behavioural pattern.

Multi-factor authentication combines factors from different categories. Two passwords are generally two knowledge factors, not two-factor authentication. Authentication mechanisms must also address credential theft, replay, phishing, device compromise and recovery procedures.

Authorization

Authorization determines what an authenticated subject is permitted to do. Authentication and authorization are related but distinct: a system may know who a person is but still deny access to a particular record.

Common authorization models include:

  • Role-based access control (RBAC), in which permissions are assigned to job roles.
  • Attribute-based access control (ABAC), in which decisions use attributes such as department, resource sensitivity, time and device posture.
  • Discretionary access control, in which an owner can delegate permissions.
  • Mandatory access control, in which centrally defined classifications and rules constrain access.

The principle of least privilege requires each subject to receive only the permissions necessary for its legitimate task. Separation of duties divides sensitive activities among multiple people or systems so that one compromised account cannot complete an entire fraudulent process.

Non-repudiation

Non-repudiation is evidence supporting the claim that a particular party performed an action or approved a message, so that the party cannot credibly deny the action later. Digital signatures, trusted timestamps, certificate infrastructures and protected audit records can contribute to non-repudiation.

Non-repudiation is stronger than authentication alone. A login record may show that a credential was used, but it may not prove that the account owner personally acted. Legal effect depends on jurisdiction, organisational procedures, key protection, evidence preservation and the reliability of the overall system. Cryptography provides technical evidence; it does not independently settle every legal dispute.

Privacy and Accountability

Privacy concerns appropriate collection, use, sharing, retention and deletion of information about identifiable people. Accountability means that actions can be attributed to responsible subjects and investigated. Strong logging, access review and incident records support accountability, but logs themselves may contain sensitive information and must be protected.

Security Models and the Protection Relationship

Security objectives are achieved through controls. A control may be preventive, detective, corrective or deterrent. For example, encryption is primarily preventive against unauthorised reading, an intrusion alert is detective, a backup is corrective, and a policy with sanctions may be deterrent.

A simplified protection relationship is:

Security assurance = objectives + controls + trustworthy implementation + governance

This is not a numerical equation; it is a conceptual model. It means that cryptographic algorithms cannot compensate for missing requirements, stolen keys, insecure endpoints or ineffective governance.

A security architecture should identify:

  1. Assets: information, services, devices, credentials and business processes.
  2. Subjects: users, administrators, applications and external organisations.
  3. Objects: files, records, databases, messages and services being protected.
  4. Operations: read, write, execute, transmit, approve and delete.
  5. Security domains and trust boundaries: points at which control, ownership or assumptions change.
  6. Policies: rules defining acceptable actions and required protections.

Threat Models and Security Assumptions

A threat model is a structured description of what must be protected, from whom, by what means and under which assumptions. Threat modelling prevents vague claims such as “the system is secure” and replaces them with testable claims such as “an attacker who can observe network traffic but cannot obtain the endpoint’s private key cannot recover the plaintext within the accepted risk period.”

Adversary Capabilities

Threat models often describe attackers by capability rather than by name. Examples include:

  • A passive eavesdropper who observes messages but does not alter them.
  • An active network attacker who intercepts, modifies, replays or injects messages.
  • A malicious insider with legitimate but excessive access.
  • A compromised endpoint that can read plaintext before encryption or after decryption.
  • A chosen-plaintext attacker who can request encryption of selected inputs.
  • A chosen-ciphertext attacker who can submit ciphertexts for decryption and observe responses.
  • A well-resourced nation-state or criminal group with substantial computing and intelligence resources.

The stronger the attacker model, the stronger and more carefully implemented the system must be. A design secure against passive observation may fail completely against message modification or endpoint compromise.

Assets, Threats, Vulnerabilities and Risk

An asset is something valuable. A threat is a potential cause of harm. A vulnerability is a weakness that can be exploited. Risk is the possibility and consequence of harm arising when a threat exploits a vulnerability.

A common qualitative model is:

Risk ≈ likelihood × impact

Likelihood and impact are usually assessed using defined organisational scales rather than precise universal probabilities. The relationship is useful for prioritisation, but it is not a law of nature. Risk assessments should document assumptions, uncertainty, time horizon and the basis for ratings.

Examples include phishing as a threat, password reuse as a vulnerability, account takeover as an event and financial loss as an impact. A control may reduce likelihood, impact or both.

Security Assumptions

Every security system relies on assumptions. Typical assumptions include:

  • A cryptographic algorithm has been publicly analysed and correctly implemented.
  • Secret keys remain secret and are generated with sufficient randomness.
  • Users verify certificates or authentication prompts correctly.
  • Operating systems and endpoints are not already compromised.
  • Time sources, certificate status services or hardware security modules behave as expected.
  • Recovery personnel can access backup keys under controlled conditions.

An assumption is not a guarantee. Security reviews should identify what happens when an assumption fails. This approach is particularly important for cloud computing, supply chains and artificial-intelligence-enabled systems, where control is distributed across multiple providers.

Fundamental Cryptographic Terminology

Plaintext is the original intelligible data. Ciphertext is the transformed output produced by an encryption process. Encryption converts plaintext to ciphertext; decryption converts ciphertext back to plaintext using an appropriate key.

A cryptographic algorithm is a defined procedure. A key is a parameter that controls the algorithm and should normally be kept secret when the algorithm requires secrecy. Kerckhoffs’s principle states that a cryptosystem should remain secure even when everything except the key is public. Security should not depend on an attacker being unaware of the algorithm.

A cryptosystem consists of algorithms, keys, key-generation processes, operational rules and interfaces. A protocol is a set of messages and procedures through which parties achieve a security goal. A security primitive is a basic cryptographic component, such as a block cipher, stream cipher, hash function, message authentication code or digital-signature scheme.

Symmetric and Asymmetric Cryptography

Symmetric cryptography uses the same secret key, or computationally related secret keys, for encryption and decryption. It is generally efficient and suitable for protecting large volumes of data. Its central operational challenge is securely sharing and managing keys.

Asymmetric, or public-key, cryptography uses a key pair: a public key that can be distributed and a private key that must be protected. Public-key encryption can support confidentiality, while digital signatures use a private key to sign and a public key to verify. Public-key operations are generally more computationally expensive, so practical protocols often use asymmetric methods to establish a session key and symmetric methods to protect the session data.

Hashes, MACs and Digital Signatures

A cryptographic hash function maps an input of arbitrary length to a fixed-length digest. Desired properties include resistance to finding a preimage, a second preimage and a collision. Hashes are used in integrity checks, password-storage constructions, signatures, certificates and content addressing.

A message authentication code (MAC) uses a shared secret key to provide integrity and authentication to parties that share that key. A digital signature uses a private key and can be publicly verified. Signatures can support public verification and evidence of origin, whereas a MAC normally cannot distinguish which holder of the shared secret created a message.

Randomness and Keys

Cryptographic security depends heavily on unpredictable randomness. A cryptographically secure random-number generator should be seeded and operated so that attackers cannot feasibly predict its output. Predictable keys, nonces or initialization values can undermine otherwise strong algorithms.

A nonce is a value intended for use once, although exact requirements depend on the algorithm. A salt is a non-secret random value added to a password-derived computation, normally to prevent identical passwords from producing identical stored values and to make precomputed attacks less effective. A salt does not make a weak password strong; password hashing should use an appropriate, deliberately expensive and memory-hard construction where suitable.

Key management includes generation, distribution, storage, rotation, backup, revocation, recovery and destruction. Many real-world failures arise from key management rather than from broken mathematics.

Historical Development of Cryptography

Cryptography has developed in response to changing communication technologies, political needs and computational capabilities.

Classical Cryptography

Early systems used substitution and transposition. A substitution cipher replaces symbols according to a mapping; a transposition cipher rearranges their order. The Caesar cipher, associated with Julius Caesar, shifts letters by a fixed amount. Such systems are educationally important but insecure because language patterns and limited key spaces allow systematic attacks.

The Vigenère cipher introduced a repeating-key polyalphabetic substitution and was historically significant, but repeated patterns and statistical analysis eventually exposed weaknesses. Classical cryptanalysis demonstrated an enduring lesson: secrecy of a method is not a substitute for a large, well-managed key space and resistance to analysis.

Mechanical and Electromechanical Systems

The First and Second World Wars encouraged the development of rotor machines, codebooks and large-scale cryptanalysis. The German Enigma system, for example, was weakened by operational mistakes, repeated procedures and the ability of cryptanalysts to combine mathematics, engineering and intelligence. These events helped establish cryptanalysis as a major technical discipline.

The Information-Theoretic Era

Claude Shannon formalised important concepts of secrecy and communication theory. The one-time pad can provide perfect secrecy when its key is truly random, at least as long as the message, used only once and kept completely secret. Its key-distribution and key-management requirements make it impractical for most general-purpose systems.

Modern Cryptography

The development of computers enabled complex symmetric algorithms and systematic public analysis. The Data Encryption Standard (DES) became influential but was eventually retired because its effective key length was too small for modern capabilities. The Advanced Encryption Standard (AES) replaced it for many applications.

In 1976, Diffie and Hellman described public-key ideas that transformed key distribution. RSA subsequently demonstrated practical public-key encryption and signatures. Elliptic-curve cryptography provided comparable security with smaller key sizes under appropriate assumptions. Modern systems combine these techniques in protocols such as TLS.

Contemporary cryptography also includes authenticated encryption, post-quantum cryptography, secure multiparty computation, homomorphic encryption, zero-knowledge proofs and privacy-enhancing technologies. These areas address new requirements but introduce complex performance, implementation and governance challenges.

Practical Application: Protecting a Health-Services Portal

The following is an illustrative case study.

Background

A regional health provider operates a portal through which patients book appointments, clinicians review records and laboratories upload results. The portal is accessible through the internet and integrates with an internal electronic-health-record system.

Problem

An assessment identifies several weaknesses: some staff share accounts, patient data is transmitted through an incorrectly configured legacy connection, permissions are assigned directly to individuals, audit logs are retained briefly, and a backup encryption key is stored beside the backup media.

Analysis

The assets include health records, identity data, appointment services and audit evidence. Threats include phishing, malicious insiders, ransomware, traffic interception and unauthorised integration access. The trust boundary between the public portal and internal records is particularly important. The organisation’s security objectives are confidentiality and integrity of records, availability of appointments, strong authentication, accountable clinical access and legally appropriate privacy protection.

Approach and Solution

The provider introduces unique accounts, phishing-resistant multi-factor authentication for privileged and clinical roles, RBAC combined with contextual restrictions, and a documented joiner–mover–leaver process. TLS is configured using current, supported protocols and certificates are validated correctly. Sensitive records are encrypted at rest, while authenticated encryption protects application messages where appropriate.

The organisation separates backup encryption keys from backup media, protects high-value keys using controlled key-management infrastructure and tests restoration regularly. Centralised tamper-evident logging records access, changes, approvals and administrative actions. Alerts are created for unusual downloads, impossible travel and repeated access failures. The portal and internal record system communicate through a narrowly permitted service interface rather than broad network access.

Outcome

The design reduces the likelihood of account takeover and limits the damage caused by a compromised account. It improves detection and supports investigation. Availability is strengthened through tested backups and service redundancy. The organisation also updates privacy notices, retention rules, staff training and incident-response procedures.

Learning Points

First, encryption is only one control among many. Second, authorization must be designed around roles, context and business purpose. Third, key separation and recovery testing are essential. Fourth, logging can support accountability but must itself be protected as sensitive data. Finally, technical controls must be connected to policy, law and professional responsibility.

Limitations, Ethics and Governance

Cryptography can protect communications, but it cannot prevent a trusted user from deliberately disclosing plaintext, stop malware operating on a compromised endpoint or determine whether a request is morally legitimate. Strong encryption may also create lawful-access debates involving public safety, privacy and human rights. Professionals should avoid undocumented backdoors because exceptional access mechanisms can weaken security for legitimate users and create attractive targets.

Organisations should establish data-classification policies, retention schedules, access reviews, incident procedures and accountability arrangements. Cryptographic choices should consider interoperability, accessibility, procurement, jurisdiction, export controls where applicable, and the ability to migrate when algorithms or providers become obsolete.

Artificial intelligence can assist anomaly detection, malware analysis and security operations, but it introduces risks including sensitive-data leakage, adversarial manipulation, biased decisions and overreliance on automated alerts. AI-generated code and configurations require expert review, testing and secure change control. AI does not remove the need to define security objectives and threat models.

Best Practices for Foundational Security

  1. Define assets, objectives, trust boundaries and adversary capabilities before selecting controls.
  2. Use established, publicly reviewed algorithms and well-maintained libraries.
  3. Never design proprietary encryption merely to hide a system’s method.
  4. Protect keys throughout their life cycle and plan for recovery and revocation.
  5. Prefer authenticated encryption when confidentiality and integrity are both required.
  6. Use strong authentication, least privilege and separation of duties.
  7. Generate cryptographic randomness using approved secure mechanisms.
  8. Keep systems patched and protect endpoints where plaintext is handled.
  9. Log significant security events, protect logs and review them appropriately.
  10. Test backups, incident response and cryptographic migrations rather than assuming they work.
  11. Document assumptions and revisit them when technology, threats or business processes change.
  12. Treat privacy, human rights, accessibility and legal obligations as design requirements.

Chapter Summary

Cryptography is a specialised foundation of data security, but security is a system property rather than a single algorithm. Confidentiality prevents unauthorised disclosure; integrity protects against unauthorised change; availability ensures dependable access. Authentication establishes identity, authorization determines permitted actions, and non-repudiation supports evidence of origin and responsibility.

Effective security begins with assets, threats, vulnerabilities, trust boundaries and explicit assumptions. Symmetric cryptography provides efficient data protection, while asymmetric cryptography supports key establishment and public verification. Hashes, MACs, digital signatures, randomness and key management serve different purposes and must not be treated as interchangeable. The history of cryptography shows that operational practices, implementation quality and key management are as important as mathematical design. Professional practice therefore combines sound cryptography with access control, resilience, monitoring, privacy, governance and ethical judgment.

Key Terms

Confidentiality: Protection of information from unauthorised disclosure.

Integrity: Assurance that information has not been improperly altered, deleted or created.

Availability: Timely and reliable access for authorised users.

Authentication: Establishing the identity of a subject or message source.

Authorization: Determining which actions an authenticated subject may perform.

Non-repudiation: Evidence supporting attribution of an action or message to a party.

Threat model: A structured description of assets, adversaries, attacks and assumptions.

Vulnerability: A weakness that can be exploited to cause harm.

Risk: The possibility and consequence of a threat exploiting a vulnerability.

Plaintext: Original readable or usable data before encryption.

Ciphertext: Transformed data produced by encryption.

Key: A value controlling a cryptographic operation.

Symmetric cryptography: Cryptography using a shared secret key.

Asymmetric cryptography: Cryptography using related public and private keys.

Hash function: A function that produces a fixed-length digest from input data.

Message authentication code: A keyed construction providing message integrity and shared-key authentication.

Digital signature: A private-key-generated value that can be publicly verified.

Nonce: A value used according to a protocol’s uniqueness requirements, often once.

Salt: A non-secret random value used in password or key-derivation processing.

Least privilege: Granting only the permissions necessary for legitimate tasks.

Review Questions

Short Answer Questions

  1. What is the difference between confidentiality and integrity?
  2. Why are authentication and authorization separate security functions?
  3. What is a threat model, and why is it necessary?
  4. Distinguish a hash function from a message authentication code.
  5. State two reasons why key management is important.

Long Answer Questions

  1. Explain the CIA triad and discuss practical controls supporting each objective.
  2. Compare symmetric and asymmetric cryptography, including their strengths and operational challenges.
  3. Describe how Kerckhoffs’s principle influenced modern cryptographic design.
  4. Explain how threat capabilities and security assumptions affect system architecture.
  5. Discuss the historical development of cryptography from classical ciphers to modern public-key systems.

Analytical / Application Questions

  1. A university encrypts its student database but permits all administrative employees to use one shared account. Analyse the security objectives that remain weak and recommend improvements.
  2. A company stores encrypted backups and the decryption key in the same cloud folder. Identify the threat and vulnerability, explain the likely consequences, and propose a safer key-management design.
  3. Design a high-level security approach for an online examination system. Identify its assets, trust boundaries, likely adversaries, authentication and authorization requirements, integrity controls, and availability measures.

Multiple Choice Questions with Answers

Question 1

Which security objective concerns preventing unauthorised disclosure of information?

A. Integrity

B. Confidentiality

C. Availability

D. Authorization

Correct Answer: B. Confidentiality

Question 2

Which statement best distinguishes authentication from authorization?

A. Authentication determines identity; authorization determines permitted actions.

B. Authentication encrypts data; authorization hashes data.

C. Authentication ensures availability; authorization ensures confidentiality.

D. Authentication creates backups; authorization restores them.

Correct Answer: A. Authentication determines identity; authorization determines permitted actions.

Question 3

Which control most directly supports message integrity and shared-key authentication?

A. A message authentication code

B. A compression algorithm

C. A password hint

D. A firewall banner

Correct Answer: A. A message authentication code

Question 4

Under Kerckhoffs’s principle, a cryptosystem should remain secure when the attacker knows the system’s design except for the:

A. Plaintext

B. Network address

C. Key

D. User name

Correct Answer: C. Key

Question 5

Which characteristic is associated with a cryptographic hash function?

A. It always decrypts ciphertext using a public key.

B. It maps arbitrary-length input to a fixed-length digest.

C. It requires two users to share a password for every file.

D. It guarantees that a user personally created the input.

Correct Answer: B. It maps arbitrary-length input to a fixed-length digest.

Question 6

A passive eavesdropper is an attacker who primarily:

A. Observes communications without modifying them

B. Changes every database record

C. Controls the organisation’s legal policy

D. Physically destroys all servers

Correct Answer: A. Observes communications without modifying them

Question 7

Which principle gives a user only the permissions necessary for legitimate work?

A. Open design

B. Least privilege

C. Perfect secrecy

D. Key escrow

Correct Answer: B. Least privilege

Question 8

Why is storing an encryption key beside encrypted backups dangerous?

A. It prevents compression of the backups.

B. It makes the backup format public.

C. An attacker obtaining the storage location may obtain both data and the means to decrypt it.

D. It changes symmetric encryption into hashing.

Correct Answer: C. An attacker obtaining the storage location may obtain both data and the means to decrypt it.

Question 9

Which statement about a digital signature is correct?

A. It is normally generated with a private key and verified with a public key.

B. It always provides availability during a denial-of-service attack.

C. It is identical to a password salt.

D. It prevents a compromised endpoint from reading plaintext.

Correct Answer: A. It is normally generated with a private key and verified with a public key.

Question 10

Which historical development introduced practical public-key ideas for addressing key distribution?

A. The Caesar cipher

B. The Diffie–Hellman 1976 work

C. The use of paper codebooks alone

D. The replacement of passwords with usernames

Correct Answer: B. The Diffie–Hellman 1976 work

Cryptography & Data Security
Chapter 1 of 14