Fundamentals of Cybersecurity & Cryptography

Chapter 14
Security Analytics, AI and the Future of Cybersecurity

Diploma in Cybersecurity
Fundamentals of Cybersecurity & Cryptography   •   Diploma

Security Analytics, AI and the Future of Cybersecurity

Introduction

Cybersecurity has developed from a primarily defensive technical discipline into a data-driven, socio-technical practice. Modern security teams collect information from identity systems, endpoints, networks, cloud platforms, applications, vulnerability scanners and threat-intelligence services. The central challenge is not merely collecting data, but converting it into reliable evidence for decisions: which risks require treatment, which alerts deserve investigation, whether controls are effective, and how resources should be allocated.

Artificial intelligence (AI) has increased the potential for both attack and defence. Machine-learning systems can identify unusual behaviour, prioritise alerts and support automated containment. The same technologies can generate convincing phishing messages, discover vulnerabilities, imitate individuals and produce deepfakes. Consequently, cybersecurity professionals must evaluate AI not only by capability, but also by accuracy, explainability, privacy, fairness, resilience and governance.

This chapter examines security metrics and basic analytics, AI-enabled defence and response, adversarial AI, deepfakes, post-quantum cryptography, changing regulation, professional expectations and responsible disclosure.

Learning Objectives

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

  1. Distinguish security measurements, metrics, indicators and risk measures.
  2. Calculate and interpret basic operational security metrics.
  3. Use analytics to support risk-based decisions without confusing correlation with causation.
  4. Explain applications and limitations of AI in prevention, detection and response.
  5. Evaluate adversarial AI, deepfakes, privacy risks and algorithmic bias.
  6. Explain why quantum computing threatens some current cryptographic systems and describe the purpose of post-quantum cryptography.
  7. Relate cybersecurity practice to regulation, responsible disclosure and continuing professional development.

1. From Security Data to Security Decisions

A security measurement is an observed value, such as the number of unresolved critical vulnerabilities. A metric is a measurement defined for a particular purpose and method. A key performance indicator (KPI) measures progress toward an operational objective, while a key risk indicator (KRI) signals changing exposure to risk. A dashboard may display all of these, but they should not be treated as interchangeable.

Useful metrics possess several properties:

  • Validity: the metric represents the phenomenon it claims to represent.
  • Reliability: repeated measurement under similar conditions produces consistent results.
  • Timeliness: information arrives soon enough to support action.
  • Comparability: definitions remain stable across teams and reporting periods.
  • Actionability: a responsible person can use the result to make or change a decision.
  • Resistance to gaming: improving the number should require genuine improvement, not merely altered reporting.

A high number of blocked attacks, for example, may indicate effective controls, increased hostile activity, or both. It is not automatically evidence of improved security. Metrics require context, baselines and, where possible, multiple perspectives.

Common operational metrics

MetricBasic interpretationImportant limitation
Mean time to detect (MTTD)Average time between an event or compromise and detectionDepends on the definition of “start” and detection quality
Mean time to respond (MTTR)Average time from detection to effective responseA closed ticket may not mean full remediation
Patch complianceProportion of applicable assets patched within a required periodAsset inventory inaccuracies distort the result
False-positive rateProportion of alerts classified as benignRequires reliable labels and a defined population
Dwell timeTime an attacker remains in an environment before containmentThe true compromise time is often unknown
Phishing-reporting rateProportion of simulated or real messages reported by usersReporting behaviour can improve while prevention remains weak

For a set of n incidents with response times t₁, t₂, …, tₙ, the arithmetic mean is:

MTTR = (t₁ + t₂ + ··· + tₙ) ÷ n

Here, all t values must use the same unit, such as minutes or hours. The mean is sensitive to extreme incidents; a median or percentile may better describe skewed operational data. Metrics should also specify whether scheduled downtime, duplicate alerts or unresolved cases are included.

A confusion matrix is useful when evaluating a detection system. It compares predictions with reality:

Actually maliciousActually benign
Detected as maliciousTrue positive (TP)False positive (FP)
Detected as benignFalse negative (FN)True negative (TN)

