Arab J Sci Eng
DOI 10.1007/s13369-017-2797-3
RESEARCH ARTICLE - COMPUTER ENGINEERING AND COMPUTER SCIENCE
A Fast Parallel Modular Exponentiation Algorithm
Khaled A. Fathy
1
· Hazem M. Bahig
2,3
· A. A. Ragab
1
Received: 20 December 2016 / Accepted: 6 August 2017
© King Fahd University of Petroleum & Minerals 2017
Abstract Modular exponentiation is a fundamental and
most time-consuming operation in several public-key cryp-
tosystems such as the RSA cryptosystem. In this paper, we
propose two new parallel algorithms. The first one is a fast
parallel algorithm to multiply n numbers of a large number of
bits. Then we use it to design a fast parallel algorithm for the
modular exponentiation. We implement the parallel modular
exponentiation algorithm on Google cloud system using a
machine with 32 processors. We measured the performance
of the proposed algorithm on data size from 2
12
to 2
20
bits.
The results show that our work has a fast running time and
more scalable than previous works.
Keywords Binary method · Modular exponentiation ·
Multiplication algorithm · Parallel algorithm · Scalability
1 Introduction
Modular exponentiation is one of the key computations per-
formed in many public-key cryptosystems such as RSA [1].
In this type of cryptosystem, the encryption and decryption
processes depend on the modular exponentiation operation.
The description of the encryption and decryption processes
is as follows. Given M as a plain text, E as a public key,
D as a private key and N as a modulus, the cipher text is
B Hazem M. Bahig
hazem.m.bahig@gmail.com; hbahig@sci.asu.edu.eg
1
Department of Mathematics, Faculty of Science,
Al-Azhar University, Cairo, Egypt
2
Computer Science Division, Department of Mathematics,
Faculty of Science, Ain Shams University, Cairo, Egypt
3
Computer Science and Engineering College, Hail University,
Hail, Kingdom of Saudi Arabia
computed as C = M
E
mod N in the encryption phase. The
plain text is computed as M = C
D
mod N in the decryption
phase. In cryptography, the value of E is large and therefore,
the modular exponentiation is composed of a large number
of modular multiplications. So, the, modular exponentiation
is a time-consuming operation.
There are two types of the modular exponentiation, single
modular exponentiation [2–10] and multi-modular exponen-
tiations [11, 12]. In this paper, we will be interested in the
single modular exponentiation.
Many methods were presented to compute the modular
exponentiation such as the binary method, m-ary method
[4, 7], residue number conversion method [9], signed digits
recoding method [4–6], the sliding windows method [4, 8]
and hybrid method (combination of two or more meth-
ods such as the Montgomery modular reduction method,
common-multiplicand-multiplication method and minimal-
signed-digit exponent recoding method) [2, 3, 10].
Parallel computations play an important strategy to inc-
rease the efficiency of the modular exponentiation operation.
Several parallel solutions for the computation of the modular
exponentiation were introducing using hardware and soft-
ware. Examples of recent parallel architectures for parallel
modular exponentiation are in [13–15]. In this paper, we will
focus only on the parallel modular exponentiation algorithms
that are designed to run on a real parallel machine.
Nedjah and Mourelle [16, 17] introduced parallel modu-
lar exponentiation algorithms based on the sliding window
method. Wu et al. [10] presented a technique for the paral-
lel computation of the modular exponentiation depending on
the Montgomery multiplication algorithm. Chia-Long et al.
[18] presented a parallel exponentiation algorithm based on
dividing the binary representation of E into many parts. Chia-
Long [19] proposed a new hybrid parallel algorithm for the
modular exponentiation. The algorithm is based on different
123