Enhancing IoT Communication Security
Enhancing IoT Communication Security
Abstract
As the number of Internet of Things (IoT) devices increases, securing IoT com-
munication protocols becomes critical. Due to the resource constraints of IoT
networks, these protocols are particularly vulnerable to cyberattacks. Tradi-
tional security measures often fail to address the unique challenges posed by
IoT communication, highlighting the need for specialized solutions. This re-
search evaluates security vulnerabilities in key IoT communication protocols:
MQTT, CoAP, and XMPP by identifying their strengths and weaknesses in
handling various attack scenarios. A practical comparison is made for MQTT,
examining the impact of using Transport Layer Security (TLS) on its security,
while for XMPP, a theoretical comparison for using JSON Web Token (JWT)
authentication is conducted. Additionally, the study explores the use of JWT
in combination with a complementary nonce-based solution to enhance security
and protect against inadequately addressed attacks in CoAP. The findings offer
valuable insights that contribute to the development of more secure implemen-
tations for the three IoT communication protocols.
Keywords: Internet of Things (IoT), Security vulnerabilities, Mitigation
strategies, MQTT , CoAP , XMPP , Encryption, Authentication, Lightweight
protocols
The rapid growth of the Internet of Things (IoT) has transformed indus-
tries by improving efficiency, convenience, and the ability to collect real-time
data. IoT systems are now widely used in critical areas such as healthcare,
transportation, and home automation, providing seamless connectivity and au-
tomation. However, as the number of connected devices continues to increase,
securing these systems has become a major challenge. For instance, the 2023
Mirai Botnet attack exploited vulnerabilities in IoT devices, disrupting services
worldwide and exposing the risks of weak security in IoT systems. Therefore,
IoT devices are inherently vulnerable due to their distributed nature, limited
computing resources, and diverse communication protocols.
The growing interconnectedness of devices amplifies these risks, leading to
threats such as unauthorized access, data breaches, and service disruptions. As
IoT systems become more integral to both personal and industrial applications,
the need for stronger, more effective security measures is critical. Without these
measures, organizations and users relying on these ecosystems remain exposed
to escalating security threats.
2
1.2. Research Objectives
This study focuses on the security challenges in the MQTT, CoAP, and
XMPP protocols. These protocols are widely used for communication between
IoT devices but suffer from a range of vulnerabilities. The primary objective is to
evaluate the security vulnerabilities inherent in MQTT, CoAP, and XMPP, in-
cluding issues such as insufficient encryption, weak authentication mechanisms,
and susceptibility to attacks such as request delays and selective blocking. It
also aims to analyze the trade-offs between security and performance in MQTT,
highlighting the impact of TLS encryption on latency and proposing lightweight
encryption at the application layer to reduce communication overhead. Further-
more, the study introduces a JWT-based authentication solution for CoAP, de-
signed to mitigate request delay attacks while enhancing device authentication,
scalability, and efficiency across IoT networks.
The existing research on IoT security has made considerable progress; how-
ever, many solutions remain fragmented and fail to comprehensively address
the vulnerabilities across MQTT, CoAP, and XMPP protocols. This study
contributes to ongoing efforts to enhance IoT security by providing a detailed
evaluation of vulnerabilities and mitigation strategies for MQTT, CoAP, and
XMPP. Practical insights into the trade-offs between security and performance
in IoT protocols are also offered, with a specific focus on MQTT latency analysis.
Additionally, a scalable and lightweight solution using JWT-based authentica-
tion for CoAP is proposed, ensuring improved security without compromising
performance. The findings of this study have far-reaching implications for im-
proving the reliability, safety, and privacy of IoT systems in both personal and
industrial applications.
3
strategies for MQTT, CoAP, and XMPP. Section 3 synthesizes the findings,
identifies key gaps in existing research, and outlines the challenges in achieving
comprehensive IoT security. Section 4 discusses the methodology, including the
experimental setup and analysis techniques employed in the study. Section 5
reports the results and examines their implications for IoT security. Finally,
Section 6 concludes the paper by summarizing the findings and proposing di-
rections for future research.
2. Literature Review
4
sends data to a broker, which then filters and forwards the data to subscribers.
Subscribers receive data only for the topics they have subscribed to [5].
Figure 1: Basic MQTT architecture showing data flow from the publisher to
subscribers via a broker [27].
5
working skills, regardless of whether authentication mechanisms are used by
the broker. To secure the entire MQTT communication channel, TLS or SSL
certificates should be used by MQTT brokers [8]. However, developing such
security mechanisms is difficult for resource-constrained devices. For instance,
while communications may be secured using the TLS protocol, the overhead it
generates is considered too much for resource-constrained devices [9].
Moreover, the lack of default authentication is another security concern in
MQTT, as the protocol was designed to be lightweight and simple for low band-
width and high latency environments. This design minimizes the overhead of
transmitted data; however, it also indicates that MQTT was not intended to
support complex security mechanisms by default, as implementing such mea-
sures would increase overhead and complexity within the protocol. While au-
thentication can be performed using the connection package, sending credentials
in plain text form remains a vulnerability. If network traffic is intercepted, sensi-
tive information can be easily accessed, leaving the system vulnerable to further
attacks [5].
Figure 2 shows an access control vulnerability, where an attacker can sub-
scribe to all topics and receive every message being published without being
authenticated.
6
Figure 2: Access control vulnerability enables an attacker to subscribe to all
topics and access published messages without authentication [10].
7
sented by [11]. This version introduces a new control packet called Spublish
for publishing encrypted messages. This method employs Cipher-text Policy
and Key Policy Attribute-Based Encryption (ABE), enhanced by lightweight
Elliptic Curve Cryptography, making it suitable for IoT applications.
Furthermore, a modified OAuth model was proposed by [12] to create an ar-
chitecture tailored for MQTT. This model assigns unique Application IDs and
shared virtual spaces to applications while allowing devices to utilize Device
IDs and Device Secrets for access. Users are authenticated using their Applica-
tion ID and Secret, while devices obtain permission from the application owner
through an Access Token.
As a further enhancement, an open-source publish/subscribe system devel-
oped by [13] extends MQTT’s capabilities by integrating a key management
framework and policy enforcement. This system regulates the flow of informa-
tion in MQTT, ensuring secure messaging through effective policy enforcement.
8
sources using methods such as GET, POST, PUT, and DELETE [14]. How-
ever, unlike HTTP, which relies on TCP, CoAP is built to operate over UDP
by default, offering lower overhead and making it more suitable for constrained
networks because UDP allows for faster transmission of data with reduced la-
tency.
9
A. Selective Blocking Attack. The selective blocking attack involves a man-in-
the-middle attacker who can block the delivery of specifically chosen requests
or responses while allowing others to pass through [16]. This vulnerability is
particularly critical for actuator deployments, where the implications of blocked
communication can have serious consequences.
The encryption in DTLS complicates the selective blocking of messages; how-
ever, it does not make it impossible. Proxies, when using DTLS and TLS, can
access the entire CoAP message, which means that man-in-the-middle attackers
have access to the IP addresses, ports, and message lengths. This information
can be sufficient to infer the server, resource, and command. Figure 3 outlines
the sequence of a typical selective blocking attack where the attacker intercepts
and drops a client’s message intended for the server.
10
UDP with DTLS, where out-of-order delivery is permitted. The sequence of a
request delay attack is shown in Figure 4.
Figure 4 highlights a scenario where the attacker intercepts and stores the
client’s message to unlock a door, then forwards it at a later time after the client
and server have stopped communication. If a request to unlock a door is delayed
and later fulfilled, the door may unexpectedly unlock after the client has already
left the facility, resulting in unauthorized access. This occurs when the attacker
releases the delayed request to unlock the door from the replay window, as shown
by the second ”@” in Figure 4. This is because the default replay windows in
DTLS can be manipulated, allowing attackers to replay delayed requests of their
choice [16].
11
According to the CoAP standard:
1. The Uri-Path and Uri-Query Options can contain any character sequence,
with no percent-encoding performed.
2. The value of a Uri-Path Option MUST NOT be “.” or “..”.
12
message interception, data manipulation, and denial-of-service (DoS) attacks,
among others. Several mitigation techniques are recommended, including the
use of Transport Layer Security (TLS) for MQTT to provide encryption and
authentication, and Datagram Transport Layer Security (DTLS) for CoAP to
secure the communication channel. Additionally, securing the devices, employ-
ing proper authentication, and using anomaly detection systems are essential to
prevent potential breaches in IoT systems.
In the realm of cybersecurity for IoT, various researchers have explored how
these protocols can be fortified against attacks. For instance, various studies
have proposed solutions such as integrating machine learning techniques for
detecting anomalies in MQTT-based systems [18]. Meanwhile, others have fo-
cused on improving the security of the protocols themselves through the use of
stronger encryption standards and better message integrity checks. The research
indicates that, while both MQTT and CoAP are well-suited for IoT communi-
cation, they must be used with caution and proper security measures to avoid
compromising the integrity and privacy of IoT systems.
13
Figure 5: XMPP protocol able different types of devices to communicate
together.
14
Moreover, The protocol works by exchanging messages through XML stan-
zas (see Fig. 7), which consist of three main components: message, presence,
and info/query. This structure allows for real-time data retrieval using a push
method
15
Moreover, as noted in [26], XMPP implementations have frequently encoun-
tered issues such as inadequate control over memory operations, improper cer-
tificate validation, and the presence of hard-coded accounts. These vulnerabil-
ities are well-documented in cases such as CVE-2019-1845, CVE-2019-12855,
CVE-2014-3451, CVE-2018-15720, and CVE-2016-1307.
Another significant vulnerability in XMPP is its susceptibility to Denial of
Service (DoS) attacks. As demonstrated in [25], DoS attacks can severely de-
grade network performance or even bring the network down entirely. (see Fig.8)
and (see Fig.9) provide a comparison of network throughput during normal op-
erations versus during an active DoS attack, illustrating the detrimental impact.
16
suggests stronger authentication protocols such as SCRAM-SHA-1 or SCRAM
SHA-1-PLUS. These widely used protocols, employed by most platforms, includ-
ing MongoDB, use SHA-1 hashing functions to protect communications. Fur-
thermore, [26] performed an implementation of SHA-256 and AES encryption
on the protocol; the authors firmly believe that their project offers a workable
solution for secure instant messaging which could be ported into a wide variety
of applications and scenarios. In addition, various mitigations have been pro-
posed by XMPP’s XEP (XMPP Extension Protocol) [19] series to reduce the
impact of security threats. For example, XEP-0205 describes strategies for mit-
igating Denial of Service (DoS) attacks, and XEP-0178 covers proper certificate
management regarding SASL authentication.
The literature on IoT security protocols XMPP, MQTT, and CoAP provided
valuable insights into their strengths and vulnerabilities. XMPP, commonly
used for real-time communication, integrated TLS and SASL for security but
remained susceptible to Denial of Service (DoS) attacks, message fragmenta-
tion, and weak authentication. These weaknesses in the authentication process
left it vulnerable to unauthorized access and crafted message attacks. MQTT,
designed for lightweight machine-to-machine communication, faced similar chal-
lenges. The absence of default encryption and authentication mechanisms made
it prone to data interception and unauthorized access. CoAP, optimized for
constrained environments, also had vulnerabilities, including selective blocking,
request delays, and path traversal attacks.
Although existing solutions, such as TLS/DTLS encryption, SCRAM-SHA-1
for authentication in XMPP, MQTTS for MQTT, and DTLS for CoAP, provided
some level of protection, significant gaps persisted. One major gap identified
was the inconsistency in security measures across these protocols, particularly in
the areas of authentication and authorization. Each protocol had its own inde-
pendent security implementation, creating vulnerabilities when they were used
together in an IoT ecosystem. This inconsistency posed a challenge, especially
17
in systems with diverse devices and communication protocols.
This research aimed to address these gaps by proposing targeted security en-
hancements for each protocol. For XMPP, the research’s proposed solution was
based on using JWT to strengthen the authentication process. In the case of
CoAP, the research addressed the critical vulnerability of request delay attacks
in resource-constrained environments by implementing a nonce mechanism. The
server generated a nonce based on the current timestamp and compared it with
the nonce sent by the client. If the nonces matched, the request was accepted
as fresh; otherwise, it was rejected, effectively mitigating replayed or delayed re-
quests. JWT was also employed with the nonce to ensure client authentication,
ensuring only authorized devices could access server resources.
For MQTT, the research included a simulation comparing the performance of
MQTT with and without TLS1.2, providing insights into the impact of TLS on
security and communication performance. By addressing these concerns, the re-
search provided targeted, protocol-specific security enhancements, contributing
to a more secure, reliable, and efficient implementation of IoT communication
protocols.
3. Methodology
3.1. Analysis
18
identifying potential weaknesses in the protocol’s default setup. Additionally,
the performance trade-offs between security and latency were analyzed by sim-
ulating client-broker interactions with and without TLS encryption. Metrics
such as latency and resource usage were measured to evaluate the impact of
encryption on communication delays.
The CoAP analysis focused on three specific attack scenarios based on the
literature review and experimental findings. The first attack analyzed was the
selective blocking attack, in which an attacker disrupts communication by se-
lectively dropping CoAP messages. Hypothetical scenarios from prior literature
were used to demonstrate how such selective disruptions could delay or interrupt
critical IoT operations.
A second attack, the path traversal attack, involved analyzing how malicious
actors could craft requests with manipulated paths, potentially bypassing access
controls to retrieve or manipulate sensitive information from the CoAP server.
The analysis identified CoAP’s insufficient input validation by default in some
configurations as a key factor enabling this attack.
This scenario was also analyzed through a literature review and an example,
concluding with the importance of improved user input sanitization mechanisms
for CoAP endpoints. The third attack, the request delay attack, was analyzed
through simulation and practical validation.
A default deployment of the CoAP server was implemented, revealing that
the protocol does not inherently protect against replay or delayed attacks. The
lack of mechanisms to verify the freshness of incoming requests made the server
vulnerable to these attacks. This evaluation concluded that the request delay
attack posed a critical threat that required a targeted solution.
The analysis of XMPP focused on comparing the performance characteristics
of two authentication protocols: JSON Web Tokens with RSA Signature 256
(JWT RS256) and the Salted Challenge Response Authentication Mechanism
(SCRAM-SHA-1). By examining the cumulative performance of these protocols
over a large number of iterations, the study aimed to identify any significant
differences in their efficiency.
19
3.2. Tools and Environment Setup
The tools and environment setup included using the Mosquitto MQTT bro-
ker and Paho MQTT client libraries to simulate MQTT client-broker inter-
actions. The experimental setup was implemented in a simulated IoT environ-
ment using virtual machines, reflecting constrained IoT network conditions. For
CoAP, the ”aiocoap” Python library was used to simulate server-client commu-
nications, along with the ”jwt” library for JWT generation and validation.
For XMPP, To conduct the performance evaluation, the research leveraged
various tools and libraries relevant to the XMPP ecosystem. This included the
use of XMPP server and client software, such as the Openfire XMPP server and
the Smack XMPP client API, to simulate the XMPP communication environ-
ment. Additionally, the study incorporated the ”jwt” library to facilitate the
generation and validation of JWT tokens as part of the analysis.
20
One such innovative solution to improve detection capabilities is the fuzzy
logic-based detection system for DoS attacks. This system focuses on analyz-
ing device interactions and recognizing abnormal patterns, which is crucial in
detecting DoS attacks. It evaluates key parameters such as request frequency,
response times, and connection durations to identify unusual patterns that may
indicate a DoS attack, even when these patterns do not strictly violate prede-
fined thresholds. Table 1 provides a detailed breakdown of the system’s flow,
including input collection, fuzzification, fuzzy logic rules, inference, defuzzifica-
tion, and actionable responses, while Figure 15 visually represents the system
architecture. Together, they demonstrate how the collected inputs are processed
through fuzzy logic to generate actionable outputs for mitigating potential DoS
attacks.
Figure 10: Fuzzy Logic-based Detection System Architecture for DoS Attack.
21
Table 1: Proposed Fuzzy Logic-based DoS Detection System Flow
– Duration of connections
– Packet sizes
countermeasures). alert
22 attacks.
When evaluating these mitigation approaches, it becomes clear that no sin-
gle solution can fully secure MQTT across all use cases. The effectiveness of any
security strategy depends on the specific requirements and constraints of the IoT
environment in which MQTT operates. For instance, resource-constrained sys-
tems, such as smart home devices, may benefit from lightweight cryptographic
algorithms such as AES or ECC, which provide a balance between security and
performance. On the other hand, industrial IoT deployments, which prioritize
strong data protection and can accommodate higher computational overhead,
are better suited for robust encryption methods such as TLS.
This highlights the importance of selecting security protocols based on the
context of deployment, carefully balancing security, latency, and resource uti-
lization to meet the system’s operational goals. For CoAP, the request delay
attack was addressed by implementing a JWT and nonce-based mechanism. A
CoAP server was developed using a secret key for signing JWT tokens and a
secret message for generating nonces. Nonce generation involved combining the
current timestamp with the secret message and generating a SHA-256 hash to
produce a unique identifier. The server validated incoming JWT tokens and en-
sured the format and freshness of nonces while tracking used nonces to prevent
replay attacks. On the client side, JWT tokens were created by encoding user
information and permissions with the secret key, and nonces were generated us-
ing the current timestamp and the shared secret message. These elements were
packaged into the POST request payload for secure communication. Simulation
and validation involved running the CoAP server and client, ensuring unique
nonces for each request, and rejecting repeated or old nonces. Additional testing
confirmed that previously used nonces, even after server restarts, were rejected,
validating the effectiveness of the solution.
Based on the findings from the performance comparison, the research did
not propose any specific solutions or enhancements to the XMPP protocol. The
focus remained on the evaluation of the existing authentication mechanisms,
specifically JWT RS256 and SCRAM-SHA-1, and their relative performance
characteristics within the XMPP context. No further development or imple-
23
mentation of new solutions was undertaken as part of this study.
This section will analyze the security vulnerabilities of MQTT, CoAP, and
XMPP, focusing on issues such as the lack of default encryption and authentica-
tion in MQTT, which leads to eavesdropping and potential DoS attacks. It will
review and compare existing mitigation strategies from the literature through
supported analysis and simulations.
4.1. MQTT
The findings from the evaluation of MQTT in the context of IoT security vul-
nerabilities confirm that while the protocol is widely adopted for its lightweight
design and efficiency in constrained environments, it presents significant se-
curity vulnerabilities that could jeopardize IoT applications if not adequately
addressed.
One of the critical issues observed in the MQTT protocol is its default lack
of encryption and authentication mechanisms, which leaves the system highly
vulnerable to eavesdropping and unauthorized access. This security gap is par-
ticularly concerning in IoT networks, where data integrity and privacy are es-
sential. Without encryption, sensitive data transmitted across the network can
be intercepted by attackers, who can steal or manipulate the information to
cause damage or disrupt interconnected devices.
As shown in Figure 11, the Wireshark capture of an MQTT connection
packet reveals that sensitive information, such as client ID, username, and pass-
word, is transmitted in plaintext. In this example, both the client ID and
credentials are visible, making it easy for attackers to capture and misuse these
details.
The lack of authentication further exacerbates the problem, as devices can
communicate with the broker without any validation of their identity. As
demonstrated in the logs during testing, the Mosquitto broker allows clients
24
Figure 11: Results of listening and capturing the MQTT connection command
packets.
Figure 12: Home Assistant and Mosquitto logs showing failed authentication
attempts and the lack of connection blocking.
These entries show failed authentication attempts for both the FAKE and
REAL usernames, but they do not prevent further connections. In the MQTT
log, the client mqtt-explorer-58f6fbef connected using a username (USERNAME),
but quickly disconnected. Another client (mqtt-explorer-75402a08) connected
without a username and also disconnected shortly after. These connections
occurred without any authentication checks or security measures in place to
prevent unauthorized access. Here are the corresponding logs from the MQTT
25
broker, as shown in Figure 13:
26
Figure 14: Comparison of MQTT Latency With and Without TLS Encryption.
27
ability. As shown, LPKI significantly reduces both latency and energy usage
compared to PKI. This makes LPKI a more efficient option for IoT systems,
where minimizing delays and conserving energy is critical. The graph clearly
demonstrates how LPKI can offer secure authentication while addressing the
resource limitations typical of IoT environments.
Thus, organizations must carefully weigh the benefits of enhanced security
against the added operational burden, especially in constrained environments.
4.2. CoAP
It is evident from the literature review that CoAP’s strength lies in its
lightweight design and compatibility with HTTP. However, as highlighted, CoAP
has three main high-risk vulnerabilities: Selective Blocking Attacks, Request
Delay Attacks, and Path Traversal Vulnerabilities. As a quick recap:
28
– Selective Blocking Attacks: These exploit CoAP’s reliance on un-
encrypted communication, allowing attackers to block specific requests
or responses. This can disrupt actuator operations and compromise the
availability and integrity of IoT systems.
29
The nonce, a unique, one-time-use value, ensures the freshness of the message
and prevents replay attacks. Even if an attacker intercepts a message with a
valid nonce that has not been used or recorded by the server, the request will
still fail. This is because the implementation ensures that the server validates
the freshness of the nonce by reversing its hash, extracting the timestamp, and
comparing it to the current timestamp to verify that the request is recent and
legitimate.
Before the solution is implemented, a delay in request transmission could
have allowed an attacker to intercept and later replay a valid request, such as
unlocking a door, after a significant delay. This could bypass security mecha-
nisms, resulting in unauthorized access or other security issues.
The DTLS (Datagram Transport Layer Security) replay window could have
been manipulated, enabling delayed requests to be executed at a later time. To
demonstrate the attack, the scenario will be replicated using a CoAP server and
client built in Python, utilizing the aiocoap library.
In the example illustrated in Figure 17, a CoAP client sends an ’Unlock
Door’ message to a CoAP server. The sequence of a successful communication
is as follows:
Figure 16: CoAP client sends an “Unlock Door” message to a CoAP server.
The client message is sent to the server, which successfully receives it after
validating the JWT token. The client request was captured in Wireshark, as
shown in the figure below:
30
Figure 17: Capturing the client request in Wireshark.
In Figure 18, the portion highlighted in Yellow is the JWT token and the
portion highlighted in green is the message. In a request delay attack, an at-
tacker would set up a specialized CoAP proxy to intercept and capture this
request. For demonstration purposes, let’s assume the attacker intercepts the
message shown above to conduct a delayed replay. By sending the same request
again with the unchanged JWT token, the attacker would successfully transmit
the ”Unlock Door” message to the server, regardless of the time it was originally
sent.
To illustrate this attack, the JWT token value from the message is assigned
to a fixed variable, and the message is sent to the server, as shown in the code
snippet in Figure 19:
After the client runs and sends the message to the server, the request is
31
accepted, and the message is successfully received by the server, as demonstrated
in Figure 20. This illustrates a request delay attack in action.
A nonce mechanism has been introduced alongside the JWT to address this
vulnerability. When the server receives a request, it verifies the nonce to ensure
that it has not been reused. Delayed requests with expired or reused nonces
are automatically rejected, preventing attackers from exploiting delayed request
delivery.
The nonce is a SHA-256 hash created by combining a secret message with
the current timestamp string. Upon receiving a message, the server generates a
hash using the same secret message and the current timestamp. If the nonce sent
in the client request matches the server-generated hash, the request is deemed
fresh and accepted. If the nonces do not match, the request is rejected, and
an appropriate error response is sent, indicating that the nonce format is either
incorrect or that the request is delayed or reused. This mechanism ensures that
even if an attacker intercepts a valid nonce from a legitimate client request (one
that the server has not yet marked as used), the request will fail when replayed
because the server will generate a nonce hash based on the current timestamp,
which will not match the intercepted nonce.
To demonstrate this mechanism, consider the server-client communication
shown in Figure 21. The client sends the ’Unlock Door’ message with a nonce
attached. Upon receiving the request, the server verifies the nonce and prints
its value for visualization purposes.
This is how the request looks like when captured in Wireshark:
As shown in Figure 22, the yellow and green portions are the JWT token
and message values respectively. The new blue portion is the value of the nonce.
If an attacker now captures this request before it reaches the server and delays
its transmission to a later time, the request will fail.
32
Figure 20: The client sends the ”Unlock Door” message, this time with a
nonce attached.
The server was restarted in this demonstration, and the client code was mod-
ified to send a valid nonce (underlined in red) in Figure 23 that was generated
in the previous simulation. However, as shown in the result, the server rejected
the request, returning the following error message:
This confirms that the request delay attack has been successfully mitigated, as
the nonce, though valid in format, was not accepted because it was reused and
had expired. The server correctly identified the expired or reused nonce and
responded with an appropriate error message.
33
Figure 22: Demonstration of the delayed request failure.
4.3. XMPP
The comparative analysis of authentication mechanisms reveals significant
architectural and performance distinctions between the Salted Challenge Re-
sponse Authentication Mechanism (SCRAM) and JSON Web Tokens with RSA
Signature 256 (JWT RS256). This investigation demonstrates that while both
protocols serve authentication purposes, JWT RS256 offers substantive advan-
tages in contemporary distributed computing environments.
1. Architectural Scalability
The fundamental architectural differences between SCRAM and JWT
RS256 profoundly impact system scalability. SCRAM’s connection-bound
model necessitates persistent server-side session management, creating in-
herent scalability limitations. In contrast, JWT RS256 implements a
stateless authentication paradigm that inherently supports horizontal scal-
ing. This architectural approach is particularly critical in microservice and
cloud-native architectures, where dynamic resource allocation and mini-
mal server-side state maintenance are paramount.
34
The stateless nature of JWT RS256 enables more efficient resource uti-
lization. By eliminating the need for extensive server-side session storage,
organizations can significantly reduce computational overhead and infras-
tructure complexity. This approach is especially beneficial in high-traffic
distributed systems where authentication mechanism efficiency directly
correlates with overall system performance
2. Cryptographic Considerations
Cryptographic architecture represents another critical point of differen-
tiation. SCRAM’s password-based authentication mechanism relies on
shared secrets, introducing inherent security vulnerabilities. JWT RS256,
utilizing asymmetric cryptography through public-key infrastructure (PKI),
offers a more robust security framework. The decentralized token verifi-
cation mechanism effectively mitigates risks associated with centralized
authentication points.
The embedded claims functionality in JWT RS256 provides enhanced se-
curity granularity. Unlike traditional authentication mechanisms, this ap-
proach allows for:
- Dynamic access control - Contextual authentication - Embedded meta-
data verification
3. Performance Implications
As evidenced by the performance graph, JSON Web Tokens with RSA
Signature 256 (JWT RS256) demonstrate clear advantages over the Salted
Challenge Response Authentication Mechanism (SCRAM-SHA-1) in terms
35
Figure 23: JWT RS256 outperforms SCRAM-SHA-1 in execution time as
iterations increase, highlighting its efficiency for large-scale applications.
36
Table 3: Performance Benchmark Comparison between SCRAM-SHA-1 and
JWT RS256.
37
Table 5: Comparison of IoT Communication Protocols: MQTT, CoAP, and
XMPP in terms of security, performance and scalability.
The analysis of Internet of Things (IoT) protocols shows the need to bal-
ance security and performance in environments with limited resources. This
section summarizes the key findings and outlines recommendations for future
improvements to enhance the safety and efficiency of IoT systems.
5.1. Conclusion
Future work on MQTT will focus on creating the proposed fuzzy logic-based
system for detecting DoS attacks. This includes building a prototype designed
for resource-limited IoT environments and testing its performance in real-world
settings.
To address the delays caused by TLS, lightweight encryption methods will
be studied to improve performance while maintaining security. More analysis of
MQTT weaknesses is needed, especially regarding weak authentication methods
and unauthorized access. Adding automated tools for monitoring traffic and
spotting unusual activity is recommended to better detect threats.
Lightweight authentication methods, such as SMQTT or OAuth, will be
explored along with testing MQTT’s performance across different IoT devices
to find the best balance of security and efficiency.
For CoAP, the proposed nonce mechanism—where the server creates a hash
using a secret message and the current time—ensures only recent requests are
accepted. However, the use of SHA-256 for creating hashes may be too de-
manding for devices with limited resources. Future work should look into using
simpler hashing methods to improve efficiency in these cases.
Further research on XMPP should analyze the long-term effects of using
JWT RS256, focusing on improving how tokens are managed and solving issues
with token cancellation in stateless systems.
Studies on quantum-safe cryptographic methods for JWT and comparisons
of signing methods such EdDSA and ECDSA are needed. Performance un-
der different network conditions and workloads, especially in edge computing,
requires thorough analysis. Additionally, standardized security practices for
token-based authentication in new systems such as IoT networks and serverless
platforms should be developed. Automated token management systems that
adjust security settings based on real-time threats and system metrics also need
further study.
40
References
[1] N. Naik, Choice of effective messaging protocols for iot systems: Mqtt,
coap, amqp and http, in: Proc. IEEE Int. Syst. Eng. Symp. (ISSE), Vienna,
Austria, 2017, p. 2. doi:10.1109/SysEng.2017.8088251.
[7] D. S. Ugalde, Security analysis for mqtt in internet of things, 2018, pp.
14–17.
[8] F. Raschbichler, Mitigate iot attacks with key mqtt security principles,
2021, [Online]. Available: https://www.hivemq.com/blog/mqtt-security-
principles-mitigate-iot-attacks/. Accessed: Oct. 7, 2024.
41
[9] D. Dinculeană, X. Cheng, Vulnerabilities and limitations of mqtt protocol
used between iot devices, Vol. 9, 2019, p. 2. doi:10.3390/app9050848.
[14] A. A. Ali, Constrained application protocol (coap) for the iot, 2018, [On-
line]. Available: https://doi.org/10.13140/RG.2.2.33265.17766.
[17] Aseem, Iot security – part 11 (introduction to coap protocol and secu-
rity), in: Payatu, 2024, https://payatu.com/masterclass/iot-security-part-
11-introduction-to-coap-protocol-and-security/. Accessed: Oct. 10, 2024.
42
[18] Z. Gao, J. Cao, W. Wang, H. Zhang, Z. Xu, Online-semisupervised neural
anomaly detector to identify mqtt-based attacks in real time, Vol. 2021,
2021, pp. 2–3. doi:10.1155/2021/4587862.
[20] Wallarm, What is the extensible messaging and presence protocol (xmpp)?,
n.d.
URL https://www.wallarm.com/what/extensible-messaging-presence-protocol
[21] B. N. Iduh, Whatsapp network group chat analysis using python pro-
gramming, Vol. 12, 2023, pp. 71–78. doi:https://doi.org/10.1080/
23742917.2023.2228053.
URL https://www.tandfonline.com/doi/full/10.1080/23742917.
2023.2228053
[23] B. N. Iduh, Whatsapp network group chat analysis using python program-
ming, 2020.
43
[26] V. C.P, A. A. Chikkamannur, Iot future in edge computing, Vol. 3, IJAERS,
India, 2016, pp. 29–33, iSSN: 2349-6495 (P), 2456-1908 (O). doi:https:
//dx.doi.org/10.22161/ijaers/3.12.29.
44