Important measures include:

Precision = TP ÷ (TP + FP)
Recall = TP ÷ (TP + FN)

Precision answers: “Of the alerts classified as malicious, how many were malicious?” Recall answers: “Of the malicious cases, how many were detected?” These formulas assume clearly labelled cases and a consistent decision threshold. In security operations, false negatives may be substantially more damaging than false positives, but excessive false positives can create alert fatigue and cause analysts to ignore warnings.

The F1 score combines precision and recall through their harmonic mean:

F1 = 2 × (Precision × Recall) ÷ (Precision + Recall)

It is meaningful only when both precision and recall are relevant and neither is zero. It should not replace a business impact analysis: two systems with the same F1 score may have very different consequences because their errors affect different assets.

Risk-oriented analytics

A simple qualitative risk model represents risk as a combination of likelihood and impact. A numerical approximation is:

Risk exposure = P(event) × Impact(event)

P(event) is the estimated probability of the event during a stated period, and impact must be expressed in a compatible unit, such as monetary loss. This is an approximation, not a universal law. Cyber events may be dependent, probabilities may be uncertain, and reputational or safety impacts may not be easily monetised.

Suppose a service has an estimated annual probability of a serious outage of 0.10 and an estimated impact of £200,000. The expected annual loss is:

0.10 × £200,000 = £20,000

This does not mean that exactly £20,000 will be lost. It is a decision-support estimate. A £15,000 control may be justified if it reduces probability or impact sufficiently, but implementation, maintenance, residual risk and alternative controls must also be considered.

A mature analytics process therefore follows this sequence:

  1. Define the decision and the population being measured.
  2. Identify data sources, owners, collection frequency and quality issues.
  3. Establish a baseline and an appropriate comparison period.
  4. Analyse trends, distributions and outliers.
  5. Validate interpretations with subject-matter experts.
  6. Select an action, owner, deadline and success criterion.
  7. Reassess outcomes and unintended effects.

2. AI-Enabled Cyber Defence

AI is an umbrella term covering systems that perform tasks associated with perception, prediction, language, planning or decision support. Machine learning (ML) systems infer patterns from data. Supervised learning uses labelled examples; unsupervised learning searches for structure without labels; semi-supervised and self-supervised methods use combinations of labelled and unlabelled data. Generative AI produces text, code, images, audio or other content from learned patterns.

Defensive applications

AI can support:

  • Anomaly detection: identifying activity that differs from a learned baseline, such as an unusual login location or data transfer volume.
  • Classification: assigning alerts to categories such as malware, credential abuse or benign administration.
  • User and entity behaviour analytics: comparing actions by users, devices and services with expected behaviour.
  • Threat-intelligence enrichment: extracting indicators, techniques and relationships from reports.
  • Vulnerability prioritisation: combining exploitability, asset importance, exposure and available remediation.
  • Security copilots: summarising alerts, drafting queries and explaining unfamiliar events to analysts.
  • Fraud and identity protection: detecting abnormal transactions, impossible travel or automated account creation.

AI is usually most valuable as decision support rather than as an unquestioned autonomous authority. A model may identify a pattern but cannot independently establish legal authority, business context or acceptable risk.

Automated response

Automated response ranges from notification to full containment. A useful distinction is:

  • Advisory automation: recommends an action; a human approves it.
  • Conditional automation: executes an action when pre-defined conditions and confidence thresholds are met.
  • Autonomous automation: acts without case-by-case human approval.

Response playbooks should define triggers, evidence requirements, permitted actions, rollback procedures, logging, escalation and ownership. For example, disabling a compromised account may prevent damage but disrupt a critical service. Automated isolation should therefore consider asset criticality, identity assurance, confidence and the possibility that an attacker is manipulating the evidence.

Human oversight is not achieved merely by placing a person somewhere in the workflow. The reviewer must have sufficient time, expertise, authority and information to challenge the system. A human who can only approve hundreds of opaque recommendations is functioning as a rubber stamp.

