1. Introduction
The Internet of Things (IoT) is defined as “a network of physical objects accessed over the internet”, which is a rapidly growing field that encompasses a wide range of applications, including smart grids, smart cities, smart homes, smart healthcare, smart agriculture, etc. [
1,
2,
3]. The number of connected IoT devices has increased from 500 million in 2003 to approximately 19.6 billion in 2024. The typical IoT architecture is composed of four layers: physical/things layer, sensor/perception layer, network/communication layer, and service/application layer [
4,
5,
6]. A key feature of IoT devices is their ability to sense and collect data from their environment, processing this information through network interactions. Despite its vast potential, IoT faces significant challenges, particularly in the areas of privacy and security [
7]. There is a pressing need for a comprehensive security framework to safeguard all layers of IoT architecture. Proposed solutions include authentication and access control, encryption, intrusion detection systems (IDS), firmware updates, and privacy protection frameworks [
8]. Among these, cryptographic solutions are considered crucial for addressing authentication and authorization challenges, as they form the foundation for ensuring data integrity and confidentiality.
One of the core security components for IoT systems is trusted computing, which establishes standards aimed at strengthening the integrity of communication between hardware and software. A key element of this framework is TPM, a hardware-based security solution that creates a secure environment to ensure the integrity of cryptographic operations. TPMs enable features such as secure boot, remote attestation, and encryption, supporting the four fundamental goals of cryptography: confidentiality, integrity, authentication, and non-repudiation. However, IoT devices face a low entropy issue, which further complicates their ability to generate strong cryptographic keys. This limitation arises from their resource constraints (e.g., low processing power, battery and power constraints, etc.), lack of diverse input sources, and limited operational environments, often leading to weaker randomness from pseudo-random number generators (PRNGs) and exposing devices to additional security risks.
Moreover, the emergence of quantum computing presents both new opportunities and threats to IoT security. Quantum computers, with their ability to solve complex mathematical problems exponentially faster than classical computers, threaten existing cryptographic schemes, which IoT systems rely on for secure communications. Quantum algorithms like Shor’s and Grover’s can break traditional encryption methods, making IoT devices that use these vulnerable to quantum attacks [
9,
10]. As a result, IoT devices that rely on these encryption schemes could face serious security risks. There is an urgent need for quantum-safe approaches to advance IoT security in the quantum era.
In this paper, we propose to develop and implement a lightweight quantum-enabled security solution to advance IoT security. Our proposed work makes the following novel contributions:
First, we present the first practical implementation of a quantum trusted platform module (QTPM) by integrating a QRNG with a software-based TPM (STPM) framework, providing a lightweight quantum-enhanced cryptographic solution for the IoT. This approach ensures a higher level of cryptographic strength by leveraging quantum-generated randomness, addressing the vulnerabilities of classical random number generators.
Second, a quantum entropy as a service (QEaaS) framework is introduced to provide quantum entropy to legacy IoT devices that are unable to integrate QTPM hardware, enhancing their cryptographic operations by supplying them with quantum-secure randomness for key generation and other cryptographic functions.
In addition, we provide a comparative performance evaluation of quantum and classical RNGs in terms of randomness quality, runtime performance, and memory usage to validate the feasibility of QRNG integration under real-world constraints. Our evaluation results demonstrate that the QTPM can significantly harden IoT security against emerging quantum computing threats.
The remainder of this paper is organized as follows:
Section 2 provides an overview of key concepts, including TPMs, randomness, randomness assessment, PRNGs, and QRNGs.
Section 3 delves into the design and implementation of the proposed QTPM. Then,
Section 4 introduces the QEaaS framework, which supports legacy IoT systems and devices while enhancing their security.
Section 5 evaluates the performance of the QTPM by comparing the QRNG with traditional PRNGs. Finally,
Section 6 concludes the paper by summarizing the key findings and contributions.
3. Quantum Trusted Platform Module (QTPM)
3.1. QTPM Design
A QTPM combines quantum technology with TPM to enhance IoT security. Using a quantum random number generator, the QTPM can address the inherent limitations of classical random number generators (RNGs) that are vulnerable to biases or attacks. The use of quantum technology ensures a more robust and truly random generation of keys, mitigating RNG-related security risks. With QTPM, IoT devices can achieve higher levels of trust, confidentiality, and integrity, ensuring highly secure communication and data protection.
In this paper, we focus on the implementation of QTPM using a software-based TPM (STPM) framework. STPM is a software emulation of a hardware-based TPM (HTPM), which can support key generation, secure storage, and cryptographic operations. For a system with a lack of HTPM support, STPM can provide a more adaptable and accessible alternative to data security. STPM is useful for testing and development purposes, but it may not offer the same level of protection as HTPM. STPM is generally less secure than HTPM due to its software-based operation, making it more susceptible to attacks, such as code injection or key extraction. In future work, we plan to develop QTPM at the hardware chip level.
The IBM TPM, which uses a deterministic random bit generator, is a widely used STPM that has been extensively adopted in experimental or commercial applications. Specifically, the IBM TPM software implementation typically employs a SHA-1 or SHA-256-based DRBG as defined by the National Institute of Standards and Technology (NIST) in its Special Publication 800-90A. The seed is derived from an entropy source and is used to produce a stream of random numbers. However, since it is algorithmic and deterministic, the same seed will always produce the same output, which brings a fundamental limitation. Random numbers are generated from a seed relying on secure cryptographic hash functions (such as SHA-1 or SHA-256). These hash functions add complexity to the number generation process, making it difficult (but not impossible) for an attacker to reverse the process and determine the seed. The DRBG needs to periodically reseed itself with new entropy to improve randomness and mitigate predictability. IBM TPM is generally secure. However, its quality and security heavily depend on the entropy source, and it remains vulnerable to seed predictability or entropy source weaknesses, especially if attackers can compromise the underlying software or access the seed.
3.2. QTPM Implementation
The QTPM testbed is built with a Raspberry Pi 4 and an IDQ QRNG PCIe card, which is shown in
Figure 1. The IDQ QRNG leverages the inherent unpredictability of quantum processes to generate true random numbers. The IDQ QRNG is certified to pass all major NIST randomness tests, ensuring a high level of security and unpredictability. One key advantage of QRNG is that, unlike PRNG, it is free from environmental biases that can affect the entropy source and reduce the randomness of generated numbers. The IDQ Quantis library is a software library that interfaces with and utilizes the IDQ QRNG card. The library supports multiple programming languages, including Java, C, C++, and C++11. However, it requires Ubuntu 18.04 due to the specific kernel requirements for the QRNG driver. During the installation process, an obsolete function within the source code file (xdma-core.c) has to be configured, which is the memory-mapped I/O write barrier. Both the EasyQuantis application and the Quantis library are recompiled using the buildx tool in Docker. Visual Studio Code (VSCode) (1.74.3) is used as the IDE for the integration. The C/C++ Microsoft extension and code runner are adopted to simplify compilation and debugging. The “onRun” function in the IBM TPM is responsible for calling the random number generation function during runtime. A customizable function is created to replace the “onRun” function to call the IDQ QRNG instead of the inbuilt PRNG when randomness is required. Furthermore, an additional function is developed that enables the switch between the QRNG and the default PRNG, thereby providing greater flexibility for the randomness source. In addition, a fallback mechanism is implemented in case the IDQ QRNG becomes unfunctional due to hardware or driver issues, and the TPM can revert to using the default PRNG without crashing or causing failures in security operations. Below is an example Listing 1.
Listing 1. Enhanced tpm2_getrandom Function for Quantum Entropy Integration. |
static tool_rc get_random_custom(ESYS_CONTEXT *ectx, unit8_t * custom_bytes, UINT16 custom_size){ tool_rc rc = tpm2_getrandom(ectx, custom_size, &ctx.random_bytes, &ctx.cp_hash, &ctx.rp_hash, ctx.aux_session_handle[0], ctx. aux_session_handle[1], ctx.aux_session_handle[2], ctx. parameter_hash_algorithm); if (rc != tool_rc_success){ LOG_ERR (“Failed getrandom”); return rc; } // Replace the generated random bytes with custom_bytes memcpy(ctx.random_bytes->buffer, Quantis.Read(size)); ctx.random_bytes->size = custom_size; return rc; } |
The Listing 1 is part of the TPM Software Stack (TSS), which is to generate custom size random bytes. This function takes three parameters:
ectx: It is a pointer to TPM’s Enhanced System API and is responsible for executing commands.
custom_bytes: It is a pointer to an array of 8-bit unsigned integers. This is where the generated random bytes are stored.
custom_size: It is a 16-bit unsigned integer representing the number of random bytes to be generated.
The tpm2_getrandom function generates random bytes by receiving all the necessary parameters for context, and the result is stored in the rc variable, which represents the return code. This is a static function that outputs a success or failure return code. Error handling is implemented to ensure the operation is successful. If the return code indicates failure, the system returns the message “FAILED getrandom”. If the return code indicates success, the TPM’s random bytes are replaced with those obtained from the Quantis library. The Quantis.Read() function is responsible for generating random raw bytes from the QRNG. It automatically generates the correct number of bytes by matching the size originally requested by the user, ensuring that the byte size requested and the output generated always correspond correctly.
3.3. Quantum Cryptographic Module Development on FPGA
Building on the QTPM software implementation described in
Section 3.2, we propose a hardware-oriented approach to realize QTPM functionality using FPGA technology. Field Programmable Gate Arrays (FPGAs) offer an ideal platform for the direct deployment of cryptographic functions due to their scalability, speed, and flexibility. By embedding a QRNG into an FPGA, IoT devices can benefit from the superior randomness of quantum entropy while maintaining the performance and efficiency advantages of hardware-based security. The resulting FPGA-based quantum cryptographic module (QCM) is designed to support secure key generation and encryption, representing a critical step toward a full hardware realization of the QTPM architecture and its deployment in real-world IoT systems.
Figure 2 presents the design of QRNG integration with FPGA. The Xilinx Vivado platform and Verilog programming language can be used to design, simulate, and program the FPGA. The FPGA can directly integrate with the QRNG card via the PCIe interface, utilizing built-in FPGA drivers such as a PCIe controller to efficiently manage data exchanges with the QRNG. This seamless integration enables cryptographic algorithms, including AES and RSA, to be implemented within the FPGA while leveraging true random bits from the QRNG for dynamic and highly secure key generation. Each cryptographic function (e.g., AES encryption, RSA key generation) is encapsulated in an independent hardware module. QRNG-based random numbers can be used to generate keys/tokens to enhance secure communication between IoT devices. The FPGA handles all encryption operations in hardware, which can improve performance and resistance to cyberattacks. We plan to use the AMD Kintex FPGA board. The exact HDL modules and the complete FPGA integration are under development and are part of our future planned work.
Moreover, the QRNG-FPGA design can be converted to a custom application-specific integrated circuit (ASIC), and the QRNG can be directly integrated into a chip. While both the QRNG and cryptographic functions are directly embedded into the chip, latency can be significantly reduced since no external communication is required for random number generation or cryptographic processing. The chip can generate high-quality session keys, encrypt sensor data, authenticate IoT devices, and enable secure IoT network communication while ensuring data integrity and confidentiality.
4. Quantum Entropy as a Service (QEaaS)
Ensuring the scalability of quantum-secure key solutions across diverse IoT environments is a significant challenge due to the presence of millions of legacy devices that lack the hardware to support advanced quantum technologies. While modern IoT devices can integrate quantum technologies, upgrading or replacing legacy devices is costly and disruptive. Legacy devices remain vulnerable to future quantum-based attacks, making it critical to develop solutions that enable both modern and legacy devices to utilize quantum-secure keys without requiring extensive hardware upgrades.
QEaaS can be designed to enhance the security of legacy IoT systems and devices. QEaaS is a practical approach to address the challenge of obtaining high-quality quantum entropy that can be delivered to IoT devices and systems on demand. QRNG can serve as a source to provide high-entropy random numbers, while IoT devices can request them through a cloud environment and use them to perform local security functions. By leveraging quantum entropy, IoT networks can secure cryptographic operations such as key generation, authentication, and secure communications with unprecedented levels of randomness and unpredictability. Quantum entropy services can be deployed in cloud-based or distributed IoT environments, ensuring resource-constrained IoT devices benefit from the security advantages of quantum technology. While direct integration of QRNG hardware into each IoT node remains costly, QEaaS offers a scalable alternative. By centralizing entropy generation, QEaaS can significantly reduce costs, simplify maintenance, and scale well across large resource-constrained IoT networks.
4.1. QEaaS Platform Design
The design of the overall QEaaS infrastructure is shown in
Figure 3. A cloud-based infrastructure can be built to host the QRNG. On the cloud provider side, a system can be implemented to manage the quantum entropy pool and develop algorithms for monitoring the entropy pool’s capacity and ensuring sufficient entropy is maintained in high-demand scenarios. In addition to that, load balancing shall be considered to dynamically allocate entropy requests to minimize latency and optimize persistence and reliability. IoT clients can request entropy via API or Websocket to securely communicate with the QEaaS provider. Authentication and authorization mechanisms can ensure that only trusted and authorized IoT devices can access quantum entropy. Secure protocols like mutual TLS (Transport Layer Security) or OAuth can be leveraged to ensure that only legitimate IoT devices can request entropy. Moreover, post-quantum cryptography (PQC) can be used to generate digital signatures (e.g., using Dilithium or Falcon) to authenticate clients and ensure the integrity of requests and responses. Ensuring quantum entropy is securely delivered to the IoT clients without tampering or interception is a critical task. End-to-end encryption is required, and quantum-safe cryptographic algorithms such as lattice-based cryptography can be adopted to protect against potential quantum attacks.
In addition, to guarantee that cryptographic operations are not required to request entropy in real time and can be executed efficiently in environments with intermittent connectivity, IoT devices can maintain a buffer or entropy pool to store quantum entropy locally. The new quantum entropy can be requested periodically or following specific cryptographic operations to ensure that the IoT device maintains high-quality randomness without exhausting its pool.
4.2. Distributed Entropy Sourcing for Enhanced Privacy
When a single server provides all the entropy to an IoT device, it could potentially track or infer sensitive data about the device’s operations, such as cryptographic keys. By requesting entropy from multiple sources, no single entity has complete visibility into the randomness used by the IoT device. Even if one server is compromised or malicious, the combined entropy from multiple sources can still maintain the desired randomness and unpredictability. The idea is to ensure that the final random value used by the IoT device is unpredictable unless all servers are compromised.
The IoT device pre-configures a set of entropy sources (QEaaS servers) to request entropy from, while these servers could be operated by different entities or organizations to reduce the risk of collusion or a single point of failure. The IoT device sends entropy requests to multiple servers, ideally in parallel, to minimize latency. These requests should be structured to ensure that each server only provides part of the total entropy needed. Once the entropy is received from all servers, the IoT device combines the different entropy inputs using a secure combination method, such as bitwise XOR operation or hashing. The entropy combination operation ensures that if even one of the entropy sources is truly random and unpredictable, the final result will also be random and secure. The IoT device uses the combined entropy for cryptographic operations, such as key generation. Since the final entropy is derived from multiple sources, it is highly secure and ensures privacy, as no single server can infer the actual randomness used. One potential issue of the proposed method is the added latency from requesting entropy from multiple servers. To mitigate this, we can consider caching entropy locally at IoT devices for short-term use, pre-fetching entropy during periods of low activity, and utilizing parallel requests to minimize waiting times. Implementing the QEaaS platform will be pursued as part of our future work.
5. Evaluation
To evaluate the performance of the QTPM, we compare three RNGs: Xorshift PRNG, Mersenne twister PRNG, and IDQ QRNG. The comparison focuses on three key metrics: runtime performance, memory usage, and randomness quality [
44]. In this evaluation, PRNGs were selected based on their simplicity, speed, and periodicity. For example, the Mersenne twister is selected in the evaluation due to its high randomness quality (the period is
), while the Xorshift is selected because of the simplicity of the design and speed. Both algorithms were selected because they are known for their overall effectiveness. The PRNG algorithms will be implemented in Java. Additionally, the IDQ Quantis library, which supports languages such as C, C++, and Java, will be utilized to support its evaluation. The Java wrappers are used to evaluate both PRNG and QRNG under the same conditions. Runtime and memory utilization will be measured using a built-in Java class.
5.1. Xorshift PRNG
The Xorshift PRNG is a type of Linear Feedback Shift Register (LFSR) PRNG that uses a set of bitwise operations to create a series of random numbers. This PRNG was first introduced by George Marsaglia in 2003 and is known for its simplicity, speed, and efficiency, which was improved in 2022 [
45]. The Xorshift PRNG has the advantage of statistical quality and can generate a sequence of high-quality random numbers, which reduces skewing and gives more uniformity in distribution. The Xorshift32 PRNG takes an initial seed value and uses a series of bitwise XOR operations (left shift 13 bits, right shift 17 bits, and left shift 15 bits) to generate the next value in the random number sequence, which makes it much faster than other more complex PRNGs [
45]. This PRNG has a period of
, which means it can create
unique numbers before repeating itself. The workflow of Xorshift32 is shown in Algorithm 1.
Algorithm 1 Xorshift32 Algorithm |
/* Initialization: state = seed */ /* Output: A 32-bit pseudorandom number */
FUNCTION Xorshift32() state ^= (state << 13); // Left shift by 13 bits and XOR state ^= (state >> 17); // Right shift by 17 bits and XOR state ^= (state << 5); // Left shift by 5 bits and~XOR
seed = state; // Update seed with new state RETURN state; // Return the new pseudorandom number END FUNCTION
|
5.2. Mersenne Twister PRNG
The Mersenne twister (MT) PRNG is another well-known PRNG that was created in 1997. There are different variations, but the initial one was called MT19937, which had a period of
(it can generate a sequence of
different random numbers before replicating) and a 623-dimensional equidistribution property. MT19937 is an improvement of the twisted generalized feedback shift register (TGFSR) generator [
46], and it generates the next value in the sequence by starting with a seed value and running a series of matrix operations on it. The MT PRNG is extremely fast and efficient, making it a favored option for various applications such as simulations, gaming, and cryptography.
5.3. IDQ QRNG
The Quantis PCIe-240M device generates random data using elementary quantum optical processes. It employs a multi-mode LED to illuminate a CMOS image sensor. The number of photoelectrons stored in each pixel follows a Poissonian distribution, providing a source of quantum randomness. After digitization by an analog-to-digital converter (ADC), only the bits that remain unaffected by non-quantum noise are retained. Post-processing techniques can be applied if necessary, although Quantis entropy sources are exceptionally reliable and pass most statistical tests.
The Quantis device incorporates an auto-calibration function that controls the optical power of the LED and the exposure time of the CMOS image sensor. This ensures that the produced random bits are unpredictable and independent of environmental and operating conditions. The auto-calibration process guarantees high randomness, contributing to the device’s security and suitability for applications requiring strong cryptographic properties.
5.4. Results
5.4.1. Time Efficiency and Memory Usage
Speed and memory usage are essential in computer science, especially in algorithmic complexity. Seemingly infinitesimal time can significantly affect an algorithm’s efficiency. Different sets of random numbers are generated and used for comparing the performance among Xorshift PRNG, Mersenne twister PRNG, and IDQ QRNG. The system class in Java is leveraged to measure the elapsed time in nanoseconds, while the runtime class helps calculate the total memory usage in bytes.
Figure 4 demonstrates that QRNG takes significantly more time to generate random numbers, which is expected due to the complex process of harnessing quantum randomness through photon counting. In contrast, PRNGs generate numbers using deterministic mathematical formulas, allowing them to produce outputs much faster. While QRNG provides true randomness, its higher computational cost makes PRNGs more efficient for applications requiring high-speed random number generation. To mitigate latency impact, the configurable fallback mechanism and entropy caching can be adopted, which allows the system to temporarily revert to PRNGs or use pre-fetched QRNG data when low-latency performance is critical.
Figure 5 compares the memory usage of QRNG, Mersenne twister, and Xorshift on different data sizes. QRNG exhibits significantly lower memory consumption because it generates truly random numbers without maintaining an internal state, unlike PRNGs, which require storage for previous values to ensure high-quality randomness. The Xorshift result for 10
3 is omitted because its memory usage fell below the Java Virtual Machine (JVM)’s measurement resolution and was indistinguishable from baseline noise. At this scale, the algorithm’s register-based operations and JVM optimizations left no detectable heap allocation, unlike at larger quantities. Mersenne twister has the highest memory usage due to its large state array, while Xorshift, though more lightweight, still requires state storage. As data size increases, PRNGs consume more memory, whereas QRNG remains more efficient, making it ideal for low-memory environments like IoT systems.
While the higher latency of QRNG compared to PRNG is anticipated, our results quantify the performance trade-offs involved and confirm that QRNG integration remains feasible for IoT applications, which do not require continuous real-time entropy. This validation is important for assessing the readiness for deployment in constrained environments.
5.4.2. 2D Random Walk Test
The 2D walk test is a statistical test used to assess the randomness of a sequence of two-dimensional positions or movements, which helps ensure the quality and reliability of random number generators. It involves simulating a random walk in a two-dimensional space based on the given sequence of numbers or data. The random walk typically starts at the origin (0, 0) and moves in random directions according to the values in the sequence (e.g., −1, 0, or 1). The test examines the distribution and properties of the resulting positions or movements to evaluate the randomness of the sequence. The 2D walk test can help detect any patterns, correlations, or biases in the sequence that deviate from randomness.
We have conducted 2D random work tests to evaluate and compare the randomness of Xorshift PRNG, Mersenne twister PRNG, and IDQ QRNG.
Figure 6 presents the test results.
Figure 6 visualizations use consistent axes (x: −60 to 20; y: −50 to 30) for an equitable comparison. The clustering patterns observed in the results of Xorshift (
Figure 6a) and Mersenne twister (
Figure 6b) reveal the inherent spatial correlations characteristic of their deterministic algorithms. In contrast, the QRNG (
Figure 6c) output maintains a uniform distribution. The results demonstrate the structural bias and dimensional limitations of the PRNGs while confirming that QRNG maintains a higher level of true randomness.
5.4.3. Mean Squared Displacement (MSD)
A measurement of the variance between a particle’s position and a reference position over time is the MSD. The most common method to assess the spatial extent of random mobility is to measure the area of the system that the random walker has explored. The distance between the two points is then square-calculated, and its value is then added to a list of MSD values. The particle’s average displacement increases in a manner that is proportional to the number of time steps over time.
Figure 7 shows the relationship between the MSD and the number of steps. The x-axis represents the number of steps taken in the random walk, and the y-axis represents the MSD. This figure provides insight into how the distance between points changes as more steps are taken. If the relationship between the MSD and the number of steps is linear, the movement is random. On the other hand, if the relationship is non-linear, it suggests that the movement is not random. As observed in the Xorshift and Mersenne twister QRNG results, the MSD exhibits a non-linear relationship with the number of steps, showing that these PRNG algorithms are not truly random. In contrast, the QRNG results display a linear MSD-to-steps relationship, confirming true randomness.
6. Conclusions
In conclusion, the QTPM has been successfully developed and implemented by integrating QRNG with TPM to enhance IoT security. By incorporating quantum randomness into the TPM framework, we significantly improve the security and unpredictability of cryptographic operations within TPM, which represents a novel and practical step toward quantum-secure IoT systems. Furthermore, the development of the QEaaS framework enables quantum-secure entropy provisioning for legacy IoT devices that cannot integrate QTPM hardware, eliminating the need for costly hardware upgrades. Our comparative evaluation of Xorshift PRNG, Mersenne twister PRNG, and IDQ QRNG highlights the superiority of quantum-generated randomness, particularly in maintaining the high-quality entropy crucial for secure IoT applications. Additionally, our analysis of performance and memory usage demonstrates the trade-offs between QRNG and PRNGs, reinforcing the necessity of optimized implementations for resource-constrained environments. By demonstrating a functioning QTPM prototype and a scalable QEaaS model, our future work will focus on implementing quantum cryptographic modules at the hardware level, optimizing QRNG integration for low-power IoT systems, and deploying the QEaaS platform to further strengthen IoT security protections.