HECS4MQTT: A Multi-Layer Security Framework for Lightweight and Robust Encryption in Healthcare IoT Communications
Abstract
1. Introduction
2. Theoretical Background
2.1. Message Queue Telemetry Transport (MQTT)
- Reason Codes: provide explicit acknowledgment feedback, enabling more granular error reporting and diagnostic capability.
- Shared Subscriptions: allow multiple clients to share a single subscription, supporting distributed processing and load balancing.
- Message Expiry Intervals: define the validity period of a message, preventing outdated data from being delivered.
- Topic Aliases: replace long topic strings with shorter aliases to reduce payload size, which is beneficial for low-bandwidth links.
- User Properties: enable the transmission of custom metadata through MQTT packets for application-specific use cases.
2.2. Lightweight Cryptography for MQTT
3. Related Work
3.1. Lightweight Encryption in IoT
3.2. MQTT Multi-Broker Related Work
3.3. Limitation of Lightweight Encryption and the Need for Layered Security
- Designing and implementing a dual-layer encryption architecture that integrates lightweight encryption at the edge and strong encryption (AES-256 with TLS 1.3) when transmitting data to the cloud, ensuring confidentiality, integrity, and performance across the entire data pipeline.
- Introducing a custom bridge application that operates at the boundary between trusted (hospital) and untrusted (cloud) environments. The bridge functions as both subscriber and publisher—decrypting edge-encrypted messages and re-encrypting them using cloud-grade protocols before forwarding—effectively decoupling transport-level and application-level encryption.
- Demonstrating an architecture that enhances security without increasing complexity at the edge, thereby preserving the performance benefits of Salsa20-Blake2b while ensuring data remains protected when it leaves the local network.
- Validating the system through an end-to-end implementation, including local and cloud Mosquitto brokers, certificate-based TLS setup, and performance evaluation, showcasing its applicability to real-world healthcare IoT deployments where both performance and privacy are critical.
4. Proposed Architecture
4.1. High-Level Architecture Overview
4.2. Perception Layer
4.3. Local MQTT Broker
4.4. Cloud Integration Layer
4.5. Application Layer
5. Implementation of Secure IoT-Based Communication System
5.1. Publisher Implementation at the IoT Node
Algorithm 1: Pseudocode For Publisher Component |
Input: Image directory path, number of images x, encryption method Output: Encrypted messages published to MQTT topic, log performance Begin Connect to Local MQTT Broker with TLS For x number of images do Load image data from file Generate timestamp EncryptedPayload = Encrypt_Payload(image_data, Encryption_Method) Construct JSON message with ‘timestamp’ and ‘content’ Publish message to topic Wait fixed interval before next message Log performance metrics (latency, throughput, CPU stats) End For Save performance data in cvs file Disconnect from Broker End |
Algorithm 2: Pseudocode For Encryption Function |
Input: Image directory path, number of images x, encryption method Output: Encrypted messages published to MQTT topic, log Begin function Encrypt_Payload(data, method) If method =AES-GCM: Generate nonce Encrypt data with AES in GCM mode Concatenate nonce + tag + ciphertext Encode in base64 and return If method = Salsa20-HMAC: Generate nonce Encrypt data with Salsa20 Generate HMAC using Blake2b Concatenate nonce + ciphertext + HMAC Encode in base64 and return End |
5.2. Local MQTT Broker and Bridge Application
- MQTT Subscriber: subscribes to a designated topic on the local Mosquitto broker to retrieve incoming encrypted messages.
- Decryption Module: applies the Salsa20 cipher to extract the original message content.
- Re-encryption Module: uses AES in GCM mode with a 256-bit key to ensure confidentiality and integrity.
- MQTT Publisher: publishes the transformed message to the cloud broker on a mirrored topic, using UTF-8 encoding and base64 to preserve structure.
Algorithm 3: Pseudocode For Local Broker Component |
Input: Encrypted MQTT messages from edge devices Output: Re-encrypted messages published to cloud broker Begin function Bridge_ReEncrypt_Forward() Connect to Local MQTT Broker as Subscriber Connect to Cloud MQTT Broker as Publisher Subscribe to Topic from Edge Devices For each incoming message do Extract timestamp and encrypted payload DecryptedData = Decrypt_Salsa20_Blake2b(encrypted_payload) ReEncryptedPayload = Encrypt_AES_GCM(DecryptedData) Construct JSON with original timestamp and re-encrypted content Publish to cloud broker End for End |
5.3. Cloud MQTT Broker and Subscriber
- Verifying the authenticity of the payload using the MAC.
- Decrypting the ciphertext using the shared symmetric key.
- Measuring latency and decryption time.
Algorithm 4: Pseudocode For Subscriber Component |
Input: Encrypted MQTT messages from edge devices Output: Re-encrypted messages published to cloud broker Begin Connect to Cloud MQTT Broker Subscribe to Topic For each received message do Extract ‘timestamp’ and ‘encrypted content’ DecryptPayload = Decrypt_AES_GCM(encrypted_content) Compute latency = CurrentTime − Timestamp Save decrypted image Log metrics (latency, throughput) End for End |
6. Performance and Security Analysis
6.1. Testbed
6.2. Security Evaluation
6.3. Performance Evaluation
7. Conclusions and Discussion
- Dynamic Key Management: future research could explore the integration of lightweight key exchange protocols or identity-based encryption to reduce the reliance on pre-shared keys at the edge.
- Mutual TLS Authentication: enforcing client authentication via mutual TLS in the cloud broker could further enhance access control and mitigate impersonation risks.
- Intrusion Detection Integration: the bridge application can be extended with lightweight anomaly detection modules to monitor traffic patterns and detect signs of compromise or data leakage.
- Interoperability Testing: extending the framework to support additional brokers, such as HiveMQ or EMQX, and testing interoperability in hybrid deployments would validate its practical adaptability.
7.1. Positioning Within Current Research
7.2. Limitations of This Work
7.3. Future Research Directions
- Integration of post-quantum cryptographic algorithms, especially lattice-based key exchanges, to ensure long-term cryptographic resilience.
- Adapting the framework to 6G-enabled infrastructures, leveraging edge intelligence, ultra-low latency, and secure slicing for healthcare-specific use cases.
- Development of lightweight dynamic key exchange protocols, such as EDHOC or identity-based encryption, to reduce reliance on static keys.
- Embedding intrusion detection capabilities within the bridge application to detect anomalies and enhance runtime security.
- Extending performance evaluation to battery-powered IoT devices, including wearables and implantables, in real hospital or smart clinic settings.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Abbasi, M.; Plaza-Hernandez, M.; Prieto, J.; Corchado, J.M. Security in the Internet of Things Application Layer: Requirements, Threats, and Solutions. IEEE Access 2022, 10, 97197–97216. [Google Scholar] [CrossRef]
- Harbi, Y.; Aliouat, Z.; Refoufi, A.; Harous, S. Recent Security Trends in Internet of Things: A Comprehensive Survey. IEEE Access 2021, 9, 113292–113314. [Google Scholar] [CrossRef]
- Khan, M.N.; Rao, A.; Camtepe, S. Lightweight Cryptographic Protocols for IoT Constrained Devices: A Survey. IEEE Internet Things J. 2020, 8, 4132–4156. [Google Scholar] [CrossRef]
- Alharbi, S.; Bell, D.; Awad, W. Lightweight Security Scheme for Internet of Things Encryption. Appl. Math. Inf. Sci. 2025, 19, 751–760. [Google Scholar] [CrossRef]
- OASIS Standard. MQTT Version 5.0. OASIS. 2019. Available online: https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html (accessed on 1 June 2025).
- Singh, M.; Rajan, M.A.; Shivraj, V.L.; Balamuralidhar, P. Secure MQTT for Internet of Things (IoT). In Proceedings of the 5th International Conference on Communication Systems and Networks Technologies, Gwalior, India, 4–6 April 2015; pp. 746–751. [Google Scholar]
- Pal, P.; Lauer, G.; Khoury, J.; Hoff, N.; Loyall, J. P3S: A privacy preserving publish-subscribe middleware. In Proceedings of the ACM/IFIP/USENIX International Conference on Distributed Systems Platforms and Open Distributed Processing, Montreal, QC, Canada, 3–7 December 2012; pp. 476–495. [Google Scholar]
- Wang, J.; Zhang, J.; Schooler, E.M.; Ion, M. Performance evaluation of attribute-based encryption: Toward data privacy in the IoT. In Proceedings of the IEEE International Conference on Communications (ICC), Sydney, Australia, 10–14 June 2014; pp. 725–730. [Google Scholar]
- Bisne, L.; Parmar, M. Composite secure MQTT for Internet of Things using ABE and dynamic S-box AES. In Proceedings of the 2017 Innovations in Power and Advanced Computing Technologies (IPACT), Vellore, India, 21–22 April 2017; pp. 1–5. [Google Scholar] [CrossRef]
- Iqbal, M.; Laksmono, A.M.A.; Prihatno, A.T.; Pratama, D.; Jeong, B.; Kim, H. Enhancing IoT security: Integrating MQTT with ARIA Cipher 256 algorithm cryptography and mbedTLS. In Proceedings of the 2023 International Conference on Platform Technology and Service (PlatCon), Busan, Republic of Korea, 16–18 August 2023; pp. 91–96. [Google Scholar] [CrossRef]
- Hintaw, J.; Manickam, S.; Karuppayah, S.; Aladaileh, M.A.; Aboalmaaly, M.F.; Laghari, S.U.A. A Robust Security Scheme Based on Enhanced Symmetric Algorithm for MQTT in the Internet of Things. IEEE Access 2023, 11, 43019–43040. [Google Scholar] [CrossRef]
- Hosseinkhani, R.; Javadi, H.H.S. Using cipher key to generate dynamic S-box in AES cipher system. Int. J. Comput. Sci. Secur. 2012, 6, 19–28. [Google Scholar]
- Kazlauskas, K.; Kazlauskas, J. Key-dependent S-box generation in AES block cipher system. Informatica 2009, 20, 23–34. [Google Scholar] [CrossRef]
- Al-Mamun, A.; Rahman, S.S.M.; Ahmed Shaon, T.; Hossain, M. Security analysis of AES and enhancing its security by modifying S-box with an additional byte. Int. J. Comput. Netw. Commun. 2017, 9, 69–88. [Google Scholar] [CrossRef]
- Hamad, M.; Finkenzeller, A.; Liu, H.; Lauinger, J.; Prevelakis, V.; Steinhorst, S. SEEMQTT: Secure End-to-End MQTT-Based Communication for Mobile IoT Systems Using Secret Sharing and Trust Delegation. IEEE Internet Things J. 2022, 10, 3384–3406. [Google Scholar] [CrossRef]
- Buccafurri, F.; De Angelis, V.; Lazzaro, S. MQTT-I: Achieving End-to-End Data Flow Integrity in MQTT. IEEE Trans. Dependable Secur. Comput. 2024, 21, 4717–4734. [Google Scholar] [CrossRef]
- Li, P.; Su, J.; Wang, X. iTLS: Lightweight Transport-Layer Security Protocol for IoT with Minimal Latency and Perfect Forward Secrecy. IEEE Internet Things J. 2020, 7, 6828–6841. [Google Scholar] [CrossRef]
- Sadio, O.; Ngom, I.; Lishou, C. Lightweight Security Scheme for MQTT/MQTT-SN Protocol. In Proceedings of the 2019 Sixth International Conference on Internet of Things: Systems, Management and Security (IOTSMS), Granada, Spain, 22–25 October 2019. [Google Scholar] [CrossRef]
- Wijayanto, A.; Nugrahani, S.S.; Wardani, D.W.; Cahyono, H.D.; Setiadi, H. Performance Comparison of AES, Grain V1, and RC4 Algorithms on the MQTT Protocol. In Proceedings of the International Conference on Information Technology, Computer and Electrical Engineering, Semarang, Indonesia, 31 August–1 September 2023. [Google Scholar] [CrossRef]
- Al-Ani, A.; Shen, W.K.; Al-Ani, A.K.; Laghari, S.A.; Elejla, O.E. Evaluating Security of MQTT Protocol in Internet of Things. In Proceedings of the 2023 IEEE Canadian Conference on Electrical and Computer Engineering, Regina, SK, Canada, 24–27 September 2023. [Google Scholar] [CrossRef]
- Kurdi, H.; Thayananthan, V. A Multi-Tier MQTT Architecture with Multiple Brokers Based on Fog Computing for Securing Industrial IoT. Appl. Sci. 2022, 12, 7173. [Google Scholar] [CrossRef]
- Veeramanikandan, M.; Sankaranarayanan, S. Publish/Subscribe Based Multi-Tier Edge Computational Model in Internet of Things for Latency Reduction. J. Parallel Distrib. Comput. 2019, 127, 18–27. [Google Scholar]
- Pham, V.N.; Nguyen, V.D.; Nguyen, T.D.T.; Huh, E.N. Efficient Edge-Cloud Publish/Subscribe Broker Overlay Networks to Support Latency-Sensitive Wide-Scale Iot Applications. Symmetry 2020, 12, 3. [Google Scholar] [CrossRef]
- AWS Key Management Service. Available online: https://docs.aws.amazon.com/kms/latest/developerguide/overview.html (accessed on 1 June 2025).
- Fan, C.; Shie, C.; Tseng, H. An Efficient Data Protection Scheme Based on Hierarchical ID-Based Encryption for MQTT. ACM Trans. Sens. Netw. (TOSN) 2023, 19, 21. [Google Scholar] [CrossRef]
- NIST STS Documentation. 2010. Available online: https://csrc.nist.gov/publications/detail/sp/800-22/rev-1a/final (accessed on 1 June 2025).
- MITRE ATT & CK Framework. Available online: https://attack.mitre.org/ (accessed on 1 June 2025).
- Pereira, C.; Pinto, A.; Ferreira, D.; Aguiar, A. Experimental Characterization of Mobile IoT Application Latency. IEEE Internet Things J. 2017, 4, 1082–1094. [Google Scholar] [CrossRef]
Metric | Tool/Method | Evaluated Layer | Expected Result |
---|---|---|---|
Confidentiality | NIST STS, Wireshark | Edge and Cloud | High entropy, secure ciphertext |
Integrity | HMAC tampering, TLS integrity | Edge and Cloud | Tampering is detected |
Broker compromise resilience | Payload capture test | Cloud broker | Data unreadable, MAC fails |
CPU usage | perf, psutil | Publisher (constraint node) | Salsa20\Blake2b is better compared to other protocols |
Encryption time | perf, psutil | Publisher (constraint node) | Salsa20\Blake2b is better compared to other protocols |
Throughput | perf, psutil | Publisher (constraint node) | Salsa20\Blake2b is better compared to other protocols |
Protocol | Round 1 | Round 2 | Round 3 | Round 4 | Round 5 | Round 6 | Round 7 | Round 8 |
---|---|---|---|---|---|---|---|---|
Salsa20-Blake2b | 0.88381 | 0.283651 | 0.987717 | 0.411331 | 0.928822 | 0.696591 | 0.213525 | 0.452711 |
Aspect | TLS Only (Single Broker) | Multi-Broker Layered Encryption |
---|---|---|
Architecture | Single MQTT broker with TLS connection from all clients | Local broker (in hospital) + cloud broker, with edge and cloud layers using different encryption schemes |
Encryption at Edge | TLS (standard AES, handshake overhead) | Lightweight encryption (e.g., Salsa20-Blake2b) optimized for resource-constrained devices |
Data Security Beyond the Broker | Not preserved—broker decrypts payload | Preserved—data re-encrypted (e.g., AES-256 + TLS 1.3) before leaving trusted environment |
Metadata Protection | Protected (TLS encrypts topics, headers, etc.) | Fully protected via TLS on outer layer; internal encryption protects payload end-to-end |
End-to-End Confidentiality | Broken at broker level—broker sees plaintext payload | Maintained from publisher to subscriber through layered encryption |
Broker Compromise Risk | High—one compromised broker exposes all client data | Reduced—layered encryption limits exposure even if a broker is compromised |
TLS Overhead on IoT Devices | Significant (handshake, certificate validation) | Avoided—edge uses lightweight symmetric encryption tailored to constrained devices |
Key Management Complexity | Centralized certificate-based authentication | Multi-key architecture (light at edge, stronger in cloud) with symmetric/shared keys |
Adaptability for Healthcare | Less suitable for edge devices (wearables, implants) | Highly adaptable—tailored crypto for edge, strong security when data moves to public/cloud infrastructure |
Compliance and Auditability | Requires TLS logs and endpoint audit trails | Clear separation of trust domains (edge, hospital, cloud) allows enhanced security controls and logging |
Scalability Across Hospitals | Single point of failure | Multi-broker allows local independence and central management in cloud |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Alharbi, S.; Awad, W.; Bell, D. HECS4MQTT: A Multi-Layer Security Framework for Lightweight and Robust Encryption in Healthcare IoT Communications. Future Internet 2025, 17, 298. https://doi.org/10.3390/fi17070298
Alharbi S, Awad W, Bell D. HECS4MQTT: A Multi-Layer Security Framework for Lightweight and Robust Encryption in Healthcare IoT Communications. Future Internet. 2025; 17(7):298. https://doi.org/10.3390/fi17070298
Chicago/Turabian StyleAlharbi, Saud, Wasan Awad, and David Bell. 2025. "HECS4MQTT: A Multi-Layer Security Framework for Lightweight and Robust Encryption in Healthcare IoT Communications" Future Internet 17, no. 7: 298. https://doi.org/10.3390/fi17070298
APA StyleAlharbi, S., Awad, W., & Bell, D. (2025). HECS4MQTT: A Multi-Layer Security Framework for Lightweight and Robust Encryption in Healthcare IoT Communications. Future Internet, 17(7), 298. https://doi.org/10.3390/fi17070298