Evaluation of AI systems

An AI security system should be evaluated in its intended operational environment. Relevant questions include:

  • What is the threat model and what failure would be most harmful?
  • Are training and evaluation data representative of current systems and users?
  • How often does performance degrade after deployment?
  • Can analysts understand the evidence supporting an alert?
  • Are confidence scores calibrated, or merely numerical outputs?
  • Can an attacker poison data, evade detection or manipulate prompts?
  • Are outputs logged for audit and incident investigation?
  • Is there a safe fallback when the model is unavailable or wrong?

A model trained on historical analyst decisions may reproduce past inconsistency or bias. A high laboratory accuracy may not transfer to a new cloud architecture, a new malware family or a different language population. Monitoring must therefore include drift, error types, subgroup performance and operational consequences.

3. Adversarial AI, Deepfakes and Trust

Adversarial AI concerns attacks against AI systems and the use of AI by attackers. Examples include:

  • Evasion: modifying malicious input so a detector classifies it as benign.
  • Poisoning: corrupting training data to influence future behaviour.
  • Model extraction: repeatedly querying a service to approximate its model.
  • Membership inference: attempting to determine whether particular data was used for training.
  • Prompt injection: placing instructions in untrusted content to manipulate a language model or its connected tools.
  • Data leakage: causing confidential prompts, documents or system instructions to appear in outputs.

Defences include data provenance, access controls, input and output filtering, adversarial testing, rate limiting, privilege separation, secure tool interfaces, human approval for consequential actions and continuous monitoring. No single control is sufficient.

Deepfakes are synthetic or altered audio, video or images that can impersonate people or manufacture events. They may support fraud, extortion, disinformation, harassment or social engineering. Technical detection can help, but detection systems also produce false results and may become obsolete as generation improves. Organisational controls are essential: verify unusual payment requests through an independent channel, require dual authorisation for sensitive transactions, protect high-value voice and video communications, and preserve provenance where possible.

Privacy and bias

AI systems often require large datasets containing personal, behavioural or sensitive information. Privacy risks include excessive collection, secondary use, re-identification, insecure retention and inference of sensitive attributes. Data minimisation, purpose limitation, retention schedules, access controls, encryption and privacy impact assessments should be applied before deployment.

Bias can arise from unrepresentative data, historical discrimination, proxy variables, measurement errors or unequal error costs. A system that flags one group more frequently may be detecting genuine exposure, biased data, or both. Fairness assessment should examine error rates across relevant groups, but there is no single fairness metric that resolves every social or operational conflict. Security teams must document the purpose of the system, affected populations, acceptable error trade-offs and an appeal or review process.

4. Quantum Threats and Post-Quantum Cryptography

Quantum computing threatens some widely used public-key cryptography. Shor’s algorithm, if run on a sufficiently capable fault-tolerant quantum computer, could undermine the hardness assumptions behind RSA and elliptic-curve cryptography. Grover’s algorithm provides a quadratic speed-up for generic search, which affects symmetric-key brute-force security; increasing key sizes can partially address this issue.

The threat is not necessarily immediate, because practical cryptographically relevant quantum computers require substantial technical development. However, sensitive encrypted information may be harvested today for decryption in the future. This is called the “harvest now, decrypt later” risk.

Post-quantum cryptography (PQC) consists of classical algorithms designed to resist known quantum attacks. Important families include lattice-based, hash-based, code-based and other structured constructions. A PQC migration is not simply an algorithm replacement. Organisations must inventory cryptographic use, identify long-lived confidential data, assess protocol and hardware dependencies, test performance, plan certificate and key-management changes, and support cryptographic agility.

Cryptographic agility means that algorithms and parameters can be changed without redesigning an entire system. It must be implemented carefully: excessive flexibility can create downgrade attacks or configuration errors. Migration priorities should include public-key systems protecting long-lived secrets, high-value identities, software-signing systems, certificates and embedded devices with long replacement cycles. Symmetric cryptography generally requires parameter review rather than wholesale replacement.

5. Regulation, Governance and Professional Responsibility

