Abstract
In current and future manufacturing systems such as those in Industry 4.0, sensing tasks involve embedded devices that collect and measure variables, send those to a gateway, and support a physical response when a relevant condition is detected. Adding security to this communication can change the timing and reliability of the response, especially when monitoring and actuation are closely linked. This paper presents a physical testbed setup that uses a sensor node with an ESP32-based platform connected to a physical sensor, a Raspberry Pi 4 as the edge gateway, and a second ESP32 as the actuator node to evaluate secured data transmission in an industrial monitoring and actuation scenario. This arrangement is used to evaluate secure communication across resource-constrained microcontroller nodes while using the Raspberry Pi for logging, decision logic, and command generation. The gateway receives sensor data, applies threshold-based decision logic, and sends an actuation command when a predefined condition is detected. The testbed evaluates two secured transmission modes: Classical secure communication with symmetric encryption and message authentication, and a post-quantum mode in which ML-KEM establishes keys for the secured exchange. The modular design of the proposed solution allows different sensors, actuators, and threshold conditions to be used for monitoring and response applications. Performance of the system is obtained through sensor-to-gateway latency, gateway-to-actuator latency, packet size overhead, timing variability, and message reception rate. This testbed offers a practical way to evaluate how Classical and post-quantum protection mechanisms affect connectivity, monitoring, and actuation using embedded devices commonly found in industrial manufacturing systems.
1. Introduction
Industrial monitoring systems increasingly rely on interconnected sensors, edge devices, gateways, and actuators to support monitoring and automated decision making in Industry 4.0 environments [1,2,3]. As connectivity of these cyber-physical systems increases, the potential to be attacked also expands, making the protection of sensor measurements and control information an important system requirement [4]. At the same time, adding cryptographic protection to resource-constrained communication systems may introduce performance costs and communication overhead that need to be considered for the operational workflow [5,6]. Cryptographic mechanisms protect industrial measurements and control information by providing confidentiality, integrity, and authentication [7]. Additionally, when implementing these mechanisms for resource-constrained embedded devices, one must take into consideration computational costs, communication latency, and the additional data exchanged during secure-session establishment and protected communication [5,6].
The long operational life of industrial and embedded systems is motivation for considering new computational threats. Sufficiently capable quantum computers could compromise widely deployed public-key mechanisms based on integer factorization and discrete logarithms, while “harvest now, decrypt later” scenarios create additional concern for data that must remain confidential over long periods [5]. These risks, among others, have accelerated the development of post-quantum cryptography. Among the standardized mechanisms, the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) enables communicating entities to establish shared secret material from which symmetric keys can subsequently be derived. National Institute of Standards and Technology (NIST) FIPS 203 defines the ML-KEM-512, ML-KEM-768, and ML-KEM-1024 parameter sets [8]. This work uses ML-KEM-768 for post-quantum session-key establishment.
The integration of post-quantum protection into embedded and edge systems must account for the limited computational capabilities of the devices [9]. Although operations such as key generation, encapsulation, and decapsulation can be benchmarked separately and independently, at the system level, performance depends on message exchange, implementation choices, data overhead, and network conditions that interact among themselves [6,10]. The interaction is with sensing, gateway processing, decision logic, command delivery, and actuator response, motivating evaluation of post-quantum protection within a complete sensor–gateway–actuator path.
The main contribution of this paper is a comparison at the system level of Classical and post-quantum protection in an embedded monitoring-and-actuation workflow, complementing evaluations focused primarily on isolated cryptographic operations or protocol handshakes. By evaluating the complete sensor–gateway–actuator path, the testbed also captures the interaction of protected communication with sensing, gateway processing, threshold-based decision making, command delivery, and actuator response within the same experimental workflow. This paper presents a physical sensor–gateway–actuator testbed for evaluating protected communication in an embedded monitoring-and-actuation workflow. The gateway processes sensor measurements and generates an actuation command when the configured decision condition is satisfied. Two protected modes are compared: a Classical configuration using independent pre-shared keys with the Advanced Encryption Standard in Galois/Counter Mode (AES-256-GCM), and a post-quantum (PQ) configuration in which ML-KEM-768 establishes shared keying material for AES-256-GCM-protected communication. The evaluation considers sensor-to-gateway latency, gateway-to-actuator latency, packet size overhead, timing variability, and message reception rate.
2. Materials and Methods
The experimental methodology is composed of the physical testbed, the two security configurations, and the measurement procedure used in the formal runs.
2.1. Experimental Testbed
The testbed has two ESP32-S3 (ESP32-S3-WROOM-1, Espressif Systems (Shanghai) Co., Ltd., Shanghai, China), for sensing and actuator nodes, and a Raspberry Pi 4 (Raspberry Pi 4 Model B, Raspberry Pi Ltd., Cambridge, UK) for an edge gateway, connected through a local Wi-Fi network using the Transmission Control Protocol (TCP). The sensor measures at one-second intervals and transmits a message with a sequence identifier, timestamp, sensor value, and status field. The sensor–gateway connection remains active during each formal run. The gateway authenticates the received message, records the measurement, and applies a decision threshold of 5. If the sensor value exceeds the threshold, the gateway opens a new TCP connection to the actuator and sends an ACTIVATE command. The actuator authenticates and decrypts the command, validates its sequence identifier, executes digitalWrite(), and returns a protected acknowledgment with the same sequence identifier and status="done". Figure 1 shows the implemented sensor–gateway–actuator workflow.
Figure 1.
Logical organization of the implemented sensor–gateway–actuator testbed.
2.2. Communication and Security Configurations
Two secured communication configurations are evaluated. Both use AES-256-GCM authenticated encryption to protect sensor measurements, actuation commands, and actuator acknowledgments. Each protected packet is formed by an 8-byte sequence identifier used as additional authenticated data (AAD), a 12-byte nonce, the ciphertext, and a 16-byte authentication tag. The resulting security overhead is therefore 36 bytes in both configurations. Packets that fail authentication, structural validation, or sequence-consistency checks are not accepted as valid application messages. In the Classical mode configuration, independent 256-bit pre-shared keys are used for the sensor–gateway and gateway–actuator links. These keys are pre-configured at the corresponding endpoints and are used directly as the AES-256-GCM keys for the protected exchanges. Thus, the Classical mode provides symmetric authenticated encryption without a separate public-key exchange.
In the PQ configuration, ML-KEM-768 is used to establish shared secret material before secured communication takes place. For the sensor–gateway link, the gateway generates the ML-KEM key pair and sends its public key to the sensor; the sensor encapsulates a shared secret and returns the resulting ciphertext, which the gateway decapsulates. For the gateway–actuator link, the actuator generates the key pair and the gateway performs encapsulation. In both cases, the resulting shared secret is processed using the HMAC-based Extract-and-Expand Key Derivation Function with SHA-256 (HKDF-SHA256) to derive a 256-bit AES-256-GCM session key.
Thus, messages in both configurations use the same AES-256-GCM protection mechanism, while the principal difference is how the symmetric keying material is obtained. The application-message structure, sampling interval, decision threshold, device placement, wireless network, and actuator behavior were maintained across both formal runs. In the implemented PQ mode, each ML-KEM-768 instance exchanges a 1184 B public key and a 1088 B ciphertext; including the two 4-byte framing prefixes, this results in 2280 B of session-establishment traffic, reported separately from the recurring per-message overhead.
2.3. Experimental Procedure and Metrics
Each formal run comprised 1000 expected sensor messages with sequence identifiers from 0 to 999. The Classical and PQ experiments were conducted as separate runs using the same physical testbed, device placement, local Wi-Fi network, sampling interval, message structure, and decision threshold, under comparable experimental conditions. Sensor values were acquired independently from the physical sensor during each run rather than replayed from an identical trace. Therefore, the number of measurements exceeding the threshold differed between runs, resulting in 224 ACTIVATE events for Classical and 198 for PQ. Sensor-to-gateway latency was estimated from the round-trip time () measured entirely with the monotonic clock of the sensing node, thereby avoiding direct subtraction of timestamps from unsynchronized devices. Immediately before transmitting a protected frame, the sensor records the generation time . After receiving the complete TCP frame, the gateway immediately returns a one-byte transport acknowledgment (0xA5), before performing AES-256-GCM authentication, decryption, parsing, or threshold processing. The sensor records the time of arrival , when this acknowledgment is received, and computes the round-trip time as follows
from which the estimated one-way sensor-to-gateway latency is obtained as
This estimate assumes approximate path symmetry and represents an estimated one-way communication latency rather than complete cryptographic-processing latency, since the gateway acknowledgment is sent before authentication and decryption. Because the result for message N becomes available only after its acknowledgment, it is transported in message ; an auxiliary message with sequence identifier 1000 carries the estimate for formal message 999 and is excluded from the analysis window.
Gateway-to-actuator latency was measured only for ACTIVATE events. TCP connection establishment occurred before timing began; in the PQ mode, the ML-KEM session establishment was also completed before the timer started. The timer started immediately before transmission of the protected command, , and ended after the gateway received, authenticated, parsed, and validated the protected actuator acknowledgment, .
Accordingly, includes the protected command/acknowledgment exchange and actuator processing, but excludes TCP connection establishment and security-session establishment, including the ML-KEM exchange in the PQ configuration.
For packet-size analysis, the base application payload contains seq, ts, value, and status. AES-256-GCM adds an 8 B sequence identifier used as AAD, a 12 B nonce, and a 16 B authentication tag, giving
Experimental fields and ML-KEM session-establishment traffic were treated separately and were not included in this security-overhead metric. Message reception rate was evaluated over the formal sequence window . A message counted as successfully received only after authenticated decryption and verification of matching packet and application sequence identifiers. Missing sequence identifiers reduced the successful-reception count, while duplicate, authentication-failed, and semantically invalid messages were not counted as valid receptions. Reception rate was computed as
Timing variability was characterized from the measured and distributions using descriptive statistics including the mean, median, standard deviation, 95th percentile, and 99th percentile. Observed latency outliers were retained because they form part of the measured timing variability.
3. Results and Discussion
3.1. Latency and Timing Variability
Table 1 shows latency statistics, while Figure 2 shows the corresponding empirical distributions. Each run yielded 1000 valid estimates, while was measured only for threshold-triggered ACTIVATE events, resulting in 224 Classical and 198 PQ samples.
Table 1.
Latency results for the formal Classical and PQ runs.
Figure 2.
Empirical cumulative distributions of (a) estimated sensor-to-gateway latency and (b) post-establishment gateway-to-actuator latency for the Classical and PQ modes.
For , the two modes showed comparable median latency, but different upper-tail characteristics. Although PQ had a lower mean, its median was slightly higher, so the mean alone does not support a conclusion that PQ was generally faster. The larger Classical standard deviation and P99 reported in Table 1 instead indicate greater dispersion and a heavier upper tail.
Because is an /2 estimate, the distribution in Figure 2a characterizes the measured communication path rather than complete cryptographic-processing latency at the gateway.
For , PQ showed higher typical post-establishment latency, with mean and median increases of approximately 23.4% and 44.0%, respectively. However, the P95 values were nearly identical, while Classical exhibited the larger P99, indicating a heavier upper tail. TCP connection establishment and, in the PQ mode, ML-KEM session establishment occur before timing begins. Therefore, the reported results characterize only the post-establishment protected command/acknowledgment path and do not include the cost of TCP or ML-KEM session establishment.
Taken together, the reported latency results should be interpreted as communication performance measurements within the protected workflow rather than as the total end-to-end overhead of post-quantum security.
Overall, the latency results show that central statistics and tail behavior must be considered together. The retained outliers form part of the observed timing variability and were therefore not removed from the analysis.
3.2. Communication Overhead and Message Reception
Because both modes use AES-256-GCM for recurring application traffic, each protected message incurred the same 36 B security overhead. The mean application-payload sizes were 56.617 B for Classical and 56.749 B for PQ, resulting in mean protected-message sizes of 92.617 B and 92.749 B, respectively. PQ additionally incurred 2280 B of framed ML-KEM-768 traffic per session establishment, separate from the recurring per-message overhead. Figure 3 shows the message-size overhead and the authenticated message reception rate.
Figure 3.
Communication results for the formal runs: (a) mean application and protected-message sizes and (b) message reception rate over the 1000-message sequence window.
Figure 3a confirms that both modes incurred the same recurring 36 B per-message security overhead; with respect to communication overhead, the mode-specific difference arises from the additional ML-KEM session-establishment traffic in PQ. As shown in Figure 3b, both modes achieved a 100% message reception rate (1000/1000 successfully authenticated and validated messages), with no missing sequence identifiers, authentication failures, duplicates, or packet/payload sequence mismatches. The 224 Classical and 198 PQ ACTIVATE events reflect different numbers of threshold-crossing measurements rather than reception losses, and no ACTIVATE_FAILED events were recorded.
4. Conclusions
This work introduced a physical sensor–gateway–actuator testbed for comparing Classical and PQ security in an Industry 4.0 monitoring scenario. The Classical mode used independent pre-shared keys with AES-256-GCM, whereas the PQ mode used ML-KEM-768 and HKDF-SHA256 to establish AES-256-GCM session keys. Both formal 1000-message runs achieved a 100% message reception rate, and both modes incurred the same 36 B recurring security overhead per protected application message. PQ additionally introduced ML-KEM session-establishment traffic.
The latency results showed comparable median sensor-to-gateway latency, but different timing variability and upper-tail behavior, while the PQ run exhibited higher typical post-establishment gateway-to-actuator latency. These measurements do not represent the complete end-to-end overhead of post-quantum security, because does not include complete gateway-side cryptographic processing and excludes TCP and ML-KEM session establishment. These findings illustrate the value of system-level evaluation for communication overhead, typical latency, and tail behavior that are not fully represented by isolated cryptographic benchmarks. Future work will extend the testbed to longer runs and include explicit measurement of ML-KEM session-establishment latency.
Author Contributions
Conceptualization, A.O.-G. and C.V.-R.; methodology, V.C.-M., F.G.-M., A.M., A.O.-G. and C.V.-R.; software, V.C.-M., F.G.-M. and A.O.-G.; validation, V.C.-M., F.G.-M., A.M. and A.O.-G.; formal analysis, V.C.-M., F.G.-M., A.M. and A.O.-G.; investigation, V.C.-M., F.G.-M. and A.O.-G.; data curation, V.C.-M., F.G.-M. and A.O.-G.; visualization, V.C.-M. and F.G.-M.; writing—original draft preparation, V.C.-M., F.G.-M. and A.O.-G.; writing—review and editing, V.C.-M., F.G.-M., A.M., A.O.-G. and C.V.-R.; supervision, A.O.-G. and C.V.-R.; project administration, A.O.-G. and C.V.-R. All authors have read and agreed to the published version of the manuscript.
Funding
This research was supported by SECIHTI through the project “Integrando Sensado y Comunicaciones para IoT de Próxima Generación,” CBF-2025-G-851.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data generated during this study will be made available by the corresponding author upon reasonable request.
Acknowledgments
This research paper was prepared by Tecnologico de Monterrey in close collaboration with the Government of the Republic of El Salvador, as represented by the State Cybersecurity Agency (ACE, Agencia de Ciberseguridad del Estado). During the preparation of this work, the scientific ideas, technical content, analysis, interpretation, and conclusions were developed by the authors. The manuscript was initially drafted by the authors, and ChatGPT (GPT-6), an AI-assisted writing tool developed by OpenAI, was subsequently used to support language editing, and consistency checking. After using this tool, the authors reviewed, edited, and verified the content as needed, and they take full responsibility for the content of the published article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Oks, S.J.; Jalowski, M.; Lechner, M.; Mirschberger, S.; Merklein, M.; Vogel-Heuser, B.; Möslein, K.M. Cyber-Physical Systems in the Context of Industry 4.0: A Review, Categorization and Outlook. Inf. Syst. Front. 2024, 26, 1731–1772. [Google Scholar] [CrossRef] [Scilit]
- Soori, M.; Arezoo, B.; Dastres, R. Internet of things for smart factories in industry 4.0, a review. Internet Things Cyber-Phys. Syst. 2023, 3, 192–204. [Google Scholar] [CrossRef] [Scilit]
- Afrin, S.; Rafa, S.J.; Kabir, M.; Farah, T.; Alam, M.S.B.; Lameesa, A.; Ahmed, S.F.; Gandomi, A.H. Industrial Internet of Things: Implementations, challenges, and potential solutions across various industries. Comput. Ind. 2025, 170, 104317. [Google Scholar] [CrossRef] [Scilit]
- Kayan, H.; Nunes, M.; Rana, O.; Burnap, P.; Perera, C. Cybersecurity of Industrial Cyber-Physical Systems: A Review. ACM Comput. Surv. 2022, 54, 229. [Google Scholar] [CrossRef] [Scilit]
- Halak, B.; Gibson, T.; Henley, M.; Botea, C.B.; Heath, B.; Khan, S. Evaluation of Performance, Energy, and Computation Costs of Quantum-Attack Resilient Encryption Algorithms for Embedded Devices. IEEE Access 2024, 12, 8791–8805. [Google Scholar] [CrossRef] [Scilit]
- Montenegro, J.A.; Rios, R.; Lopez-Cerezo, J. A performance evaluation framework for post-quantum TLS. Future Gener. Comput. Syst. 2026, 175, 108062. [Google Scholar] [CrossRef] [Scilit]
- Canonico, R.; Sperlì, G. Industrial cyber-physical systems protection: A methodological review. Comput. Secur. 2023, 135, 103531. [Google Scholar] [CrossRef] [Scilit]
- National Institute of Standards and Technology. Module-Lattice-Based Key-Encapsulation Mechanism Standard; Federal Information Processing Standards Publication NIST FIPS 203; U.S. Department of Commerce: Washington, DC, USA, 2024. [Google Scholar] [CrossRef] [Scilit]
- Karakaya, A.; Ulu, A. A survey on post-quantum based approaches for edge computing security. WIREs Comput. Stat. 2024, 16, e1644. [Google Scholar] [CrossRef] [Scilit]
- Zheng, J.; Zhu, H.; Dong, Y.; Song, Z.; Zhang, Z.; Yang, Y.; Zhao, Y. Faster Post-quantum TLS 1.3 Based on ML-KEM: Implementation and Assessment. In Proceedings of the Computer Security—ESORICS 2024; Garcia-Alfaro, J., Kozik, R., Choraś, M., Katsikas, S., Eds.; Springer: Cham, Switzerland, 2024; pp. 123–143. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.


