Parallel Algorithm by Rc4
Parallel Algorithm by Rc4
information security
(Rc4 Algorithm)
BY
Majed Ismael
Overview
RC4 is the most common algorithm and is used in popular protocols like
secure socket layer (SSL) to protect web browsing and in WEP to protect the
wireless networks (Schneier, 2008). Other application areas of RC4 are
Skype and Bit Torrent protocol system. RC4 generates key stream that is
random stream of bits. The key stream is combined with the plaintext using
bit-wise XOR to generate the encrypted text. The algorithm has two main
parts: the key scheduling algorithm (KSA) and the pseudo random
generation algorithm (PRGA).
The KSA is used to initialize the permutations in the ‘S’ array. The "key length" is the
number of bytes in the key and the range of “key length” is from 1 to 256.
S[i]:= i
End loop
Set j: = 0
End loop
i := (i + 1) mod 256
Output
End loop
2008)
Type of Parallel Computer
• A serial computer
• Single Instruction: one instruction stream is being executed by the CPU during
one clock cycle.
• Single Data: one data stream is being used as input data during one clock
cycle.
• Examples: mainframes, minicomputers and workstations.
• Single Data: data in the form of sequence of bits/bytes is being used as input
data during one clock cycle.
• Multiple Data: Every core will work with a different data stream
• Currently, the most common type of parallel computer falls in this category is
Supercomputers.
shared memory
Bus Interface
In this framework, a key is supplied to the key stream generator which will produce
random key stream. The plaintext is in the form of fixed sized blocks. The random
key stream is supplied to each individual block to process plaintext concurrently. The
following figure illustrates the complete process used in this framework.
6. End for
7. End
Table 1: Time (In Seconds) taken by RC4 to encrypt/decrypt large data files by uniprocessor
Table 4: Time (In Seconds) taken by PARC4 to encrypt/decrypt large data files using
6 cores
Size of input Encryption Decryption Overall Time
data [In GB ]
0.1 0.25999 0.25995 0.51994
0.2 0.499937 0.499933 0.99987
0.3 0.769528 0.76952 1.53905
0.4 1.04601 1.04597 2.09198
0.5 1.28548 1.28547 2.57095
0.6 1.537027 1.537023 3.07405
0.7 1.844995 1.844955 3.68995
0.8 2.14746 2.14726 4.29472
0.9 2.33866 2.3386 4.67726
1.0 2.574919 2.574911 5.14983
Table 5 Time taken by PARC4-I to encrypt/decrypt large data files using 8 cores
A serial algorithm is typically assessed in terms of its execution time which is stated as
a function of its input size. In contrast, the execution time of a parallel algorithm is
determined by the input size as well as the parallel structural design and the number of
processing elements employed. With this, the speedup is well-defined as the ratio of
the time taken to solve a problem using a single processing element to the time
required to execute the same problem using a parallel computer with p identical
processing cores. From the Tables 1 to 5, it can be observed
that PARC4 results in speedup corresponding to the number of cores being used for
experiments. Fig. 4 shows the speedup comparison for ~1GB of data file by using
PARC4 on multiple cores.