Cybersecurity professionals operate within legal, regulatory, contractual and ethical boundaries. Requirements vary by jurisdiction and sector, but common themes include protecting personal data, reporting certain incidents, maintaining appropriate safeguards, managing suppliers, preserving evidence and demonstrating accountability. Organisations should map obligations to specific controls, owners, records and review dates rather than treating compliance as a checklist.

AI governance increasingly addresses transparency, risk classification, documentation, human oversight, data governance, security and accountability. A responsible organisation should maintain an inventory of AI systems; record purpose, data sources, model version and owners; conduct impact and security assessments; restrict high-risk uses; and define incident reporting and decommissioning procedures.

Responsible disclosure

Responsible disclosure is the coordinated communication of a vulnerability to the affected supplier or operator, allowing reasonable time for investigation and remediation. A professional report should contain a concise description, affected versions, reproducible steps, evidence, security impact and suggested mitigation. Researchers should minimise access, avoid unnecessary data collection, protect obtained information, respect legal boundaries and agree communication timelines where possible.

Organisations should publish a vulnerability disclosure policy, provide a reporting channel, acknowledge receipt, triage consistently, communicate progress and avoid retaliatory treatment of good-faith researchers. Coordinated disclosure does not guarantee secrecy or a particular remediation deadline; it is a process for reducing harm while enabling effective correction.

6. Workforce Expectations and Continuous Development

Employers increasingly expect diploma-level practitioners to combine technical competence with judgement and communication. Core capabilities include log analysis, scripting, identity and access management, cloud fundamentals, vulnerability management, incident handling, documentation, evidence preservation and secure use of AI tools. Equally important are critical thinking, teamwork, risk communication and the ability to explain uncertainty.

Continuous professional development should be evidence-based. A practical development cycle is:

  1. Assess current capability against a role profile.
  2. Identify a small number of measurable gaps.
  3. Select learning activities such as labs, supervised work, standards study or professional communities.
  4. Apply learning to a controlled project.
  5. Obtain feedback and record evidence.
  6. Reassess and update the plan.

Professionals should understand the limits of their authority, protect confidential information, declare conflicts of interest and refuse unsafe instructions. Certifications can provide structure, but competence is demonstrated through sound decisions and reproducible practice.

Applied Case: Illustrative Regional Health Provider

Background

A fictional regional health provider operates hospitals, outpatient clinics and a cloud-hosted appointment service. Its security operations centre receives approximately 18,000 alerts per month. Analysts report high workload, inconsistent escalation and delayed containment of compromised accounts. The provider is also concerned about future exposure of encrypted medical archives.

Problem

Management proposes purchasing an AI platform and measuring success solely by the number of alerts automatically closed. This approach risks hiding false negatives, encouraging unsafe automation and ignoring cryptographic migration.

Analysis

The security team first defines decisions and baselines. It measures MTTD and MTTR by incident severity, precision and recall for high-confidence detection rules, unresolved critical vulnerabilities, privileged-account coverage and the proportion of alerts with complete investigation records. It samples closed alerts to estimate missed incidents and separates duplicate alerts from distinct events.

The team identifies that the existing data is biased toward systems with good logging. Clinical devices have limited telemetry, so apparent low risk may reflect low visibility. It also finds that historical analyst labels are inconsistent. The AI vendor’s benchmark therefore cannot be accepted without local testing.

Approach and solution

The provider deploys the system initially in advisory mode. It uses AI to summarise evidence and prioritise alerts, while analysts approve account disabling and network isolation. High-impact actions require two-person approval, and every automated recommendation records its evidence, model version and decision.

A pilot evaluates performance by incident type and asset class. The provider monitors false negatives, subgroup effects in identity analytics, prompt-injection attempts against the security copilot and data retention. Staff are instructed not to place identifiable patient information into an unapproved AI service.

In parallel, the provider performs a cryptographic inventory. It identifies external certificates, VPNs, software signing, archival encryption and medical devices with long replacement cycles. It begins a documented PQC-readiness programme, prioritising long-lived records and systems that cannot be rapidly upgraded.

