1. Introduction
Within the rapidly evolving Internet of Things (IoT) ecosystem, where interconnected devices generate and exchange sensitive data, ensuring robust security and privacy is paramount. Modular exponentiation, a fundamental operation underpinning public-key cryptosystems like RSA, plays a pivotal role in safeguarding data during transmission and storage.
The Rivest–Shamir–Adleman (RSA) algorithm, a cornerstone of public-key cryptography, leverages the computational difficulty of factoring large prime numbers. This intrinsic complexity forms the basis for its robust security, enabling secure key exchange and encrypted communication across diverse applications.
However, within the realm of IoT devices, limited processing power and resource constraints pose a significant challenge. Efficiently executing computationally intensive operations like modular exponentiation, crucial for utilizing RSA’s full potential, often proves difficult for these resource-constrained devices.
Cloud computing emerges as a viable solution, offering on-demand access to vast computational resources through a pay-per-use model. By outsourcing computationally demanding tasks like modular exponentiation to a third-party cloud server, even resource-scarce IoT devices can leverage the power of RSA for robust data security. This cost-effective approach ensures their uninterrupted participation in secure communication protocols without compromising performance or energy efficiency.
However, outsourcing sensitive data to a cloud service introduces a new layer of security considerations. Maintaining data integrity and confidentiality while utilizing cloud resources necessitates the implementation of robust security measures, such as a “secure outsourcing” of computation.
By effectively navigating the interactions between IoT devices and the cloud, we can leverage the combined strengths of both to achieve a future where secure and efficient communication becomes the cornerstone of a truly connected world.
1.1. Related Works
The exploration of outsourcing computationally expensive tasks has been a primary focus for researchers over an extended period. Broadly, research on outsourcing computation is progressing along two distinct trajectories.
One outsourcing model, proposed by [
1,
2], aims to evaluate any computational function and resolve all outsourcing computations concurrently. However, this model relies on complex cryptographic tools, rendering it time-consuming and costly.
In contrast, another model targets specific outsourcing tasks. For instance, refs. [
3,
4] proposed task-specific outsourcing for polynomial evaluation, while refs. [
5,
6,
7] focused on modular exponentiation. This model concentrates on particular computational tasks.
Modular exponentiation has consistently been at the forefront of cryptographic tools, primarily utilized for ensuring secure communication, key exchange protocols, message authentication, and more. Within cryptographic algorithms based on the discrete logarithm, modular exponentiation emerges as a complex and widely employed operation. Numerous studies have focused on securely outsourcing modular exponentiation. Hohenberger and Lysyanskaya [
5] introduced the pioneering solution under the assumption of one malicious entity in a two-server model. Chen et al. [
6] proposed a more efficient algorithm under the same assumption, including an initial algorithm targeting the outsourcing of simultaneous modular exponentiations. Ding et al. [
8] proposed an outsourcing algorithm aiming to achieve a high level of checkability of the cloud’s output. Zhou et al. [
9] presented a secure outsourcing algorithm for exponentiation under a single untrusted program model, incorporating a secure verification scheme with elevated checkability. However, Rangasamy and Kuppusamy [
10] identified a vulnerability in the ExpSOS algorithm, where its security could be compromised if two modular exponentiations with the same exponent were delegated to the server. Ren et al. [
11] proposed two algorithms for outsourcing modular exponentiation capable of detecting malicious behaviors of servers. Subsequently, Su et al. [
12] introduced two new algorithms for outsourcing single as well as composite modular exponentiation using a single untrusted cloud. Nevertheless, Bouillaguet et al. [
13] conducted a cryptanalysis on all existing outsourcing schemes (including Su et al. [
12]) and proposed lattice-based attacks to breach security in all the existing schemes of outsourcing modular exponentiation.
Additionally, research has explored outsourcing applications of modular exponentiation. For instance, Zhang et al. [
14] devised a secure outsourcing algorithm for RSA decryption, involving modular exponentiation. Furthermore, Hu et al. [
15] proposed a modification to the cloud computing phase of the ExpSOS algorithm [
9], employing Parallel Binary Modular Exponentiation (PBME) for cloud-side computation. Hu et al. [
15] also applied their algorithm to outsource the computation of modular exponentiation necessary for secure message communication between two users,
and
, using the RSA algorithm.
1.2. Our Contributions
In this work, we first take a critical view of the most well-known outsourcing protocol, Hu et al. [
15] outsourcing protocol for the RSA algorithm, and then address the security issues related to their outsourcing modular exponentiation algorithm. The work can be summarized as follows:
Overview: Provides a comprehensive overview of Hu et al.’s outsourcing protocol for the RSA algorithm [
15].
Flaws and Deficiencies: Identify the flaws and security deficiencies in Hu et al.’s protocol.
Proposed Solution: Introduces a novel solution to rectify these deficiencies, supported by an in-depth security and performance analysis.
Verification in Malicious Cloud: Incorporates the omitted verification steps in Hu et al. ’s protocol, considering a fully malicious cloud environment [
16].
We have assumed a security and system model similar to Hu et al. ([
15], Section II). These definitions are widely used and were proposed by Hohenberger and Lysyanskaya [
5].
2. Description of Hu et al. [15] Protocol
To start with, we investigate Hu et al. ’s outsourcing algorithm, which involves a resource-limited user
U delegating the task of computing modular exponentiation
to a trustworthy yet curious cloud
C, where
b is the base and the exponent
e and the modulus
with
p and
q being two distinct large primes.
The cloud computing approach suggested by Hu et al. [
15] relies on the Binary Modular Exponentiation (BME) algorithm, which represents the exponent
e in binary form. Algorithm 1 contains the pseudocode for the BME algorithm. In Algorithm 1, the base is taken as
, the exponent
is considered in binary form (i.e.,
or 1), and the modulus is chosen as
N. Algorithm 1, proposed by Hu et al., provides the result
for the inputs
,
and modulus
N.
Algorithm 1 The algorithm BME [15] |
Input: A base , the exponent in binary representation, the modulus N Output: // Initialize result to 1 for to 0 do // Loop through each bit of the exponent (reverse order) // Square the result and take modulo N if then //Multiply by base if is 1, and take modulo N end return // Return the final result
|
Subsequently, Hu et al. [
15] provided a parallel computing algorithm for cloud-side computation. This algorithm, Parallel Binary Modular Exponentiation (PBME), described in Algorithm 2, is a parallel computing algorithm extension of Algorithm 1 with each component of the output
computed parallelly.
As follows from Algorithm 2, for the exponent
, if
, then
takes the value
and squares it
i times, or else if
, then
takes the value 1. Here,
’s are the results of each parallel computation and collectively
Algorithm 2 The algorithm PBME [15] |
Input: A base , the binary representation of the exponent , the modulus N Output: for to do // Loop through each bit of the exponent if then // Check if the current bit is non-zero ; // Initialize with base for to i do // Square , i times ; // Square and take modulo N end for // End of inner loop else // If the current bit is zero ; // Set to 1 end if // End of if statement end for // End of outer loop return // Return the resulting array
|
Hu et al. introduced Algorithm 2 for achieving secure parallel outsourcing of modular exponentiation. This algorithm allows a user U to delegate the task of computing modular exponentiation of the base b, exponent e, and modulus N to an honest-but-curious cloud C to compute the result . The secure outsourcing of modular exponentiation is illustrated in Algorithm 3.
To provide an overview, Algorithm 3 entails the following steps:
User U generates a secret key to conceal the modulus N.
Encrypting the base b and exponent e as B and E, respectively.
Outsourcing the computation of modular exponentiation to the cloud C for the encrypted system.
Eventually, retrieving the original problem’s result from the encrypted result.
Algorithm 3 Hu et al.’s outsourcing model [15] |
Input: The base and exponent , the modulus N Output: The result Key Generation: U selects a large prime p at random and computes , then keeps the secret key and public key . Encryption: U selects random integers . U computes , . U outsources to the cloud. Computing Outsourcing: C computes Exponent E is presented in binary form, and each part is computed in parallel using Algorithm 2. C gets the product of all parts and returns the result to U. Decryption: U computes |
As RSA is an application of modular exponentiation, Hu et al. utilized Algorithm 3 to delegate the computation of the RSA cryptosystem for transmitting a plaintext T between two IoT devices, and , which have limited resources.
The parallel secure outsourcing protocol for the RSA algorithm developed by Hu et al. ([
15], Protcol 2) involves taking the
plaintext message T, which
wants to send to
, as input. To accomplish this,
generates a key-pair
for a modulus
, where
p and
q are two large primes such that
. Subsequently,
delegates the computation of the RSA encryption to a cloud server, receives the result from the cloud, and forwards the encrypted message, the decryption key
d, and modulus
n to
. The detailed procedure of the algorithm is outlined in Algorithm 4 (exactly as mentioned in ([
15], Protocol 2)).
In an overview, Algorithm 4 illustrates the following:
generates keys, i.e., a decryption key , secret key , and public key
encrypts the plaintext message T and exponent e as B and E, respectively.
outsources the computation of to cloud C.
forwards the decryption key along with encrypted result to .
retrieves the original message F by decrypting the ecnrypted result using decryption key
Algorithm 4 Hu et al.s outsourcing for RSA algorithm [15] |
Input: The plaintext message T Output: The plaintext message F Key Generation: End-user generates two large primes p and q and calculates , . chooses a random integer e as encryption key such that and . computes d as decryption key such that generates another large prime and computes , then gets the decryption key , secret key , and public key Encryption: U selects two random integers U computes and U outsource to the cloud. Computing Outsourcing: Cloud C computes . Exponent E is presented in a binary way, each part computed in parallel. C gets the product of all parts and sends the result to . Message Forwarding: Decryption: |
2.1. Drawbacks
Our analysis of Algorithms 3 and 4 reveals several security and usability drawbacks.
2.1.1. Algorithm 3
This algorithm closely resembles the ExpSOS algorithm by Zhou et al. [
9], differing only in cloud computation methods. However, Rangasamy and Kuppusamy [
10] presented a polynomial-time attack on ExpSOS that recovers the modulus
N when two modular exponentiations with the same exponent are delegated. This attack applies here as well, allowing any probabilistic polynomial-time (PPT) adversary to retrieve
N.
2.1.2. Algorithm 4
Several errors exist in Hu et al.’s RSA implementation:
Misinterpretation of RSA for message communication:
- –
The algorithm misinterprets the intended use of RSA for secure message communication.
Incorrect outsourcing protocol:
- –
The RSA outsourcing protocol is presented incorrectly. When using RSA for message transfer from sender to receiver , (not ) generates the key pair and modulus (p and q are large primes).
Public key misuse:
- –
The public key allows any user, including , to send an encrypted message to , who then uses the private key d for decryption. However, the algorithm claims generates , requiring them to create a new key pair for each message, rendering it impractical and inefficient.
Insecure key transmission:
- –
transmits the key pair (secret key) along with the encrypted message through an insecure channel. This exposes the original message T to potential adversaries on the channel.
Computationally infeasible encryption:
- –
In the Encryption phase, computes . However, if the RSA algorithm is to be correctly followed, lacks access to , and computing it for any given N is infeasible for a resource-constrained user.
Note 1. Deviations from Secure RSA Communication:
We highlight two key issues with Algorithm 4 alongside the drawbacks mentioned above regarding its adherence to the secure RSA message communication scheme:
1. Incorrect Key Distribution: Algorithm 4 assumes user has access to both the public key and the private key d. In RSA, only the receiver ( in this case) holds the private key, while the public key is widely distributed. Allowing access to d contradicts this fundamental principle and compromises message security.
2.
Inconsistent Plaintext Usage: The algorithm exhibits inconsistencies in its usage of the plaintext message T. Initially, T is correctly identified as the user’s plaintext. However, two errors emerge in subsequent stages:
Stage 4 of Key Generation utilizes the secret modulus L as , a meaningless expression as T is considered as plaintext, which further deviates from expected operations.
The Encryption phase employs b instead of T as the plaintext, further adding to the confusion and potentially leading to incorrect operations.
These inconsistencies, combined with the incorrect key distribution, render Algorithm 4 unsuitable for secure message communication and highlight the need for careful adherence to standard cryptographic protocols.
3. Reproducing Hu et al.’s Protocol for RSA
Considering the misinterpretation and typing mistakes in ([
15], Section VI, Protocol 2), we reproduce the protocol for secure message communication using the RSA algorithm while considering the following points:
In the scenario of secret message communication between two end-users and , if wants to send a plaintext T securely to , should use the public key generated by .
generates the key pair for a given modulus only once for the entire session of message transfer as e and N are made public for any user to send a message. Thus, the values of e, d, and N are fixed.
In practice, during message transfer, the value
e is chosen to be a very small integer compared to the security parameter, whereas the size of
d is almost as large as the modulus
N. Thus, RSA encryption is computationally less challenging for a user than RSA decryption. As Vergnaud [
17] mentioned, the encryption key is often a small key of a 16-bit integer, and
e can take values up to
.
First, we reproduce Hu et al.’s protocol for secure message communication using the RSA algorithm, where outsourcing the RSA decryption computation is performed with the help of an honest-but-curious cloud server C.
Note 2. We noticed that the outsourcing algorithm proposed by Hu et al. [15] assumes the cloud to be an honest-but-curious model. Therefore, the Verification step is missing in both the algorithms (Algorithms 3 and 4).
Algorithm 5 sketches the Hu et al. algorithm properly in terms of how it is supposed to be with proper interpretation of RSA communication and without any typographical errors.
Algorithm 5 Reproduced Hu et al. [15] outsourcing for RSA decryption |
Input: The plaintext T to be sent by Output: The plaintext T to be received by Key Generation: generates two large primes p and q () and computes and . keeps p and q as secret. chooses a random integer e as public encryption key such that and . computes d as private decryption key such that makes the pair public, and keep d as secret. Encryption: generates a large prime and computes where secret key , and public key . encrypt the plaintext T to . Message Forwarding: Secure Outsourcing: selects two random integers computes and outsource to the cloud. Computing Outsourcing: Cloud C computes . C sends the result to . Decryption: |
Now, we present an attack on this reproduced Algorithm 5 of Hu et al. and claim that an adversarial cloud can learn the value (and hence the prime factors of N) while remaining an honest party.
3.1. Attack against Algorithm 5
In this section, we present an attack on the reproduced Hu et al. outsourcing protocol for secure message communication using the RSA algorithm. Our attack is based on multiple delegations and is similar to the attack by Rangasamy and Kuppusamy [
10] on the Zhou et al. [
9] protocol. We take into consideration the fact that both end-users,
and
, have limited resources. For
, the values of
, and
N are fixed because
is the public key that can be used by anyone to send a secret message to
, which also means that the value of
d remains the same throughout the communication. (
d is the modular inverse of
e modulo
, which is unique. Since
is fixed, so is
d).
Now, we consider the user
communicating two encrypted texts (
encrypted to
and
encrypted to
using the public exponent
e and the modulus
and
) to
. Upon
Decryption,
selects random integers
and computes
and outsources
and
to the cloud.
An adversarial cloud
performs the operation
to obtain a multiple of
. Given an RSA modulus
and a multiple of its Euler’s totient function
, Rabin’s PPT algorithm (Rabin et al. [
18]) produces the factorization
in anticipated polynomial time
.
3.2. The Fix for Algorithm 5 against Our Attack
Here, we propose a modification to the outsourcing model proposed by Hu et al. [
15] for secure message communication using the RSA algorithm. To address the security issues in Algorithm 5, we introduce our fix to Algorithm 5 with proper interpretation of RSA communication.
Additionally, we consider a scenario where an end-user needs to send a secure message to another user with the help of an untrustworthy fully malicious cloud/server. Thus, we introduce the verification step that has been missing in Algorithms 4 and 5. We begin by considering the scenario where the end users and are resource-constrained. User wants to send the message T to .
3.2.1. Correctness of Algorithm 6
We demonstrate the validity of our solution for Hu et al.’s outsourcing model concerning the RSA algorithm. This clarification confirms that our algorithm adheres to the RSA communication assumptions and indeed provides accurate results when outsourced.
computes for some random large prime and makes public and keeps d, and N as secret, where .
computes and sends it to .
computes and and (i.e., for some integer k).
sends and to the cloud C.
C computes and
This shows the correctness of our algorithm.
Algorithm 6 Our fix for Hu et al.’s Outsourcing Model for RSA algorithm |
Input: The plaintext T to be sent by Output: The plaintext T to be received by Key Generation: generates two large primes p and q () and computes and . keeps p and q as secret. chooses a random integer e as public encryption key such that and . computes d as private decryption key such that computes where is a large prime. makes the pair public, and keep d as secret. Encryption: Message Forwarding: Secure Outsourcing: selects a random integer . computes generates for some fixed integer t and . outsource the tuples and to the cloud. Computing Outsourcing: , Cloud C computes and . C sends the result and to . Verification:
Upon receiving and from cloud C, checks whether the results satisfy
Decryption: If the results and passes the verification step, proceeds for the decryption. calculates to get the plaintext T.
|
3.2.2. Security Analysis of Algorithm 6
We discuss the security of our proposed fix as outlined in Algorithm 6. We begin by listing the entities that are made public and can be accessed either by other users or the cloud.
The public exponent e and public modulus L are shared by publicly, where .
It is assumed that the cloud knows all the abovementioned entities.
As evident from Algorithm 6, the equation representing the decryption process is given by:
where
D and
R have specific relations with
and
t, respectively.
The equation implies the existence of an integer such that the sum of D and R equals the sum of d and multiplied by Euler’s totient function of N ().
If the cloud C has access to the value of , it can compute the secret key of and breach its security.
However, our previously described attack in
Section 3.1 will not work since
D remains unchanged for multiple delegations (ref. Note 1).
Instead, we now discuss a potential passive attack that can be used to compute the value of .
We follow the attack for exponent splitting as proposed by Mefenza and Vergnaud ([
19], Section 3). Using the values
e,
D, and
R, we obtain:
Thus, the polynomial has a root modulo where . However, the value is not made public by and guessing the value N has probability .
Another possible way to approach the attack is to take the polynomial
that has a root
modulo
(ref. Mefenza and Vergnaud [
19]). Here,
has the size
. Considering the sizes of
,
,
,
, and
(
) and following the lattice-based attack of Mefenza and Vergnaud [
19], we evaluate the condition for the existence of a solution to the equation
as:
where
is the lattice of dimension
w that is generated using the polynomial
. However, since now
, we obtain the condition for having a solution to
as:
which simplifies to:
Maximizing the value of
by taking
, the inequality transforms to:
This indicates that this attack is only possible when
. Since
are chosen to be positive numbers in our scheme, this attack will fail. This demonstrates that our scheme defeats the attack proposed by Mefenza and Vergnaud [
19], and the value
cannot be computed by any curious cloud.
The public modulus is given as , where both and are kept secret by the user . Thus, for two consecutive instances, the adversary will have and , and with high probability . Thus, to avoid such a scenario, can fix the public modulus as for some fixed large prime .
Note 3. The computation of must be performed by the user [20]. There exist various methods to efficiently compute . For example, the binary representation of is of bit-length . Therefore, the value (and subsequently ) can be readily delegated to the cloud in its binary form. Cloud can execute the delegated task in a parallel environment using Algorithm 2. However, the computation of might raise concerns for a resource-constrained device like , as necessitates modular operations. To alleviate the computation burden on , can be chosen as an integer with a smaller bit-size (e.g., a 20-bit integer). Furthermore, the value is computed only once for multiple delegations. It is permissible to select as a random 20-bit integer for each delegation, although this may impact the algorithm’s efficiency.
3.3. Verification Analysis of Algorithm 6
In our scheme, user
receives
and
from the cloud and verifies their correctness using the equation:
since
already received
from
. While
Section 3.2.1 ensures this equation validates accurate results, we now explore its robustness against a malicious cloud attempting to bypass verification.
We consider a scenario where the cloud sends forged results
and
, which still satisfy the verification equation:
This implies
for some integer
. However, due to the modular operation with modulus
, the verification still yields the correct result
:
This demonstrates the inherent robustness of our verification scheme, even against manipulation attempts. The resemblance of our verification scheme to RSA signature authentication further strengthens its security foundation.
4. Performance Analysis
In this section, we detail the experimental application of our proposed algorithm. Our algorithm is coded in Python (version 3.9.12) within the Jupyter Notebook environment, utilizing the NumPy package for computational tasks. The computational operations on the users’ side and are executed on a system equipped with an Intel(R) Core(TM) i7-3770 processor running at 3.40 GHz with 8 GB RAM. On the cloud side, we leverage a GPU server labeled Tesla V100-PCIE, equipped with NVIDIA-SMI and CUDA version , 32 GB RAM.
For clarity and research focus, communication time between the cloud server and the local device is excluded from the results. Two reasons justify this:
Computational Dominance: Computational tasks significantly outweigh communication in terms of time expenditure.
Prediction Challenges: Accurately predicting communication time is difficult due to experimental setup limitations and research objectives.
We conduct experiments by executing the scheme across various moduli, ranging from 1024 to 4096 bits, with the base as the “plaintext” and exponent (e) set to (a commonly used public key for RSA). To ensure more accurate computational time measurements, we carried out 20 trials for modulus size with specific bit size and subsequently computed their average.
Note 4. As the Hu et al. scheme is proven insecure and impossible to follow, we have not shown the comparison analysis with Hu et al.’s scheme. Additionally, Hu et al.’s protocol assumed the cloud server to be honest-but-curious and hence avoided the verification step. We have assumed the cloud to be untrustworthy and proposed a new verification scheme. Therefore, we have skipped the comparison of performance with Hu et al.s protocol. Instead, we provide evidence that our outsourcing scheme is more efficient in executing RSA communication in comparison to local execution.
Following Algorithm 6, we begin our experimental setup from the end-user
.
generates the key pairs, i.e., private key (
) and public key (
). The experimental setup considers four different bit sizes (1024, 2048, 3072, and 4096 b) for the modulus size. We list out the computation times for the
Key Generation (
Table 1).
Using the public key (
), user
encrypts the plaintext
to
. For experimental purposes,
is always taken as a 1000-bit number (randomly generated) for all different modulus sizes. The computation times for user
are listed below
Table 2.
Upon receipt of the transmitted ciphertext , user chooses to securely delegate the decryption of to an untrustworthy cloud. We document the computational time for in the phases of Secure Outsourcing, Verification, and Decryption. Additionally, we record the computation time for for the same input when the decryption of ciphertext is conducted locally. Time units are measured in seconds.
As shown in
Table 3, our secure outsourcing scheme demonstrates efficient performance, accelerating the decryption process as the modulus size increases compared to local execution. For instance,
requires only
s to securely outsource the decryption task for a 3072-bit modulus, whereas executing the decryption task itself takes
s. This observation serves as evidence bolstering the efficiency of our algorithm. The acceleration in processing speed is evident from the “Speed Up” column in
Table 3, demonstrating the performance enhancement achieved through our algorithm.
In local execution, the decryption process occurs entirely within ’s system, without relying on the outsourcing services. This eliminates the need for to engage in cloud-based encryption, verification, and decryption steps. Instead, solely utilizes its computational resources to retrieve the message originally sent by .
Figure 1 illustrates the graphical comparison between the ‘Total Time’ required for outsourcing and the time needed for decryption when executed ‘locally’. The data utilized for this comparison are sourced from
Table 3 (columns ‘Total Time’ and ‘Locally Executed’) and visualized in
Figure 1.
5. Conclusions and Future Scope
The RSA cryptosystem is a widely recognized and extensively employed cryptographic algorithm for secure data transmission. We conducted a comprehensive investigation of Hu et al.’s outsourcing algorithm for modular exponentiation and its usage in a message communication application using the RSA algorithm. Our analysis demonstrated the inadequacy and insecurity of Hu et al.’s algorithm. Moreover, we proposed a new modified algorithm for outsourcing RSA computations and provided a detailed security analysis of it. Additionally, we have also included the verification step that was missing in Hu et al.’s algorithm as we chose an untrustworthy malicious cloud.
While our work focused on secure message transmission through an insecure channel, future studies could explore real-life scenarios where encrypted messages are transmitted through noisy channels. Such channels introduce the risk of errors during transmission, necessitating additional measures like bit error correction. This area presents promising avenues for further research to ensure robust communication even in challenging environments.