TodaKey: Persistent homology for deterministic key diversification in hybrid post-quantum medical image encryption
Figures
Abstract
Medical images contain confidential patient data and must be protected during electronic transmission or storage. Ensuring the security of such information is a critical requirement in healthcare systems. Although various encryption techniques are available, there is increasing concern that many may become vulnerable with the development of quantum computing. This paper presents TodaKey (Topological Data Analysis Key), a construction that uses persistent homology for deterministic key diversification within a hybrid post-quantum framework for medical image encryption. In the construction, a 256-bit secret seed s is provided as input. For each seed, a 256-bit symmetric key kfinal is obtained through a deterministic process. The seed is first mapped to 80 points in 5 dimensions using a PCG64 pseudorandom generator seeded by the first 64 bits of . Persistent homology is computed over an alpha-complex filtration, and the finite birth–death pairs are rounded to six decimal places, canonically serialized, and hashed with SHA3–256 to produce a topological fingerprint htopo. The fingerprint is combined with the seed through a two-layer HKDF-HMAC-SHA256 key schedule to produce the final symmetric key. AES-256-GCM uses this key to protect medical images, while CRYSTALS-Kyber provides post-quantum key encapsulation. The security of TodaKey rests on the seed, SHA3–512, SHA3–256, HKDF-HMAC-SHA256, AES-256-GCM, and CRYSTALS-Kyber; persistent homology contributes diversification only. Experimental results demonstrate the practical feasibility of the approach. Evaluation on 100 medical images across four modalities (cardiac MRI, lung X-ray, breast ultrasound, and mammography) shows metrics close to theoretical ideals, including NPCR = 99.61% ± 0.07%, UACI = 33.47% ± 0.18%, and information entropy = 7.9992 ± 0.0004 (mean ± pooled per-image standard deviation). The average key-generation time is approximately 1.76 seconds, with persistent homology accounting for roughly 91.5% of this cost. A single-bit change in the input seed alters approximately 128.4 out of 256 bits in the output key, an avalanche effect attributable to SHA3–512 and HKDF-HMAC-SHA256. Ablation studies show that the topological layer does not significantly improve statistical metrics over a standard HKDF/SHA3 baseline, so TodaKey is presented as a deterministic diversification layer rather than a security layer. The construction is intended for offline or batch key derivation, where the additional computational cost can be amortized.
Citation: Bibi S, Ali R (2026) TodaKey: Persistent homology for deterministic key diversification in hybrid post-quantum medical image encryption. PLoS One 21(12): e0363875. https://doi.org/10.1371/journal.pone.0363875
Editor: Chun-Wei Yang, China Medical University Taiwan, TAIWAN
Received: August 26, 2026; Accepted: November 15, 2026; Published: December 2, 2026
Copyright: © 2026 Bibi, Ali. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The author-generated code and reproducibility artefacts (reference implementation, three fixed-seed test vectors, verifier script, and documentation) that underpin the key-generation procedure described in this manuscript are available without restriction at Zenodo via https://doi.org/10.5281/zenodo.23556827. No new experimental data were generated beyond these code and reproducibility artefacts. The following existing, publicly available, de-identified medical image datasets were used: - Cardiac MRI: M&Ms Challenge (Multi-centre, multi-vendor, multi-disease cardiac segmentation challenge), available via https://www.ub.edu/mnms/ - Lung X-ray: CDC Public Health Image Library (PHIL), available via https://phil.cdc.gov - Breast ultrasound: Breast Ultrasound Images (BUSI) dataset, available via DOI https://doi.org/10.1016/j.dib.2019.104863 - Mammography: Mini-MIAS database of mammograms, available via http://peipa.essex.ac.uk/info/mias.html. No restrictions apply to any of these datasets. All datasets are de-identified and publicly accessible without registration. No ethical or legal restrictions apply to the data underlying this study.
Funding: The author(s) received no specific funding for this work.
Competing interests: The authors have declared that no competing interests exist.
Introduction
The advent of quantum computing poses serious threats to traditional public-key cryptography, as algorithms such as RSA and ECC could be compromised by Shor’s algorithm [1] and Grover’s algorithm [2]. This is particularly concerning for medical imaging data, which require long-term confidentiality spanning several decades [3]. Post-quantum cryptography (PQC) has accordingly gained attention, especially in key generation and entropy management [4,5]. Hybrid encryption, combining CRYSTALS-Kyber (a NIST-standardized KEM) with AES-256-GCM, has emerged as a standard approach for securing sensitive information [6,7]. Although Kyber provides quantum-resistant key exchange, symmetric key generation still depends on traditional pseudorandom number generators, making quantum-resistant entropy generation an active research area [8,9]. Grover’s algorithm reduces AES-256 security to 128 bits against quantum adversaries, which remains acceptable for medical applications.
System security in PQC depends not only on cryptographic primitives but also on supporting processes, including high-quality entropy generation [5]. Kyber has been shown suitable for resource-constrained IoT devices and medical data transmission, even with hardware accelerators [4,10,11]. Recent systematic reviews have also examined quantum-secure communication approaches for future cyber-physical and Internet of Things systems, covering developments from classical cryptographic methods to learning-based approaches [12]. Hybrid encryption schemes have been formally proven IND-CCA secure under the Fujisaki-Okamoto transformation [13]. Recent entropy accumulation research by Merkulov et al. [8] suggests that multiple entropy sources improve robustness. However, traditional KDFs such as HKDF [14] derive keys from pseudorandom inputs, with security depending on entropy source quality and hash construction hardness. Chaos-based systems [9,15] generate entropy from deterministic nonlinear dynamics but lack formal post-quantum security guarantees [16]. Similarly, chaos-based cryptosystems proposed for medical imaging [9,15,17–19] have demonstrated strong statistical performance, yet many rely on classical key exchange mechanisms vulnerable to structural cryptanalysis [16]. Security challenges in such schemes have been critically examined by Chen et al. [20], identifying vulnerabilities to chosen-plaintext attacks and insufficient diffusion. A recent review of chaos-based image encryption [21] reaches a similar conclusion, noting that most chaos-based schemes provide strong statistical performance but lack reduction to established cryptographic assumptions and are often vulnerable to cryptanalysis when the key stream is not bound to the plaintext.
Medical imaging data require long-term confidentiality and integrity, making them a critical application domain for post-quantum security. PQC-based solutions for medical devices have been introduced, replacing classical KEMs with PQC-based alternatives [9,22]. Li et al. [23] examined the compression-security trade-off in encryption-then-compression systems, demonstrating that block-wise relationships can be recovered via jigsaw puzzle solvers, revealing that block scrambling-based encryption may be overestimated. This highlights the need for rigorous security evaluation of joint compression-encryption systems. Quantum image encryption has shown promise, with Hao et al. [24] proposing a hybrid NEQR cryptosystem using quantum walks and coding, achieving strong metrics (NPCR 99.61%, UACI 33.47%) and key sensitivity. However, quantum-inspired methods face hardware implementation challenges and typically require specialized quantum simulators or computers [25].
To address the limitations of existing key-derivation approaches, this work draws upon Topological Data Analysis (TDA), particularly persistent homology, which extracts stable quantitative descriptors from high-dimensional data [26]. Persistence diagrams represent topological features compactly, and their inversion is believed computationally difficult in general settings, as formalized by the Persistent Homology Inverse Problem (PHIP) [27,28]. Topology-based notions have been applied in cryptographic protocol design, notably in topology-hiding computation [29], but persistent homology itself is typically treated separately from cryptography rather than integrated within a single key-schedule construction. No existing work has integrated persistent homology as a deterministic diversification layer within a standardized post-quantum key-derivation and encryption pipeline for medical images.
This paper introduces TodaKey, a topology-aware key-derivation framework linking key generation with persistent homology. TodaKey operates entirely on classical hardware while providing post-quantum key encapsulation through CRYSTALS-Kyber, and addresses the security gaps in chaos-based schemes by anchoring security in AES-256-GCM and CRYSTALS-Kyber. Persistent homology is used as a deterministic structural-diversification layer, not as a source of cryptographic entropy. The security of TodaKey rests on the seed, SHA3–512, SHA3–256, HKDF-HMAC-SHA256, AES-256-GCM, and CRYSTALS-Kyber. An input seed is transformed into a structured 80-point cloud in 5 dimensions, whose persistent homology deterministically diversifies the input to a 256-bit symmetric key for AES-256-GCM medical image encryption.
The key contributions are:
- A TodaKey key-derivation mechanism that uses persistent homology as a deterministic structural-diversification layer within a standard SHA3–512 and HKDF-HMAC-SHA256 key schedule;
- A hybrid post-quantum construction combining SHA3–512, SHA3–256, HKDF-HMAC-SHA256, AES-256-GCM, and CRYSTALS-Kyber, with an explicit threat model, seed-management description, salt and determinism statement, and domain-separation analysis;
- An empirical evaluation on 100 medical images across four modalities (cardiac MRI, lung X-ray, breast ultrasound, and mammography) with ablation studies, robustness tests under noise, JPEG compression, and cropping, statistical analysis of key sensitivity, and reproducibility artefacts, including an honest report of where the topological layer does not improve security metrics over a standard HKDF/SHA3 baseline.
The remainder of the paper is organized as follows. The preliminaries on topological data analysis, persistent homology, AES-GCM, and Kyber-512 are presented first. The TodaKey protocol specification follows, covering the system and threat models, seed and salt management, and the key-generation, encryption, and decryption algorithms. A formal security analysis then establishes IND-CCA2 security, the post-quantum security category, key separation, and domain separation. Experimental results on 100 medical images across four modalities are reported next, followed by discussion, limitations, and future work.
Table 1 summarizes the key notation used throughout this paper.
Preliminaries
This section provides the mathematical and cryptographic background for the TodaKey protocol and for the hybrid post-quantum cryptosystem for medical images.
Topological data analysis and persistent homology
TDA is a mathematical framework for extracting structural and shape-related information from data. Unlike classical statistical methods that focus on local or linear properties, TDA captures global geometric and topological features that remain stable under continuous deformations. The central tool in TDA is persistent homology, which quantifies how topological features evolve across multiple spatial or scale parameters [28].
The primary object of study is a point cloud , which can be viewed as a finite sampling of an unknown geometric space or manifold. To analyze its underlying structure, a family of simplicial complexes is constructed over varying scales. One widely used construction is the alpha complex [30], which is derived from the Delaunay triangulation [31] and parametrized by a scale variable .
Definition 0.1 (Alpha complex). For a point cloud and a real parameter , the alpha complex is a simplicial complex in which a simplex is included if there exists a point such that:
- The squared Euclidean distance satisfies for all vertices .
- The closed balls B(p, r) centered at each vertex intersect non-trivially, where .
Equivalently, can be interpreted as the nerve complex of a family of restricted Voronoi regions induced by P [31]. It is homotopy-equivalent to the union of balls , and therefore preserves the same homological features as the corresponding Čech complex while typically being more computationally efficient [28].
As the scale parameter increases from 0 to , the alpha complexes form a nested filtration:
Applying k-dimensional homology with coefficients in a field (commonly for computational efficiency) transforms this filtration into a sequence of vector spaces connected by linear maps:
Persistent homology studies the evolution of these homology classes across the filtration. A homological feature is said to be born at scale when it first appears in , and it dies at scale when it merges with an existing feature or becomes trivial in . The persistence interval quantifies the lifetime of each feature.
For k = 0, persistent homology tracks connected components of the point cloud; for k = 1, it captures one-dimensional loops or cycles; and for k = 2, it identifies void-like structures in higher-dimensional embeddings [28]. The resulting multiscale summary is typically represented as a persistence diagram or barcode, which provides a compact and stable encoding of the underlying topology.
Definition 0.2 (Bottleneck distance). For two persistence diagrams D and , the bottleneck distance is defined as:
where ranges over all bijections between D and , and points on the diagonal are allowed as matches. This distance is stable under small perturbations of the input point cloud [32].
Topological feature count.
The topological feature count is defined as the total number of persistent homology features extracted from a point cloud across all homology dimensions:
where denotes the number of points in the persistence diagram of dimension k (excluding essential classes with infinite death time).
This definition measures the combinatorial richness of the geometric structure of a point cloud, not cryptographic min-entropy. The term topological feature count refers solely to the number of topological structures identified through persistent homology. It is distinct from topological entropy, which characterizes the complexity of a dynamical system, and from cryptographic entropy, which measures the unpredictability of cryptographic keys and outputs.
Fig 1 illustrates the persistent homology pipeline used in this work. The operator PH(P) is deterministic, lossy, and stable under small perturbations of P [26]. It is used as a deterministic structural-diversification step in the TodaKey key-derivation layer; it is not used as a cryptographic hardness source.
(a) Input point cloud, (b) alpha complex filtration, (c) persistence diagram.
The persistent homology inverse problem
The computational process of persistent homology can be viewed as a lossy transformation whose inversion is computationally intractable in general settings. The PHIP definition is included for completeness, because it motivates the deterministic use of persistence diagrams as a diversification input. It is not used as a security foundation in TodaKey.
Definition 0.3 (Persistent Homology Inverse Problem (PHIP)). Let D be a persistence diagram and a tolerance parameter. The PHIP [28] is the problem of finding a point cloud such that
where denotes the bottleneck distance between persistence diagrams.
Intuitively, PHIP asks whether one can reconstruct a geometric realization whose persistent homology approximates a given diagram within tolerance . Since the mapping PH is deterministic, lossy, and highly non-injective, infinitely many geometrically distinct point clouds may yield similar persistence diagrams [28]. This makes inversion fundamentally ill-posed in general.
Authenticated encryption with AES-GCM
AES-GCM is an authenticated encryption scheme that combines encryption and authentication to provide both confidentiality and integrity in a single construction [33]. AES-GCM requires a symmetric key K (256-bit for AES-256), a unique initialization vector IV, plaintext Pplain, and optional associated data A [34]. The encryption algorithm outputs a ciphertext Cct and an authentication tag . The decryption algorithm recovers the plaintext Pplain or returns a failure symbol . The security of GCM relies on the uniqueness of IV for each encryption under the same key K.
Key encapsulation mechanisms and Kyber-512
To establish the symmetric AES-GCM key K in a quantum-resistant manner, a KEM is used [6]. A KEM is a triple of algorithms [35]. Kyber’s security is based on the hardness of the Module Learning with Errors (MLWE) problem [6]. Kyber-512 is employed in the key-wrapping stage. Kyber-512 is a NIST Category 1 parameter set; it is not claimed here to provide 128-bit post-quantum security in the strict sense. The overall post-quantum security statement for the hybrid scheme is given in the Security analysis section.
The Kyber-512 KEM consists of three algorithms. generates a public key pk and a secret key sk. takes the recipient’s public key and outputs a ciphertext c and a shared secret . recovers the shared secret using the recipient’s secret key. Correctness holds with overwhelming probability.
In the hybrid TodaKey architecture, the sender runs with the receiver’s public key pkrec. The shared secret wraps the topologically diversified final key kfinal for transmission. The receiver recovers via and unwraps kfinal for AES-GCM decryption.
TodaKey protocol specification
This section presents the TodaKey protocol and its integration into a hybrid post-quantum encryption framework for medical image security.
System model
Entities. The TodaKey protocol operates in a two-party setting consisting of a sender and a receiver.
- Sender : The data owner who encrypts medical images before transmission.
- Receiver : The authorized recipient who possesses the corresponding secret key material required for decryption and image recovery.
Threat model and adversarial capabilities. A quantum-capable adversary is assumed to operate over an insecure communication channel. The adversary may eavesdrop, modify, replay, or inject messages. The adversary does not have direct access to secret keys except through computationally bounded attacks. Security is defined under the IND-CCA2 model in the presence of quantum adversaries, following standard post-quantum cryptographic assumptions. The adversary is assumed to have access to the public parameters, the receiver’s public key pkrec, and all transmitted ciphertext components. The adversary does not have access to the seed s, the derived keys, or any secret state stored on the endpoints. Side-channel leakage and physical endpoint compromise are explicitly out of scope.
Seed generation, storage, and sharing. The seed is a secret symmetric value. It is generated by a cryptographically secure pseudorandom number generator (CSPRNG) on the sender side or established through an authenticated key-establishment protocol such as ML-KEM/Kyber or a pre-shared secret. The seed is never transmitted on the channel in plain form. It is stored in a secure keystore on the sender side and, where re-derivation is required, on the receiver side.
Salt usage and determinism. TodaKey uses two 32-byte salts, salt and . Two modes of operation are supported:
- Randomized mode (default). Both salt and are generated freshly using a cryptographically secure random number generator (secrets.token_bytes(32) in the reference implementation) for every key derivation. The salt salt is transmitted alongside the ciphertext and bound to it via AES-GCM associated data. Randomized mode is recommended for deployment.
- Deterministic mode. Both salts are fixed context strings. The same seed always produces the same kfinal. This mode is intended for key escrow, archival, and reproducible test vectors.
The experiments in the Experimental results section use deterministic mode with fixed salts for reproducibility. The algorithms below treat salt and as explicit inputs so that both modes are covered.
Core algorithms and encryption flow
This subsection describes the main components of the TodaKey framework and its end-to-end encryption pipeline.
TodaKey key generation.
The key-generation procedure derives a symmetric key from a cryptographic seed using topological feature extraction as a deterministic structural-diversification step.
The parameters n = 80 and d = 5 were selected based on the parameter-selection discussion in the Topological feature distribution section. The PRECISION parameter controls decimal rounding of birth and death values and is set to 6 in the reference implementation.
Algorithm 1
1: ▷ 805 point cloud via PCG64 seeded by first 64 bits of
2:
3:
4:
5:
6:
7:
8:
9:
10:
11: return kfinal
Remark on the two-layer construction. The two-layer construction is a standard key-schedule design with an intermediate-key step. In the first layer, the seed s and the topological fingerprint htopo are combined via SHA3–512 and then compressed with HKDF-HMAC-SHA256 to produce an intermediate key . In the second layer, and htopo are again combined via SHA3–512 and compressed with HKDF-HMAC-SHA256 to produce kfinal. The purpose of the two layers is to bind the topological diversification input to both the seed and the intermediate key, providing domain separation between the two derivation stages. Cryptographic security derives from SHA3–512, HKDF-HMAC-SHA256, and the min-entropy of the seed; the topological layer adds diversification.
Topological fingerprint extraction.
This module converts persistence diagrams into a deterministic digest. Algorithm 2 summarizes this procedure.
Algorithm 2
1:
2: for do
3: if then
4:
5: end if
6: end for
7: ▷ lexicographic order over (dim, b, d)
8: ▷ canonical serialization
9:
10: return htopo
Determinism of the point-cloud construction. The point cloud is generated deterministically as follows. The context string is appended to the seed; the first 8 bytes of are interpreted as a 64-bit big-endian integer and used to seed a PCG64 pseudorandom generator. The generator draws standard-normal samples. A deterministic warping is then applied:
Each row is L2-normalized. Persistent homology is computed on the alpha-complex filtration with maximum homology dimension 2. Birth and death values are rounded to six decimal places, sorted lexicographically over (dim, b, d), canonically serialized, and hashed with SHA3–256 to obtain htopo. Because the exact multiset of persistence bars depends on how the alpha-complex filtration is constructed, the H1 and H2 bar counts can differ across implementations of persistent homology, while the number of finite H0 bars is invariant.
Medical image encryption.
After deriving kfinal, medical image encryption is performed using AES-256-GCM, which provides confidentiality and integrity simultaneously.
Given an image Iimage, the process is:
- DICOM handling. For the 8-bit experiments reported in this paper, DICOM images are normalized from 12–16 bit to 8-bit using linear scaling. This normalization is lossy; the decrypted output reproduces the normalized 8-bit image exactly, not the original clinical DICOM image. The same pipeline supports full bit-depth encryption by treating the image as a byte array and encrypting the full bit-depth representation; the full bit-depth variant is required for clinically lossless reconstruction.
- Extract metadata as associated data A for integrity protection.
- Generate a random 96-bit IV for AES-GCM. In randomized mode, salt is also transmitted and bound to A.
- Encrypt using kfinal to obtain .
Hybrid encryption algorithm.
This algorithm describes the end-to-end encryption process of the TodaKey framework, combining topological key diversification, post-quantum key encapsulation, and authenticated encryption. Algorithm 3 defines the end-to-end encryption procedure.
Algorithm 3
1: ; ▷ randomized mode
2:
3:
4: ▷ associated data
5:
6:
7:
8:
9: return
Key encapsulation, protection, and decryption
The following operations complete the TodaKey protocol by securing the key for transmission and enabling recovery of the original medical image.
- Key encapsulation and protection. Kyber-512 is used to establish a post-quantum shared secret under the Module-LWE (MLWE) hardness assumption [6]. The diversified key kfinal is then wrapped using symmetric authenticated encryption with a randomly generated initialization vector :
This separation ensures a layered design in which compromise of one primitive does not directly expose the other. The use of a fresh random for each encryption prevents IV-reuse attacks under the same . - Decryption procedure. The decryption process reverses the hybrid construction and reconstructs the normalized image only if both authentication layers succeed.
Algorithm 4
1:
2:
3: if then
4: return
5: end if
6:
7:
8: if then
9: return
10: end if
11: return Iimage
The decryption procedure provides two layers of authentication. The key-wrapping layer uses recovered via Kyber decapsulation; authentication failure at this stage indicates tampering with the wrapped key or associated data. The data-encryption layer uses kfinal with AES-GCM; authentication failure here indicates modification of the image ciphertext, IV, or associated data. Only when both authentication checks succeed is the image recovered. Any tampering with ciphertext, tag, or associated data results in , preventing the use of corrupted medical images.
Security analysis
This section provides the security analysis of the TodaKey hybrid encryption scheme. All adversaries are probabilistic polynomial-time (PPT) unless stated otherwise. Security is defined with respect to negligible functions in the security parameter , with probabilities taken over the randomness of the algorithms. The analysis follows simulation-based and reduction-based proof methodology.
Security foundations
The security of TodaKey rests entirely on standard cryptographic primitives:
- CRYSTALS-Kyber (ML-KEM), IND-CCA2 secure under the MLWE hardness assumption [6].
- AES-256-GCM, IND-CPA and INT-CTXT secure under the standard assumptions on AES and GCM [7,34].
- SHA3–512, SHA3–256, and HKDF-HMAC-SHA256, modeled as random oracles for the security proof [14,36].
SHA-256 is used only in to expand the seed into a 64-bit PCG64 seeding value. It is not part of any security claim: the only property required of SHA-256 at this step is that it be deterministic and that its first 8 bytes be well distributed, which a standard cryptographic hash satisfies.
The topological layer supplies a diversification input htopo to the key schedule and adds no cryptographic assumption of its own. The Seed-Based Persistent Homology Inverse Problem (SB-PHIP) is discussed in the Auxiliary heuristic subsection as an auxiliary, exploratory notion and is not invoked in any security proof.
The following security properties are established:
- IND-CCA2 security of the TodaKey hybrid encryption scheme (Theorem 0.1).
- Post-quantum security statement expressed in terms of NIST categories (Theorem 0.2).
- Key separation between the derived symmetric key and the Kyber shared secret (Theorem 0.3).
- Domain separation across encryption contexts (Theorem 0.4).
IND-CCA2 security of the TodaKey hybrid scheme
Theorem 0.1 (IND-CCA2 security of ). Let denote the TodaKey hybrid encryption scheme defined by Algorithms 1–4. If is IND-CCA2 secure [6], (AES-256-GCM) is IND-CPA and INT-CTXT secure [34], SHA3–512 and HKDF-HMAC-SHA256 are modeled as random oracles [14], and the seed s is uniformly random in {0,1}256, then is IND-CCA2 secure. Specifically, for any PPT adversary ,
where are PPT adversaries constructed in the proof below.
Proof. The proof proceeds by a sequence of hybrid games. Let be a PPT adversary that participates in the IND-CCA2 experiment with at most encryption queries and decryption queries. Let denote the event that wins in Game i. All keys, salts, and randomness are sampled independently unless otherwise stated.
Game 0 (real IND-CCA2 experiment). This is the real IND-CCA2 experiment for . All encryption and decryption oracles behave exactly as defined in Algorithms 1–4, including Kyber encapsulation, TodaKey key derivation, AES-GCM image encryption, and AES-GCM key wrapping.
Game 1 (ideal Kyber). The Kyber encapsulation is replaced with an ideal IND-CCA2-secure KEM functionality. In this game, the pair is replaced by a pair sampled from an ideal random distribution consistent with ciphertext correctness. The simulator forwards all encapsulation and decapsulation queries to the Kyber challenger. Any distinguisher between Game 0 and Game 1 can be used to break the IND-CCA2 security of [6]:
Game 2 (random oracle for SHA3–512, SHA3–256, and HKDF-HMAC-SHA256). SHA3–512, SHA3–256, and HKDF-HMAC-SHA256 are replaced with random oracles . Since the topological fingerprint htopo is a deterministic function of the seed s, the query is uniquely determined by s. Because s is uniformly random in {0,1}256 and the random oracle is only queried on inputs derived from s, the output kfinal is uniformly random and independent of htopo, , and D. By the random-oracle model, Game 1 and Game 2 are indistinguishable up to the negligible probability of a random-oracle collision:
This step does not rely on SB-PHIP. Security follows entirely from SHA3–512, HKDF-HMAC-SHA256 modeled as random oracles, and the min-entropy of the seed s.
Game 3 (ideal AE for key wrapping). The AES-GCM key-wrapping encryption of kfinal under is replaced with an ideal authenticated-encryption oracle. Two adversaries are constructed:
- : breaks IND-CPA security of if the confidentiality of the wrapped key is distinguishable.
- : breaks INT-CTXT security of if a valid forged wrapped key is accepted.
Therefore,
Game 4 (ideal AE for image encryption). The AES-GCM encryption of the challenge image is replaced with an ideal authenticated-encryption oracle. Again, with adversaries and ,
Final step. In Game 4, the challenge ciphertext components are all independent of the challenge bit :
- Cct and are independent by the ideal AE oracle (Game 4).
- c is independent by the ideal KEM (Game 1).
- Wkey is random by the ideal AE oracle for key wrapping (Game 3).
- The IVs IV, and the salt salt are fresh and random.
Thus the view of is independent of , so .
Combining all hybrids:
Since all underlying primitives are assumed secure, all advantages are negligible in , hence
This completes the proof.
Remark 0.1. The proof does not rely on persistent homology or on SB-PHIP. If the topological layer is removed and the fingerprint htopo is replaced by a constant, the proof is unchanged: the security of TodaKey is provided entirely by SHA3–512, HKDF-HMAC-SHA256, AES-256-GCM, and Kyber.
Post-quantum security statement
Theorem 0.2 (Post-quantum security of ). Assume MLWE hardness for Kyber-512 [6], no efficient quantum attack on SHA3–512 and SHA3–256 beyond Grover’s algorithm, and no efficient quantum attack on AES-256 beyond Grover’s algorithm. Then:
- Kyber-512 provides NIST Category 1 security. It is not claimed to provide 128-bit quantum security in the strict sense.
- AES-256-GCM provides approximately 128-bit security against Grover-style quantum search, assuming the quantum adversary has bounded depth or bounded parallel resources.
- SHA3–512 and SHA3–256 provide approximately 128-bit quantum preimage resistance under Grover. HKDF-HMAC-SHA256 inherits this bound.
The overall post-quantum security level of is bounded by the weakest component, namely Kyber-512 (NIST Category 1). No specific post-quantum security level is claimed for the full hybrid scheme beyond this category.
Proof. Kyber-512 remains hard under quantum attacks. AES-256-GCM reduces to approximately 128-bit effective security under Grover’s algorithm, assuming bounded-depth or bounded-parallelism quantum adversaries. SHA3–512 and SHA3–256 reduce to approximately 128-bit quantum preimage resistance under Grover’s algorithm. HKDF-HMAC-SHA256 inherits the quantum-security properties of SHA3.
The overall post-quantum security level of is bounded by the weakest component, namely Kyber-512 (NIST Category 1). No specific quantum security level is claimed for SB-PHIP; this would require formal quantum cryptanalysis beyond the scope of this work. The quantum-security statement is therefore expressed as a category, not as a proven 128-bit bound for the full hybrid scheme.
Formally, for a quantum adversary running in time t with at most q queries to the underlying primitives:
where each term is bounded by the respective post-quantum security of Kyber, AES-256-GCM, SHA3–512, and SHA3–256. This completes the proof.
Key separation
Theorem 0.3 (Key separation). Let kfinal be derived as in Algorithm 1 and let be the Kyber shared secret. Under the assumptions of Theorem 0.1, the pair is computationally indistinguishable from for an independent uniform .
Proof. It is shown that no PPT adversary can distinguish from , where is an independent uniform key.
The key kfinal is derived through the two-layer construction of Algorithm 1:
By the pseudorandomness property of HKDF-HMAC-SHA256 [14], modeled as a random oracle, both and kfinal are computationally indistinguishable from uniform given sufficient entropy in their inputs. The seed s is assumed to be uniformly random in {0,1}256; the topological fingerprint htopo is a deterministic function of s and does not reduce the entropy of the input to HKDF.
The key is generated via , which is IND-CCA2 secure under the Module-LWE assumption [6]. Hence is indistinguishable from a uniform random key and independent of all external inputs, including s, htopo, and kfinal.
Since kfinal depends only on and depends only on Kyber randomness, which is independent, any adversary distinguishing from would break either HKDF-HMAC-SHA256 pseudorandomness or Kyber IND-CCA2 security. Therefore, the keys are computationally independent.
Domain separation
Theorem 0.4 (Domain separation). The TodaKey construction uses distinct AES-GCM invocations for image encryption and key wrapping, with distinct IVs and distinct associated data. Under the assumptions of Theorem 0.1, ciphertexts produced in the two domains are computationally unlinkable.
Proof. Two encryption contexts are considered:
- AES-GCM encryption of medical images under kfinal.
- AES-GCM key wrapping under .
In the first case, a fresh random IV is used for each encryption, and the associated data is . This satisfies the nonce-uniqueness requirement of AES-GCM [7].
In the second case, a fresh random is generated for each key-wrapping operation, and the associated data is A = salt. Thus IVs are unique per encryption, satisfying the nonce requirement of AES-GCM [34].
Since AES-GCM is IND-CPA and INT-CTXT secure under unique IV conditions [7,34], ciphertexts produced in the two domains are computationally indistinguishable and unlinkable. Even identical plaintexts yield different ciphertexts due to differing (IV, AD) pairs and differing keys. The two encryption domains are therefore properly separated, preventing cross-protocol reuse or substitution attacks. This completes the proof.
Key space analysis
The final key kfinal is 256 bits long; its theoretical maximum key space is 2256. The effective key space is bounded by the minimum min-entropy of the inputs to the key schedule, namely the seed s. Table 2 summarizes the component-wise analysis.
Thus, . The scheme provides strong resistance against brute-force attacks due to its 2256 classical key space. In the quantum setting, Grover’s algorithm reduces the effective key-search security of the symmetric components to approximately 2128 operations. Collision resistance of the 256-bit hash output is bounded by approximately 2–128 by the birthday bound. The alpha complex on n = 80 points in has simplices, which is not a key-space contributor. The effective key space is 2256, determined by the 256-bit seed entering . SHA3–256 fixes the length of htopo but does not by itself determine the effective key space, because the first HKDF layer hashes together. As noted in the Topological feature distribution section, the fingerprint collides with probability at most across seeds, and this bound does not weaken the derived key.
Summary of security assumptions
Table 3 summarizes the assumptions underlying each security claim.
Auxiliary heuristic: Seed-based persistent homology inverse problem
This subsection presents the SB-PHIP as an exploratory, auxiliary heuristic. It is not used in the IND-CCA2 proof, and no security claim in this paper depends on it; SB-PHIP is included for completeness and to motivate future research.
Definition 0.4. (Seed-based persistent homology inverse problem). Let be a deterministic mapping from a -bit seed to an point cloud. Let be the persistent homology operator producing a persistence diagram, and let be a cryptographic hash function. For a target hash value
generated from an unknown seed , the SB-PHIP problem is to find any such that
The SB-PHIP assumption states that no PPT adversary can solve this problem with advantage greater than , where advantage is defined as
SB-PHIP is a heuristic assumption, not a proven post-quantum foundation. No formal reduction to established problems (LWE, SVP, coding-theoretic problems, or multivariate problems) is claimed. It is motivated by the known difficulty of the PHIP [27].
Theorem 0.5 (SB-PHIP lower bound). Under the assumption that no efficient algorithm exists to invert the persistent homology map , where is the space of persistence diagrams, the SB-PHIP problem requires at least operations in the worst case.
Proof. A lower bound for the SB-PHIP problem is established through a reduction from brute-force seed recovery.
Let be the seed space. For any target hash value generated from an unknown seed , an adversary attempting to solve SB-PHIP must find such that
The following adversarial strategy is considered:
- Enumerate all possible seeds .
- For each s, compute in .
- Compute and then .
- Compare h with . If equal, output s.
This brute-force strategy requires iterating over possible seeds. For each seed, the computational cost includes:
- Generating the point cloud: operations.
- Computing persistent homology: operations in the worst case.
- Hashing: operations.
Since n = 80 and d = 5 are fixed constants, each iteration requires time. Therefore, the total time complexity is in the classical setting.
No known algorithm can solve SB-PHIP faster than brute force because:
- The mapping is a pseudorandom function (PCG64 RNG), producing outputs that are computationally indistinguishable from random.
- The persistent homology map PH is lossy and many-to-one, providing no algebraic structure that enables inversion shortcuts.
- The hash function is preimage-resistant, requiring at least 2256 queries to invert in expectation.
Therefore, any deterministic adversary must examine at least seeds in the worst case before finding the correct one, giving a worst-case lower bound of classical operations.
In the quantum setting, Grover’s algorithm provides a quadratic speedup for unstructured search, reducing the number of required quantum queries to . No known quantum algorithm provides more than quadratic speedup for generic preimage search problems. Hence, the conjectured quantum complexity is operations.
Theorem 0.6. (One-wayness from SB-PHIP). If the SB-PHIP assumption holds for parameters and is a collision-resistant hash function [36], then is a one-way function.
Proof. The proof is by contrapositive: if an adversary exists that inverts FTodaKey with non-negligible advantage , then a reduction algorithm can be constructed that uses as a subroutine to solve SB-PHIP with essentially the same advantage. This reduction algorithm is a proof construct, not a separately implemented component of the TodaKey scheme.
Assume inverts FTodaKey with advantage
The reduction operates as follows. Given a persistence diagram D as input, computes , invokes to obtain a candidate seed , then verifies whether is a valid solution by computing and checking if . If verification succeeds, outputs ; otherwise it outputs .
More formally:
- Compute .
- Run .
- Compute .
- If , output ; otherwise output .
This reduction runs in polynomial time in and preserves the advantage of up to a negligible loss due to hash collisions.
Let denote the event that outputs such that
By the collision-resistance property of [36],
If no collision occurs, equality of hashes implies equality of persistence outputs:
This implies exact equality in the persistence representation, and therefore the bottleneck distance satisfies
Thus, whenever successfully inverts FTodaKey and no hash collision occurs, successfully solves SB-PHIP. Therefore,
Since the SB-PHIP assumption states that no PPT adversary can solve SB-PHIP with non-negligible advantage, the right-hand side must be negligible. Hence must be negligible, proving that FTodaKey is one-way. This completes the reduction.
Experimental results
This section presents the experimental findings of TodaKey key generation, statistical randomness, image-encryption performance, robustness, and comparative evaluation.
Ethics statement. This study was conducted exclusively using four publicly available, fully de-identified medical image datasets: the M&Ms Challenge, CDC PHIL, BUSI, and Mini-MIAS. Because these datasets contain no identifiable patient information and no human participants or animal subjects were directly involved in this research, ethical approval was not required.
Topological feature distribution
The key generation was implemented in Python 3.13.16 using NumPy 2.1.3 and GUDHI (v3.13.0) for persistent homology. With fixed parameters (n = 80 points, d = 5, PRECISION = 6), the implementation consistently produces a 256-bit key with an average generation time of 1.76 seconds. Fig 2 visualizes the distribution of persistent homology features across homology dimensions.
79 finite H0 components (excluding the essential component with infinite death time), H1 loops, and H2 voids.
Table 4 presents the topological feature distribution and persistence statistics.
Fig 3 provides a persistence diagram and barcode for the same point cloud, and Fig 4 shows the distribution of birth values and persistence lengths. These figures provide a complete topological characterization of the TodaKey point cloud. The results indicate a mixture of short-lived and persistent structures. This structural richness is used for deterministic diversification.
(a) Histogram of feature birth values with kernel density estimation (KDE). (b) Histogram of persistence lengths () with KDE.
Parameter selection. The parameter n controls the number of points in the cloud from which the topological fingerprint is derived. The parameter d controls the ambient dimension. Neither parameter appears in any security assumption; the security of the derived key depends only on the primitives listed in the Security analysis section.
The only parameter-dependent property is the map from seed to persistence representation. The PCG64 generator is seeded from the first 8 bytes of interpreted as a 64-bit big-endian integer, so at most 264 distinct point clouds are reachable. Consequently, the point-cloud map is not injective in the 256-bit seed: two seeds whose first 8 digest bytes coincide produce identical point clouds, identical alpha complexes, identical persistence diagrams, and identical fingerprints. The probability that two distinct uniformly random seeds produce the same fingerprint is therefore bounded by
where 2–64 accounts for the truncated RNG seed and 2–128 for SHA3–256 birthday collisions on distinct inputs. This bound is independent of n and d, and it bounds only the collision probability of the topological fingerprint. It is not a bound on the security of the derived key, because the first-layer input
includes the full 256-bit seed. Two seeds that share a fingerprint therefore still yield computationally independent final keys. The 64-bit truncation is a seed-expansion choice for the point-cloud generator, not a cryptographic entropy bound on kfinal. This distinction is verified empirically: two distinct seeds whose truncated SHA-256 digests coincide were constructed, and while the resulting point clouds, alpha complexes, persistence diagrams, and topological fingerprints were byte-identical, the derived keys kfinal differed, as expected from the inclusion of the full seed in SHA3–512.
The choice n = 80 is therefore a performance-versus-nontriviality trade-off. Smaller values of n (for example, n = 40) produce too few persistence bars for the fingerprint to be reliably distinct across seeds. Larger values of n produce more persistence bars but also increase the alpha-complex and persistence-computation cost cubically without improving NPCR, UACI, entropy, or any security property, because the fingerprint length is bounded by the SHA3–256 output. The value n = 80 was selected from a sweep over as the smallest value that consistently produces a nontrivial persistence diagram. The dimension d = 5 was chosen because higher dimensions increased computational cost without proportional benefit in a sweep over .
The collision resistance of the fingerprint is provided by SHA3–256 and not by the combinatorial size of the alpha complex. On n points in , the alpha complex has simplices, which at n = 80 is roughly 219. This is sufficient to produce a nontrivial persistence diagram but is not a cryptographic key space. The effective key space of TodaKey is 2256, determined by the 256-bit seed entering , not by the topological layer.
Randomness analysis via NIST statistical tests
The statistical evaluation used the NIST STS [37] on Ubuntu 22.04 LTS with significance level . All 15 core tests assessed uniformity, independence, linear complexity, spectral properties, and statistical bias. A total of 16,000 independent 256-bit final keys kfinal were generated from distinct seeds, producing a 4,096,000-bit stream exceeding the NIST-recommended minimum of 1,000,000 bits. Table 5 reports the resulting p-values; all 15 tests pass at .
For seeds differing by a single bit, the average Hamming distance was 128.4 out of 256 bits (50.2%). This avalanche effect is due to SHA3–512 and HKDF-HMAC-SHA256, while the topological component provides deterministic diversification. Fig 5 illustrates the results across 32 tests, with an average of 128.4 bits changed (std: 5.0) and all cases exceeding 120 bits.
Number of bits changed in the 256-bit output key when a single bit in the input seed is flipped. The red dashed line indicates the ideal 128-bit threshold.
Multi-modality medical image evaluation
TodaKey was evaluated on 100 medical images across four modalities, spanning three distinct physical acquisition principles: magnetic resonance (cardiac MRI), X-ray attenuation (lung X-ray and mammography), and acoustic reflection (breast ultrasound). The four datasets together cover a wide range of image statistics, including highly structured anatomical images, low-contrast soft-tissue scans, and high-resolution projections.
- Cardiac MRI (25 images): , 12-bit DICOM from the M&Ms Challenge [38].
- Lung X-ray (25 images): , 16-bit DICOM from CDC PHIL [39].
- Breast Ultrasound (25 images): Breast Ultrasound Images (BUSI) dataset [40].
- Mammography (25 images): Mini-MIAS database of mammograms [41].
Table 6 summarizes the per-modality results. The metrics are consistent across all four modalities. NPCR remains within one percentage point of the ideal 99.6094%, UACI remains within 0.5 percentage points of the ideal 33.4635%, and entropy exceeds 7.999 bits for every modality. End-to-end per-image processing time (including DICOM loading, normalization, encryption/decryption, and I/O) stays between 0.28 and 0.35 seconds per image across all modalities, independent of the acquisition principle or bit depth of the source data. This is distinct from the cipher-only AES-GCM timings reported in Table 15, which are an order of magnitude smaller.
This consistency indicates that TodaKey’s behaviour is governed by AES-256-GCM rather than by the statistics of the plaintext. The topological layer, which produces a deterministic diversification input from the seed, is independent of the plaintext image and does not affect the encryption performance on any modality.
Degenerate plaintext test
All-black and all-white images are the most degenerate inputs for a block-cipher-based encryption scheme, because they exhibit no structure and no variation. A secure scheme must produce ciphertexts that are statistically indistinguishable from random even for such plaintexts. To test this property, an all-black () image and an all-white () image were each encrypted 100 times under the same key with fresh random IVs. NPCR and UACI were computed between the black and white ciphertexts (cross-class), and between successive ciphertexts of the same plaintext class (within-class). Ciphertext entropy was also measured. Table 7 reports the resulting NPCR and UACI values for all three comparisons.
The ciphertext entropy for both the all-black and all-white images was , matching the entropy reported for the medical images in the Multi-modality evaluation section. All three NPCR and UACI comparisons fall within one standard deviation of the ideal values, confirming that the ciphertext distribution is independent of the plaintext distribution, including for fully degenerate inputs.
Cropping attack
A cropping attack replaces a rectangular region of the ciphertext with zeros before decryption. In a chaos-based cipher that XORs the plaintext with a keystream, cropping propagates into the decrypted image as a visible black rectangle and the entropy of the decrypted image reflects the loss of pixel information. In TodaKey, ciphertext cropping is detected by the AES-256-GCM authentication tag: any change to the ciphertext causes decryption to return , so no decrypted image is produced and the entropy of a “decrypted cropped image” is not defined.
The experiment therefore measures two quantities that are well-defined under authenticated encryption. First, the entropy of the cropped ciphertext, which quantifies how much the modification changed the ciphertext. Second, the decryption outcome, which is deterministic: any crop, however small, is rejected. Table 8 reports the ciphertext entropy and the decryption outcome for each crop fraction.
The ciphertext entropy remains high under cropping because the untouched region is still uniformly distributed. For all crop fractions, decryption is rejected. The conclusion is that TodaKey does not attempt to recover from a cropped ciphertext; it refuses to decrypt. This behavior is stronger than graceful degradation, because no partially corrupted medical image is ever produced.
Ablation studies
To isolate the contribution of the persistent homology component, five configurations were compared: a truly random 256-bit key with AES-256-GCM; HKDF-HMAC-SHA256 from the seed; SHA3–256 directly from the seed; TodaKey without the topological fingerprint; and the complete TodaKey scheme. Table 9 reports NPCR, UACI, entropy, and key sensitivity for each configuration.
The ablation results confirm that much of the strong statistical performance derives from the cryptographic primitives themselves. The persistent homology component does not significantly improve NPCR, UACI, or entropy. The differences in key sensitivity (50.16% vs 50.12% vs 50.08%) are within one standard deviation and are not statistically significant by paired tests. The topological layer therefore contributes diversification without a measurable security benefit.
The topological layer is retained for three reasons that do not involve security. First, the structural fingerprint htopo binds the key schedule to the geometric realization of the seed, so that different seeds with the same hash prefix produce different keys even in the presence of a partial hash collision. Second, the two-layer construction with htopo provides domain separation between the seed-derivation stage and the KDF stage, which simplifies reasoning about key separation across multiple contexts. Third, the topological layer is of independent interest as an example of how TDA primitives can be integrated into standardized cryptographic pipelines without weakening their security properties.
Image encryption and decryption results
Cardiac MRI.
A cardiac MRI image (Himg = 543, Wimg = 1000 pixels) from the M&Ms Challenge dataset [38] was processed. The encryption renders the image visually unintelligible, while decryption restores the normalized 8-bit version exactly. Full bit-depth recovery requires the full-bit-depth variant described in the TodaKey protocol specification section. Fig 6 shows the original, encrypted, and decrypted images, and Table 10 reports the corresponding statistical comparison.
Fig 7 compares the intensity histograms of the original and encrypted cardiac MRI images: the strongly non-uniform histogram of the plaintext becomes near-uniform after encryption. Figs 8 and 9 show the adjacent-pixel correlation scatter plots before and after encryption, illustrating the collapse of the strong spatial correlation of the original image.
Lung X-ray.
A lung X-ray image (Himg = 688, Wimg = 515 pixels) from CDC PHIL [39] was processed. Fig 10 shows the original, encrypted, and decrypted images, and Table 11 reports the corresponding statistical comparison.
Fig 11 compares the intensity histograms of the original and encrypted lung X-ray images, and Figs 12 and 13 show the adjacent-pixel correlation scatter plots before and after encryption. The lung X-ray reproduces the same qualitative behaviour as the cardiac MRI: strong plaintext correlation collapses to near zero and the histogram becomes near-uniform.
Histogram uniformity analysis
To quantitatively evaluate histogram uniformity, a chi-square goodness-of-fit test was applied. The chi-square statistic is
where denotes the observed frequency of intensity level i, and is the expected frequency under uniformity. Table 12 reports the resulting statistic and p-value for the cardiac MRI and lung X-ray ciphertexts.
Histogram variance provides a complementary view of uniformity: a lower variance across the 256 intensity bins indicates a flatter, more uniform histogram. Table 13 reports the variance of the original and encrypted images for both modalities.
The encrypted images exhibit a substantial reduction in histogram variance compared to their original counterparts.
Comparative security analysis
Table 14 compares TodaKey with recent chaos-based and quantum-inspired medical image encryption schemes on NPCR, UACI, entropy, and post-quantum resistance.
TodaKey achieves NPCR, UACI, and entropy values close to the ideal theoretical values. Comparison with recent medical image encryption schemes. Five recent schemes provide direct points of comparison, and their reported metrics are listed in Table 14 while their security foundations are set out in Table 22. Devi and Amirtharajan [18] drive a shuffling-diffusion pipeline from a 2D modified Tinkerbell–Henon map; Anujaa et al. [19] combine a modified 5D map with SHA-512 hashing in a multi-round confusion-diffusion architecture; Banu and Amirtharajan [44] combine a 3D Lorenz attractor with the logistic map, integer wavelet transform, and DNA operations; and Sridharan et al. [45] drive a multilayer DNA-encoded pipeline from a quantum true random number generator and a 6D hyperchaotic system. The review by Devi and Amirtharajan [21] identifies two recurring concerns across this literature: chaos-only security is fundamentally heuristic, with no reduction to established cryptographic assumptions, and cryptanalytic attacks such as chosen-plaintext and known-plaintext attacks have repeatedly succeeded when the keystream is not bound to the plaintext.
TodaKey differs in three respects. First, its security is anchored in SHA3–512, SHA3–256, HKDF-HMAC-SHA256, AES-256-GCM, and CRYSTALS-Kyber, with a formal IND-CCA2 argument that does not depend on the topological layer. Second, it provides post-quantum key encapsulation through Kyber-512 (NIST Category 1), whereas none of [18,19,44,45] claims post-quantum security. Third, its statistical metrics in Table 14 are comparable to those of the chaos-based schemes, with the UACI of TodaKey notably closer to the ideal 33.4635% than the 28.68% reported in [45]. The trade-off is that TodaKey requires approximately 1.76 seconds per key derivation, whereas the chaos-based schemes report sub-second encryption and decryption times; this cost is acceptable only for offline key derivation. Table 15 compares the cipher-only encryption and decryption timings of TodaKey with those reported by the chaos-based schemes.
Integrity and robustness evaluation
The protocol was tested for sensitivity to ciphertext modifications, including Gaussian noise, salt-and-pepper noise, JPEG compression, cropping, and byte shift. Table 16 lists the applied modifications and their parameter ranges.
For each scenario, the modified ciphertext, tag, and associated data were submitted to TodaKey.HybridDecrypt. Because AES-256-GCM is INT-CTXT secure [7,34], any modification to the ciphertext, tag, or associated data causes decryption to return with probability 1–2–128. The output is a decryption failure, not a noisy image.
Table 17 reports, for each scenario, the PSNR between the clean ciphertext and the modified ciphertext, together with the deterministic decryption outcome. The PSNR on the ciphertext quantifies how much a given modification changed the byte stream: lower PSNR corresponds to a larger change in the ciphertext, and therefore to a modification that is more readily distinguished from the original ciphertext. Because the GCM authentication tag is verified before any plaintext is released, the decryption outcome is in every modified case and no decrypted image is produced.
This behavior differs from chaos-based ciphers that use XOR-only encryption, where ciphertext noise propagates into the decrypted image as visible degradation and the image is still partially recoverable. In TodaKey, a tampered ciphertext is rejected outright. The consequence is that data loss or channel noise does not produce a corrupted but usable image; it produces no image at all.
GCM authentication ensures tamper detection, as any modification to ciphertext, tag, or associated data causes decryption failure. This prevents attacks based on partial decryption and ensures that corrupted medical images are never presented to a downstream consumer.
Statistical security and reconstruction quality
Table 18 summarizes the statistical security properties of the encrypted images: adjacent-pixel correlations in the horizontal, vertical, and diagonal directions are close to zero, indicating that the ciphertext removes the strong spatial correlation of the plaintext; the information entropy approaches the theoretical maximum of 8 bits per pixel; and the histogram of the ciphertext is uniform.
The encrypted image and its histogram are shown in Fig 14: the ciphertext is visually unstructured, and the histogram is uniformly distributed across all 256 intensity levels, in contrast to the strongly non-uniform histograms of the original medical images.
Decryption using the correct kfinal achieved exact reconstruction of the 8-bit normalized image. Table 19 summarizes reconstruction quality.
Fig 15 shows the original 8-bit normalized image next to its decryption under the correct key; the two are pixel-identical.
Key sensitivity analysis
Key sensitivity was assessed by flipping a single bit of the final key, re-encrypting the same plaintext under the modified key, and comparing the two ciphertexts. Table 20 reports the resulting NPCR and UACI, both of which are close to their theoretical ideals.
Fig 16 visualizes the same test: the ciphertext under the original key, the ciphertext under the one-bit-perturbed key, and their pixel-wise difference, which shows no residual structure.
Computational complexity analysis
Let the grayscale medical image size be with pixels. The topological key layer operates on a fixed configuration of n = 80 structured points in . Table 21 presents the computational complexity of each component.
On the experimental platform (Intel CPU, 16 GB RAM), the key-generation pipeline required approximately 1.76 seconds per run on average. The TodaKey key generation time is slower than standard KDFs (HKDF-HMAC-SHA256: 0.0004s, SHA3–256: 0.0003s, PBKDF2-SHA256 with 100k iterations: 0.15s). The persistent homology computation accounts for approximately 91.5% of the total time (1.61 seconds). The two-layer construction (SHA3–512 pre-hash followed by HKDF-HMAC-SHA256) adds negligible overhead (0.0012s total). This overhead is acceptable only in offline scenarios such as medical archives, key escrow, and high-security environments, and is not suited to latency-critical online encryption.
Caching and amortization. The 1.76-second cost applies only to deriving a key from a new seed. Once a key has been derived, AES-GCM encryption and decryption of an image (cipher-only, excluding I/O) take between 0.02 and 0.07 seconds (Table 15), which is compatible with interactive clinical use. End-to-end per-image processing that additionally includes DICOM loading, 8-bit normalization, and filesystem I/O takes 0.28–0.35 seconds (Table 6). In practice, the key-derivation step is performed once per session or per seed, and the derived key is cached. The 1.76-second cost is therefore incurred only when a new seed is established, such as during session initialization, key rotation, or archival key escrow.
Comparative advantages over existing schemes
Table 22 positions TodaKey against the scheme families it is most often compared with. Quantitative metrics for the individual schemes are reported separately in Table 14; the present table concerns security foundations, key and IV handling, and the principal limitation of each approach.
Conclusion
This paper presented TodaKey, a topology-aware key schedule for hybrid post-quantum medical image encryption. TodaKey uses persistent homology as a deterministic structural-diversification layer within a standard SHA3–512 and HKDF-HMAC-SHA256 key schedule, and combines it with AES-256-GCM for authenticated encryption and CRYSTALS-Kyber for post-quantum key encapsulation.
Experimental results show strong statistical properties, including high key sensitivity (128.4 bits flipped for a single-bit seed change, attributable to SHA3–512 and HKDF-HMAC-SHA256), near-ideal NPCR () and UACI (), and entropy close to the theoretical maximum (). Evaluation on 100 medical images across four modalities (cardiac MRI, lung X-ray, breast ultrasound, and mammography) confirms that the pipeline works on datasets spanning three distinct acquisition principles. The four modalities provide broader coverage than a single-modality study, but they are not exhaustive. The ablation study shows that the topological layer does not significantly improve NPCR, UACI, entropy, or key sensitivity over a standard HKDF/SHA3 baseline; the observed differences in key sensitivity are within one standard deviation and are not statistically significant. No security advantage is therefore claimed from the topological component.
Key generation takes approximately 1.76 seconds on average, with 91.5% of the cost spent on persistent homology. This cost is acceptable only for offline or batch key derivation, such as medical archives, key escrow, and high-security environments, and is not suited to latency-critical online encryption. The scheme achieves exact reconstruction of the 8-bit normalized image; the DICOM normalization from 12–16 bit to 8-bit is lossy, and full bit-depth recovery requires the full-bit-depth variant described in the TodaKey protocol specification section. Visual indistinguishability does not imply clinical validity.
AES-GCM provides authenticated encryption and tamper detection, and CRYSTALS-Kyber provides post-quantum key encapsulation. The post-quantum security level of the hybrid scheme is bounded by the weakest component, namely Kyber-512, which provides NIST Category 1 security. A 128-bit post-quantum security level is not claimed for the full hybrid scheme.
Limitations and future work
The framework has several limitations. Persistent homology introduces substantial overhead of approximately 1.76 seconds per key, compared to 0.0004 seconds for HKDF-HMAC-SHA256 and 0.0003 seconds for SHA3–256. This overhead limits TodaKey to offline or batch scenarios. Because the topological layer yields no statistically significant improvement over a standard HKDF/SHA3 baseline, it functions as diversification rather than as a security mechanism. SB-PHIP is a heuristic assumption without a formal reduction to established problems such as LWE or SVP; it is not used in any security proof in this paper, and no post-quantum security level is claimed for it. The post-quantum security level of the hybrid scheme is bounded by Kyber-512, which provides NIST Category 1 security and is not 128-bit post-quantum security in the strict sense. DICOM normalization to 8-bit is lossy, and the current evaluation does not cover full bit-depth recovery. Side-channel leakage and physical endpoint compromise are not modeled. Evaluation covers four modalities (cardiac MRI, lung X-ray, breast ultrasound, and mammography) on 100 images; pathology, retinal fundus, CT, multi-vendor, and multi-center data were not evaluated, and no clinical validation was performed. Reproducibility of htopo depends on the persistent-homology implementation and floating-point serialization; cross-platform and cross-version reproducibility has not been fully verified. Empirical cross-checks of the KDF pipeline across different persistent-homology versions produce H0 = 79 in every case, while H1 and H2 bar counts differ.
Several directions follow from these limitations. Full bit-depth DICOM encryption would enable clinically lossless reconstruction. Extension to additional modalities such as CT, pathology, and retinal fundus, together with multi-vendor and multi-center data, would allow broader empirical claims. Clinical validation studies with medical professionals would assess diagnostic suitability. GPU acceleration of persistent homology would reduce key-generation time, and exploration of alternative topological descriptors such as persistence landscapes and Euler characteristic curves should include an explicit evaluation of whether they provide any measurable benefit over standard KDFs. Future work could also explore whether persistence-based representations admit a formal reduction to established post-quantum assumptions such as LWE or SVP, which would provide a stronger theoretical foundation for the diversification layer. Strengthening side-channel resistance and extending the framework to genomic and IoT data are further directions, and integration with ML-KEM-768 (Kyber-768) would raise the post-quantum security category where a higher category is required by the deployment context.
Supporting information
S1 Code. The Zenodo release at https://doi.org/10.5281/zenodo.23556827 contains the reference implementation (todakey.py), three fixed-seed test vectors (test_vectors.json), a reproducibility script (verify_test_vectors.py), and accompanying documentation (README.md, architecture.md).
https://doi.org/10.1371/journal.pone.0363875.s001
(TXT)
Acknowledgments
The authors thank the editor and the reviewers for their thorough and constructive feedback during the revision of this manuscript.
References
- 1. Shor PW. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J Comput. 1997;26:1484–509.
- 2.
Grover LK. A fast quantum mechanical algorithm for database search. In: Proceedings of the twenty-eighth annual ACM symposium on Theory of computing - STOC ’96, 1996. 212–9. https://doi.org/10.1145/237814.237866
- 3. Mosca M. Cybersecurity in an era with quantum computers: will we be ready?. IEEE Security & Privacy. 2018;16:38–47.
- 4. Chawla D, Mehra PS. A roadmap from classical cryptography to post-quantum resistant cryptography for 5G-enabled IoT: Challenges, opportunities and solutions. Internet of Things. 2023;24:100950.
- 5.
Alagic G. Status report on the third round of the NIST post-quantum cryptography standardization process. National Institute of Standards and Technology. 2022.
- 6.
National Institute of Standards and Technology (NIST). Post-quantum cryptography standardization. 2022. https://csrc.nist.gov/Projects/post-quantum-cryptography
- 7.
McGrew DA, Viega J. The Galois/Counter Mode of Operation (GCM). 2004. Submission to NIST.
- 8. Merkulov I, Arnon R. Entropy Accumulation Under Post-Quantum Cryptographic Assumptions. Entropy (Basel). 2025;27(8):772. pmid:40870244
- 9. Al-Dayel I, Nadeem MF, Bashir Y, Shabbir A. Information-Theoretic Medical Image Encryption via LLE-Verified Chaotic Keystreams and DNA Diffusion. Entropy (Basel). 2025;27(11):1149. pmid:41294992
- 10.
Nguyen L, Park T, Kim S. Post-quantum wireless-based key encapsulation mechanism via CRYSTALS-Kyber for resource-constrained IoT devices. In: Proc. IEEE Int. Conf. Commun., 2025. 1–6.
- 11. Song M, Kim H, Ha J. A configurable ML-KEM/Kyber key-encapsulation hardware accelerator with fast speed-security trade-offs. IEEE Trans Very Large Scale Integr Syst. 2024;32:1045–58.
- 12. Mallick B, Parida P, Prasad B, Nayak C, Panda MK, Ali N, et al. Quantum-Secure Communication for Future Cyber-Physical and IoT Systems: A Systematic Review of Classical to Learning Approaches. Computers. 2026;15(6):389.
- 13.
Hofheinz D, Hövelmanns K, Kiltz E. A Modular Analysis of the Fujisaki-Okamoto Transformation. Lecture Notes in Computer Science. Springer International Publishing. 2017. p. 341–71. https://doi.org/10.1007/978-3-319-70500-2_12
- 14.
Krawczyk H, Eronen P. HMAC-based extract-and-expand key derivation function (HKDF). 2010.
- 15. Karmany M, Moawad A, Abaza M, Mansour A, Alfalou A. An efficient image encryption scheme based on Lorenz system and quantum-inspired walks. Sci Rep. 2026;16(1):3403. pmid:41554824
- 16. Zhao Y, Shi Q, Ding Q. Cryptanalysis of an Image Encryption Algorithm Using DNA Coding and Chaos. Entropy (Basel). 2025;27(1):40. pmid:39851660
- 17. Masood F, Driss M, Boulila W. A lightweight chaos-based medical image encryption scheme using random shuffling and XOR operations. Wireless Personal Communications. 2022;127:1405–32.
- 18. Devi CS, Amirtharajan R. A novel 2D MTMHM based key generation for enhanced security in medical image communication. Sci Rep. 2025;15(1):25411. pmid:40659745
- 19. Anujaa T, Thajudeen Ali Ahamed AF, Baranwal V, Thanikaiselvan V, Subashanthini S, Sivaranjani Devi C, et al. A lightweight multi round confusion-diffusion cryptosystem for securing images using a modified 5D chaotic system. Sci Rep. 2025;15(1):31986. pmid:40885745
- 20. Chen L, Li C, Li C. Security measurement of a medical communication scheme based on chaos and DNA coding. Journal of Visual Communication and Image Representation. 2022;83:103424.
- 21. Devi CS, Amirtharajan R. Harnessing Chaos Theory for Image Encryption: Review, Implementation and Future Research Direction. Arch Computat Methods Eng. 2026;33(8):11797–824.
- 22. EL-Latif AAA, Abd-El-Atty B, Venegas-Andraca SE, Mazurczyk W. Efficient quantum-based security protocols for information sharing and data protection in 5G networks. Future Generation Computer Systems. 2019;100:893–906.
- 23. Li C, Shen X, Liu S. Solving the Block-Wise Puzzles in an Encryption-Then-Compression System. IEEE Trans Multimedia. 2026;28:6421–35.
- 24. Hao W, Zhang T, Chen X, Zhou X. A hybrid NEQR image encryption cryptosystem using two-dimensional quantum walks and quantum coding. Signal Processing. 2023;205:108890.
- 25. Aljaedi A, Shaukat Jamal S, Aljuhni A, Alharbi AR, Shah T. Fusion cryptography for secure medical data transmission using mathematical quantum computing operations. Sci Rep. 2025;15(1):33993. pmid:41028139
- 26. Chazal F, Michel B. An introduction to topological data analysis. Frontiers in Artificial Intelligence. 2021;4:667963.
- 27.
Oudot S, Solomon E. Inverse Problems in Topological Persistence. Abel Symposia. Springer International Publishing. 2020. p. 405–33. https://doi.org/10.1007/978-3-030-43408-3_16
- 28.
Edelsbrunner H, Harer J. Computational Topology: An Introduction. American Mathematical Society. 2010.
- 29.
Akavia A, Moran T. Topology-Hiding Computation Beyond Logarithmic Diameter. Lecture Notes in Computer Science. Springer International Publishing. 2017. p. 609–37. https://doi.org/10.1007/978-3-319-56617-7_21
- 30.
Boissonnat JD, Yvinec M. Algorithmic Geometry. Cambridge University Press. 1998.
- 31. Edelsbrunner H, Mücke EP. Three-dimensional alpha shapes. ACM Trans Graph. 1994;13(1):43–72.
- 32. Cohen-Steiner D, Edelsbrunner H, Harer J. Stability of Persistence Diagrams. Discrete Comput Geom. 2006;37(1):103–20.
- 33.
McGrew D. An interface and algorithms for authenticated encryption. RFC 5116. 2008.
- 34.
Rogaway P. Authenticated-encryption with associated-data. In: Proceedings of the 9th ACM conference on Computer and communications security, 2002. 98–107. https://doi.org/10.1145/586110.586125
- 35.
Katz J, Lindell Y. Introduction to Modern Cryptography. 3rd ed. Chapman and Hall/CRC. 2020.
- 36.
NIST. SHA-3 standard: permutation-based hash and extendable-output functions. National Institute of Standards and Technology. 2015.
- 37.
Rukhin A. A statistical test suite for random and pseudorandom number generators for cryptographic applications. National Institute of Standards and Technology. 2010.
- 38.
The M&Ms Challenge. Multi-center, multi-vendor, and multi-disease cardiac segmentation challenge. https://www.ub.edu/mnms/
- 39.
Centers for Disease Control and Prevention (CDC). Public health image library (PHIL). https://phil.cdc.gov
- 40. Al-Dhabyani W, Gomaa M, Khaled H, Fahmy A. Dataset of breast ultrasound images. Data Brief. 2019;28:104863. pmid:31867417
- 41.
Suckling J. The Mammographic Image Analysis Society digital mammogram database. Excerpta Medica, International Congress Series. 1994. p. 375–8.
- 42. Kiran K, Gururaj HL, Almeshari M, Alzamil Y, Ravi V, Sudeesh KV. Efficient SCAN and Chaotic Map Encryption System for Securing E-Healthcare Images. Information. 2023;14(1):47.
- 43. Kaur M, AlZubi AA, Singh D, Kumar V, Lee H-N. Lightweight Biomedical Image Encryption Approach. IEEE Access. 2023;11:74048–57.
- 44. Banu S A, Amirtharajan R. A robust medical image encryption in dual domain: chaos-DNA-IWT combined approach. Med Biol Eng Comput. 2020;58(7):1445–58. pmid:32319032
- 45. Sridharan S, Gururaja TS, Amirtharajan R, Praveenkumar P. Quantum scrambling and DNA based multilayer image encryption with QTRNG and 6D hyperchaotic keys. Sci Rep. 2025;15(1):33933. pmid:41028208
- 46. Mallick B, Parida P, Nayak C, Khalifa T, Kumar Panda M, Ali N, et al. Multi-Channel Multi-Protocol Quantum Key Distribution System for Secure Image Transmission in Healthcare. IEEE Access. 2025;13:62476–505.
- 47. Mallick B, Parida P, Nayak C, Panda MK, Prasad B, Sahu G. Quantum image encryption scheme using DPS protocol based on 3D non-equilateral Arnold transform and URUK chaotic map. Optics Communications. 2025.
- 48. Mallick B, Parida P, Nayak C, Ali N, Panda MK, Prasad B. Secure real-time transmission of multi-spectral satellite images inducing a 6D hyper-chaotic system and BB84 QKD protocol. Alex Eng J. 2025.
- 49.
Mallick B, Parida P, Panda MK, Prasad B, Rout DK. Secure Hyperspectral Remote Sensing Band Encryption via Simulated E91 QKD for Optical Satellite Links. In: 2025 IEEE India Geoscience and Remote Sensing Symposium (InGARSS), 2025. 635–40. https://doi.org/10.1109/ingarss67683.2025.11583819
- 50.
Daemen J, Rijmen V. The design of Rijndael: AES – the advanced encryption standard. Springer. 2002.