Outcome

After the pilot, alert volume falls because of improved correlation and suppression of duplicates, but the organisation does not claim that every closed alert represents a prevented attack. High-severity detection recall improves, while some low-volume device categories remain uncertain because of inadequate telemetry. The provider funds logging improvements and retains human approval for disruptive actions. Its board receives a balanced report showing operational performance, residual risk, data limitations and migration status.

Learning points

The case demonstrates that analytics must be connected to decisions, AI must be evaluated in context, automation requires controls, and future cryptographic risk should be managed before a quantum emergency. A single attractive metric can conceal serious weaknesses.

Challenges and Limitations

Security analytics faces incomplete, inconsistent and adversarial data. Attackers deliberately imitate normal behaviour, suppress logs and exploit blind spots. Metrics can encourage harmful behaviour when targets are poorly designed. AI systems may amplify historical bias, produce confident errors, expose sensitive data or fail after environmental change. Automation can reduce workload but also increase the scale and speed of mistakes.

PQC migration has its own difficulties: algorithm performance, interoperability, certificate size, constrained devices, vendor dependencies and uncertain replacement cycles. Regulation may differ across jurisdictions and change faster than organisational processes. These problems require layered controls, documented assumptions, independent review and regular reassessment rather than a claim of perfect security.

Best-Practice Checklist

  • Define each metric, population, unit, owner and reporting period.
  • Combine outcome, process and exposure measures.
  • Report uncertainty, missing data and changes in measurement.
  • Evaluate detection systems using precision, recall and operational impact.
  • Test AI against drift, adversarial inputs, privacy leakage and bias.
  • Keep consequential automated actions reversible and auditable.
  • Apply least privilege to AI tools and connected data sources.
  • Verify high-risk requests through independent channels.
  • Inventory cryptographic dependencies and plan for algorithm agility.
  • Maintain a vulnerability disclosure policy and protect good-faith reporters.
  • Document decisions and continue professional development.

Chapter Summary

Security analytics converts observations into evidence for operational and risk decisions. Effective metrics are valid, reliable, timely, comparable and actionable; precision, recall, response-time measures and risk estimates must be interpreted with clear assumptions. AI can improve detection, prioritisation and response, but its outputs are probabilistic and vulnerable to drift, manipulation, privacy leakage and bias. Human oversight must be meaningful, and automation should be bounded by authority, reversibility and auditability.

Adversarial AI and deepfakes challenge trust in data, identity and communications. Privacy protection, fairness assessment and secure system design are therefore part of AI security. Quantum computing creates a long-term threat to some public-key systems, making cryptographic inventory, agility and post-quantum migration important today. Finally, professional cybersecurity practice depends on governance, responsible disclosure, legal awareness and continuous development.

Key Terms

Adversarial AI: Use of AI to attack AI systems or application of AI by attackers.

Anomaly detection: Identification of activity that differs from an expected pattern.

Cryptographic agility: Ability to change cryptographic algorithms and parameters safely.

Deepfake: Synthetic or altered media intended to imitate a real person or event.

Dwell time: Period an attacker remains in an environment before detection or containment.

False positive: Benign activity incorrectly classified as malicious.

F1 score: Harmonic mean of precision and recall.

Generative AI: AI that creates content such as text, code, images, audio or video.

Key performance indicator: Metric used to assess progress toward an operational objective.

Key risk indicator: Measure that signals changing risk exposure.

Machine learning: Methods that learn patterns from data to produce predictions or decisions.

Mean time to detect: Average time between an event or compromise and its detection.

Mean time to respond: Average time between detection and effective response.

Membership inference: Attempt to determine whether particular data was used to train a model.

Post-quantum cryptography: Cryptography designed to resist known attacks from quantum computers.

Precision: Proportion of positive classifications that are actually positive.

Recall: Proportion of actual positive cases that are detected.

Responsible disclosure: Coordinated reporting of vulnerabilities to enable remediation and reduce harm.

