Cryptography and Data ProtectionIntroductionInformation security depends not only on preventing unauthorized access, but also on ensuring that information remains confidential, accurate, available, and appropriately controlled throughout its life cycle. Cryptography provides technical mechanisms for confidentiality, integrity, authentication, and non-repudiation. Data protection extends beyond cryptographic algorithms to include classification, retention, backup, disposal, governance, and controls for data at rest, in transit, and in use. A sound data-protection programme therefore combines technology, policy, law, and operational discipline. Encryption cannot compensate for poor key management; a secure algorithm cannot protect data if access controls are misconfigured; and a backup may become a major breach source if it is not encrypted and governed. Learning ObjectivesBy the end of this chapter, students should be able to: - Explain encryption, hashing, digital signatures, certificates, and public key infrastructure.
- Distinguish symmetric and asymmetric cryptography and identify suitable uses for each.
- Describe secure key generation, storage, rotation, recovery, and destruction.
- Classify data and apply appropriate retention, backup, and disposal controls.
- Explain protection of data at rest, in transit, and in use.
- Recognize legal, ethical, governance, and operational responsibilities associated with personal and sensitive data.
- Evaluate a practical data-protection design and identify weaknesses.
1. The Security Purposes of CryptographyCryptography is the disciplined use of algorithms, keys, and protocols to protect information. Its principal security services are: | Service | Meaning | Typical mechanism |
|---|
| Confidentiality | Preventing unauthorized disclosure | Encryption | | Integrity | Detecting unauthorized alteration | Hashes, MACs, digital signatures | | Authentication | Establishing the identity of a party or origin of data | Certificates, signatures, MACs | | Non-repudiation | Providing evidence that supports attribution of an action | Digital signatures, audit records |
Non-repudiation is not created by mathematics alone. It depends on reliable identity proofing, protection of private keys, trustworthy time and audit records, and applicable legal rules. Cryptography does not replace authorization. Encryption may prevent an outsider from reading a file, but an authorized user with excessive privileges may still decrypt it. Effective security uses cryptography together with identity management, least privilege, secure configuration, monitoring, and incident response. 2. EncryptionEncryption transforms plaintext into ciphertext using an algorithm and a key. Decryption reverses the process for an authorized recipient. Modern cryptography assumes that the algorithm may be publicly known; security should depend primarily on protecting the key, not on hiding the algorithm. Symmetric encryptionSymmetric encryption uses the same secret key, or a computationally related secret, for encryption and decryption. It is efficient and suitable for large volumes of data. Common examples include AES and ChaCha20. Authenticated encryption modes such as AES-GCM and ChaCha20-Poly1305 provide confidentiality and integrity together. A nonce or initialization vector is often required. It need not always be secret, but its reuse conditions are strict. For example, nonce reuse with AES-GCM under the same key can seriously compromise confidentiality and authentication. Systems must therefore generate, transmit, and record nonces correctly. A message authentication code, or MAC, verifies that data was produced by someone possessing a shared secret and has not been altered. A MAC does not provide public verifiability because both parties know the same secret. Asymmetric encryptionAsymmetric cryptography uses a public-key and private-key pair. The public key may be distributed, while the private key must remain secret. Public-key operations are computationally more expensive than symmetric encryption and are generally used for key establishment, signatures, or small data objects rather than bulk data encryption. In hybrid encryption, asymmetric cryptography establishes or protects a temporary symmetric session key, and symmetric encryption protects the actual data. This design combines efficient data processing with scalable key distribution. What encryption does not guaranteeEncryption does not automatically ensure that: - the endpoint is free from malware;
- the recipient is authorized;
- the data has not been deleted;
- the key has not been compromised;
- metadata such as timing, size, or communication partners is hidden; or
- backups and temporary files are protected.
3. Hashing and IntegrityA cryptographic hash function maps an input of arbitrary length to a fixed-length digest. Desired properties include preimage resistance, second-preimage resistance, and collision resistance. A small change in input should produce a substantially different digest. Hashing is one-way in normal use; it is not encryption and has no decryption key. SHA-256 and SHA-3 are examples of general-purpose cryptographic hash functions. Older functions such as MD5 and SHA-1 should not be selected for collision-sensitive security applications. Hashes support file-integrity checking, software distribution, digital signatures, and indexed data structures. They do not, by themselves, prove who created a file. Anyone can calculate a hash. To authenticate the source, the digest must be protected by a MAC, digital signature, or trusted distribution channel. Passwords require special treatment. Storing a fast hash of a password is unsafe because attackers can test large numbers of guesses quickly. Password verifiers should use a password-specific, deliberately expensive and memory-hard function such as Argon2id, or an appropriately configured alternative such as scrypt or bcrypt, with a unique salt for each password. A salt is not a secret; it prevents identical passwords from producing identical stored values and limits the usefulness of precomputed tables. 4. Digital SignaturesA digital signature is created by applying a private signing key to a message or, more commonly, to a cryptographic digest of that message. A verifier uses the corresponding public key to test whether the message was altered and whether the signature corresponds to the claimed key. Digital signatures provide integrity and origin authentication under stated assumptions. They do not necessarily provide confidentiality. A signed document may still be readable by anyone unless it is also encrypted. A reliable signature system requires: - a secure private key;
- a trustworthy association between the public key and an identity;
- correct validation of the signature and the signed data;
- protection against replay, where relevant; and
- procedures for expiration, revocation, and compromise.
Signature algorithms and key sizes must follow current standards and organizational policy. Implementations should use established cryptographic libraries rather than designing algorithms independently. 5. Certificates and Public Key InfrastructureA digital certificate binds a public key to an identity or domain through a digitally signed statement. A certificate normally includes the subject, public key, issuer, validity period, permitted uses, and a signature from a certificate authority (CA). Public Key Infrastructure (PKI) is the governance and technical framework used to issue, manage, validate, revoke, and renew certificates. Its components commonly include: - a root CA, which anchors trust;
- subordinate or issuing CAs, which issue operational certificates;
- registration authorities, which validate identity or authorization;
- certificate repositories and status services; and
- policies defining acceptable uses and assurance levels.
When a browser validates a website certificate, it checks such matters as the certificate chain, hostname, validity period, key-usage constraints, signature algorithms, and revocation or status information. Trust is not established merely because a certificate exists; the verifier must validate it in context. Certificate revocation may be communicated through Certificate Revocation Lists or the Online Certificate Status Protocol. Operational designs must account for unavailable status services, caching, short certificate lifetimes, and emergency replacement. 6. Key ManagementKey management is often more difficult than selecting an algorithm. It includes the entire key life cycle: - Generation: keys must be generated using approved cryptographically secure random-number sources.
- Registration and ownership: the system should record purpose, owner, algorithm, strength, creation time, and permitted use.
- Distribution: keys must be delivered through protected channels and only to authorized recipients.
- Storage: private and high-value keys should be protected by hardware security modules, trusted platform facilities, dedicated key-management systems, or equivalent controls where justified.
- Use: keys should be restricted by purpose; a signing key should not casually be reused for encryption.
- Rotation: keys should be replaced according to risk, cryptoperiod, policy, and compromise indicators.
- Backup and recovery: recovery copies must be protected as carefully as active keys.
- Revocation and suspension: compromised or misused keys must be made unacceptable promptly.
- Destruction: obsolete key material must be securely destroyed, including recoverable copies.
Key separation reduces the impact of compromise. Separate keys should generally be used for different environments, tenants, applications, and purposes. Access to key-management functions should require strong authentication, dual control for high-risk operations, and comprehensive audit logging. Key escrow and recovery can support business continuity, but they create concentrated risk. Escrow should be governed by authorization, separation of duties, documented legal authority, and regular testing. 7. Data Classification and HandlingData classification assigns information to categories according to sensitivity, business value, legal obligations, and harm if disclosed, altered, or lost. A simple model might include: | Classification | Example | Typical controls |
|---|
| Public | Published marketing material | Integrity checking and approved publication | | Internal | Routine procedures | Access control and authorized sharing | | Confidential | Contracts, internal financial data | Encryption, restricted access, monitoring | | Restricted or sensitive | Health, payment, identity, or authentication data | Strong encryption, least privilege, enhanced monitoring, strict retention |
Classification should consider confidentiality, integrity, and availability—not confidentiality alone. A public safety system may contain public information but still require strong integrity and availability controls. Data owners should define classification, permitted uses, access groups, retention requirements, and disposal methods. Data custodians implement controls, while users follow handling procedures. Labels should be understandable and applied consistently to databases, documents, emails, removable media, and backups. Data minimization is a central principle: collect and retain only what is necessary for a legitimate purpose. Tokenization and pseudonymization can reduce exposure, but pseudonymized data may remain personal data if re-identification is reasonably possible. 8. Data at Rest, in Transit, and in UseData at restData at rest includes information stored on laptops, servers, databases, cloud storage, removable media, and backups. Controls include full-disk encryption, database or field-level encryption, encrypted backups, access control, secure configuration, and key separation. Full-disk encryption is valuable when a device is lost or powered off. It may not protect data after an authenticated user or malicious process gains access. Field-level encryption can protect especially sensitive attributes but introduces search, performance, and key-management challenges. Data in transitData in transit moves across networks or between processes. Transport Layer Security (TLS) protects many application connections when correctly configured. Secure protocols require certificate validation, modern versions and algorithms, protection against downgrade, and appropriate endpoint authentication. Administrators should disable obsolete protocols and weak cipher suites according to current standards. Encryption of a network connection does not guarantee that the receiving application is trustworthy. Mutual TLS, application authentication, message signatures, and authorization may be needed for service-to-service communication. Data in useData in use is being processed in memory, displayed, queried, or manipulated. It is difficult to protect completely because authorized computation generally requires access to usable information. Controls include least privilege, process isolation, secure enclaves where appropriate, memory protection, endpoint security, masking, access monitoring, and minimizing sensitive data in logs and error messages. Emerging confidential-computing technologies use hardware-supported protected execution environments. They can reduce exposure to certain infrastructure operators, but they do not eliminate risks from compromised applications, stolen credentials, side channels, misconfiguration, or malicious authorized users. 9. Retention, Backup, and Secure DisposalRetention schedules specify how long information is kept and when it must be reviewed or destroyed. Retention should reflect legal requirements, contractual duties, operational need, litigation holds, and historical value. Keeping data indefinitely increases breach impact, storage cost, discovery burden, and privacy risk. A retention programme should identify the record owner, trigger date, retention period, storage location, legal hold process, and approved disposal method. Legal holds suspend ordinary destruction when litigation or investigation requires preservation. Backups support availability and recovery from ransomware, hardware failure, human error, and disasters. Important design considerations include: - recovery point objective (RPO): the maximum acceptable amount of data loss measured in time;
- recovery time objective (RTO): the target time to restore service;
- offline or logically isolated copies;
- encryption and independent key recovery;
- access control and monitoring;
- protection against deletion or alteration; and
- regular restoration tests.
The commonly cited “3-2-1” practice recommends multiple copies, using different media or storage types, with at least one copy kept separately from the primary environment. It is a useful resilience principle, not a substitute for risk assessment. Secure disposal must address the medium and the sensitivity of the data. Methods include cryptographic erasure, secure overwrite where technically appropriate, degaussing for suitable magnetic media, and physical destruction. Simply deleting a file or reformatting a disk may leave recoverable information. Disposal should produce evidence such as asset identifiers, dates, method, authorization, and chain of custody. 10. Legal, Ethical, and Governance ConsiderationsData-protection law varies by jurisdiction, but recurring principles include lawful and transparent processing, purpose limitation, data minimization, accuracy, storage limitation, security safeguards, and accountability. Organizations may also face breach-notification duties, cross-border transfer restrictions, sector-specific rules, contractual obligations, and rights of data subjects. Security professionals should avoid collecting data merely because technology makes collection easy. Monitoring must be proportionate, authorized, transparent where required, and limited to a legitimate purpose. Encryption may conflict with lawful access demands, export controls, evidence preservation, or operational recovery; these tensions require documented governance rather than improvised technical decisions. Artificial intelligence systems create additional data-protection concerns. Training and inference data may contain personal or confidential information. Organizations should define approved data sources, remove unnecessary identifiers, control prompts and logs, restrict model access, evaluate provider terms, and prevent sensitive information from being retained unintentionally. Encryption protects stored and transmitted model data, but it does not by itself prevent model memorization, inference attacks, or inappropriate use. 11. Applied Case: Protecting a Community Health ServiceBackgroundThis illustrative case concerns a community health service that stores patient records in a cloud application, exchanges referrals with hospitals, and operates mobile laptops for clinicians. ProblemAn unencrypted laptop is stolen. The organization also discovers that database backups use shared administrator credentials and that referral emails are sent without reliable recipient verification. The service must reduce exposure while maintaining clinical availability. AnalysisThe records are restricted data. The risks include disclosure from the stolen device, unauthorized backup access, misdirected referrals, excessive privileges, and inability to recover after ransomware. Encryption alone would not address incorrect recipients or shared accounts. Approach and solutionThe service implements full-disk encryption with centrally managed device keys, remote lock and wipe, and strong device authentication. Database backups are encrypted with keys held in a managed key service; backup administration is separated from application administration, and immutable recovery copies are maintained. Referral exchanges use authenticated TLS connections and a verified portal rather than ordinary email attachments. Clinicians receive role-based access, while privileged operations require multi-factor authentication and are logged. Sensitive fields are masked in support environments. A retention schedule removes records that no longer have a legal or clinical purpose, subject to legal holds. Restoration exercises test both data recovery and independent key recovery. OutcomeThe stolen laptop does not expose readable records. Backup compromise becomes more difficult because credentials, keys, and administration are separated. The referral portal reduces misdelivery risk, while testing reveals that recovery procedures—not just backup creation—are essential. Learning pointsThe case demonstrates defence in depth. Data classification drives controls; key management determines whether encryption is meaningful; secure communication requires endpoint and recipient assurance; and availability must be designed alongside confidentiality. 12. Challenges and LimitationsCryptographic systems can fail through weak randomness, nonce reuse, insecure defaults, poor certificate validation, exposed keys, outdated libraries, side-channel leakage, or human error. Compliance labels do not prove effective protection. Strong algorithms may still be undermined by compromised endpoints, cloud misconfiguration, supply-chain attacks, or insiders. Organizations should maintain cryptographic inventories, monitor algorithm and certificate lifetimes, test recovery, conduct independent assessments, and plan migration away from algorithms that are deprecated or vulnerable to future advances. Post-quantum cryptography is an emerging consideration because sufficiently capable quantum computers could threaten some widely used public-key systems. Migration requires inventory, crypto-agility, testing, and attention to hybrid transition strategies; it does not mean abandoning current controls prematurely. Best-Practice Checklist- Classify data before selecting controls.
- Use established, reviewed cryptographic libraries and current standards.
- Prefer authenticated encryption for confidential data.
- Never store passwords as plaintext or as unsalted fast hashes.
- Protect keys separately from encrypted data where practical.
- Validate certificates and identities, not merely encryption status.
- Apply least privilege, separation of duties, and multi-factor authentication.
- Encrypt production data, endpoints, backups, and sensitive transfers.
- Define retention and disposal rules, including legal holds.
- Test backup restoration and key recovery regularly.
- Keep secrets out of source code, logs, tickets, and analytics datasets.
- Record cryptographic events and investigate anomalous key use.
Chapter SummaryCryptography supplies mechanisms for confidentiality, integrity, authentication, and evidence of origin, but its effectiveness depends on implementation and governance. Symmetric encryption efficiently protects bulk data, while asymmetric cryptography supports key establishment and digital signatures. Hashes detect changes but do not authenticate their source. Certificates bind identities to public keys, and PKI manages trust relationships. Key management covers generation, distribution, storage, use, rotation, recovery, revocation, and destruction. Data classification translates business and legal sensitivity into handling controls. Retention limits unnecessary exposure, backups support availability, and secure disposal prevents recovery from discarded media. Protection must address data at rest, in transit, and in use. Finally, technical controls must operate within ethical, legal, and organizational frameworks, supported by least privilege, monitoring, testing, and incident preparedness. Key TermsCryptography: The practice of protecting information using algorithms and keys. Plaintext: Readable information before encryption. Ciphertext: Transformed information produced by encryption. Symmetric encryption: Encryption using a shared secret key. Asymmetric cryptography: Cryptography using related public and private keys. Authenticated encryption: Encryption that provides confidentiality and integrity assurance. Hash function: A function producing a fixed-length digest from input data. Salt: A unique non-secret value added when protecting a password verifier. Message authentication code: A keyed integrity and authentication mechanism. Digital signature: A private-key-based mechanism for integrity and origin verification. Digital certificate: A signed binding between a public key and an identity or domain. Certificate authority: An entity that issues and signs certificates. Public Key Infrastructure: The policies, processes, technologies, and authorities supporting certificate-based trust. Key rotation: Replacing a cryptographic key according to policy or risk. Data classification: Categorizing information according to sensitivity and handling needs. Data at rest: Data stored on a device, system, database, or backup. Data in transit: Data moving between systems or processes. Data in use: Data being processed, displayed, or held in active memory. Recovery point objective: The maximum tolerable period of data loss measured in time. Recovery time objective: The target time for restoring a service or process. Review QuestionsShort Answer Questions- What are the four principal security services provided by cryptography?
- Why is hashing not the same as encryption?
- What is the purpose of a digital certificate?
- Define recovery point objective and recovery time objective.
- Why should password storage use a salt and a password-specific hashing function?
Long Answer Questions- Compare symmetric and asymmetric cryptography, including their strengths, limitations, and common uses.
- Explain the life cycle of a cryptographic key from generation through destruction.
- Describe how a PKI establishes and maintains trust in digital certificates.
- Explain how data classification should influence access, encryption, retention, backup, and disposal decisions.
- Discuss why encryption alone cannot provide a complete data-protection programme.
Analytical / Application Questions- A company encrypts its database but stores the encryption key in the same server configuration file. Analyze the weakness and propose a safer design.
- A hospital wants to retain every patient record permanently “for security.” Evaluate this proposal using data minimization, legal hold, operational, and breach-risk considerations.
- Design a protection strategy for a remote workforce handling restricted data on laptops, during network transmission, in cloud backups, and during active processing.
Multiple Choice Questions with AnswersQuestion 1Which mechanism is primarily designed to provide confidentiality for bulk data? A. Symmetric encryption B. Cryptographic hashing C. Digital signing D. Certificate revocation Correct Answer: A. Symmetric encryption Question 2What is the main security risk of reusing a nonce with AES-GCM under the same key? A. The certificate becomes expired B. Confidentiality and authentication can be seriously compromised C. The plaintext becomes automatically compressed D. The key becomes publicly available by definition Correct Answer: B. Confidentiality and authentication can be seriously compromised Question 3Why is a salt used when storing password verifiers? A. To make the password recoverable B. To replace the need for a password-hashing function C. To prevent identical passwords from producing identical stored values D. To encrypt the database automatically Correct Answer: C. To prevent identical passwords from producing identical stored values Question 4What does a digital signature generally provide? A. Confidentiality without any additional mechanism B. Integrity and evidence associated with the signing key C. Guaranteed anonymity of the signer D. Physical destruction of the signed file Correct Answer: B. Integrity and evidence associated with the signing key Question 5What is the primary role of a certificate authority in PKI? A. To store every user's password B. To issue and sign certificates that bind keys to identities C. To provide all network bandwidth D. To decrypt every encrypted message Correct Answer: B. To issue and sign certificates that bind keys to identities Question 6Which activity is part of cryptographic key management? A. Choosing a document's font B. Generating, protecting, rotating, and destroying keys C. Removing all access logs D. Disabling certificate validation Correct Answer: B. Generating, protecting, rotating, and destroying keys Question 7Which example is data at rest? A. A file stored on an encrypted laptop B. A message moving through a TLS connection C. A value currently displayed in memory during processing D. A spoken password during a telephone call Correct Answer: A. A file stored on an encrypted laptop Question 8What does an RPO define? A. The target time to restore service B. The maximum acceptable amount of data loss measured in time C. The number of encryption keys required D. The period before a certificate is issued Correct Answer: B. The maximum acceptable amount of data loss measured in time Question 9Why is secure deletion more than simply deleting a file? A. Deleted files are always larger than original files B. Deletion may leave recoverable data on the storage medium C. Deletion automatically invalidates every certificate D. Deleted files cannot be backed up Correct Answer: B. Deletion may leave recoverable data on the storage medium Question 10Which control best reduces the impact of a compromised administrator account? A. Shared administrator credentials B. Separation of duties and least privilege C. Permanent retention of all data D. Disabling audit logs Correct Answer: B. Separation of duties and least privilege
|