Threat model: Structured description of assets, adversaries, threats, assumptions and controls.

Training-data poisoning: Deliberate corruption of training data to influence model behaviour.

Review Questions

Short Answer Questions

  1. Distinguish a KPI from a KRI.
  2. What do precision and recall measure in a detection system?
  3. Why can a high number of blocked attacks be misleading?
  4. State two risks associated with generative AI in security operations.
  5. What is cryptographic agility?

Long Answer Questions

  1. Explain how an organisation should design and govern a security analytics programme.
  2. Compare advisory, conditional and autonomous automated response, including suitable safeguards.
  3. Discuss privacy and bias risks in AI-enabled identity analytics.
  4. Explain the quantum threat to public-key cryptography and describe a PQC migration approach.
  5. Describe the responsibilities of a researcher and an organisation in responsible disclosure.

Analytical / Application Questions

  1. A detector records TP = 90, FP = 10 and FN = 30. Calculate its precision and recall, and explain which operational question each answers.
  2. A board wants to judge an AI security platform solely by the number of alerts it closes. Critique this proposal and recommend a balanced measurement set.
  3. A finance employee receives a video call from an executive requesting an urgent transfer. Apply deepfake-resistant verification and responsible security procedures to this situation.

Multiple Choice Questions with Answers

Question 1

Which measure answers the question: “Of the alerts classified as malicious, how many were actually malicious?”

A. Recall

B. Precision

C. Dwell time

D. MTTD

Correct Answer: B. Precision

Question 2

A detector has TP = 80 and FP = 20. What is its precision?

A. 20%

B. 50%

C. 80%

D. 100%

Correct Answer: C. 80%

Question 3

Which is an example of model poisoning?

A. Blocking a user after a confirmed compromise

B. Changing training data to influence future classifications

C. Encrypting a model’s stored parameters

D. Reducing an alert’s severity after analyst review

Correct Answer: B. Changing training data to influence future classifications

Question 4

Why should high-impact automated response actions usually be reversible and auditable?

A. Because AI outputs are always correct

B. Because reversibility eliminates all cyber risk

C. Because incorrect or manipulated decisions can cause operational harm

D. Because audit logs replace access controls

Correct Answer: C. Because incorrect or manipulated decisions can cause operational harm

Question 5

Which technology is most directly threatened by Shor’s algorithm on a sufficiently capable quantum computer?

A. RSA public-key cryptography

B. A password manager interface

C. A security awareness poster

D. A firewall rule table

Correct Answer: A. RSA public-key cryptography

Question 6

What is the main purpose of a cryptographic inventory?

A. To count the number of security analysts

B. To identify where algorithms, keys and certificates are used

C. To measure employee satisfaction

D. To replace all symmetric encryption immediately

Correct Answer: B. To identify where algorithms, keys and certificates are used

Question 7

Which practice best helps resist a deepfake-based payment request?

A. Trusting the caller’s voice if it sounds familiar

B. Using an independent channel to verify the request

C. Removing dual authorisation requirements

D. Publishing the request publicly before acting

Correct Answer: B. Using an independent channel to verify the request

Question 8

Which statement about recall is correct?

A. It is TP ÷ (TP + FN)

B. It is TP ÷ (TP + FP)

C. It measures average response time

D. It is always equal to precision

Correct Answer: A. It is TP ÷ (TP + FN)

Question 9

Which action is consistent with responsible disclosure?

A. Publishing sensitive data immediately to prove the vulnerability

B. Accessing unrelated systems to increase publicity

C. Providing reproducible evidence while minimising harm

D. Selling the vulnerability without notifying anyone

Correct Answer: C. Providing reproducible evidence while minimising harm

Question 10

Why might a high laboratory accuracy score fail to predict field performance for an AI detector?

A. Security data never changes

B. The deployment environment, threats and data distribution may differ

C. Accuracy is unrelated to data

D. Field systems cannot generate logs

Correct Answer: B. The deployment environment, threats and data distribution may differ

Fundamentals of Cybersecurity & Cryptography
Chapter 14 of 14