Highlighted Cipher Use Cases
Highlighted Cipher Use Cases
7
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
XOR F K0
Symmetric Asymmetric
L1 R1
DES 1977
3DES 1998 RC4 1994 RSA 1977
Blowfish 1993 A5/1 1987 DSA 1991
Twofish 1999 A5/2 1989 Diffie-Hellman 1976
RC2 1987 Pike 1994 El-Gamal 1985
Wake 1993 Ln Rn
RC5 1994 Elliptic curve 1985
RC6 1998 Sober 1997
AES 2001 XOR F Kn
8
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
4.3 BLOWFISH
Blowfish was designed in 1993 by Bruce Schneier as a fast, XOR P18 P17 XOR
free patent alternative to existing encryption algorithms at that
time. Blowfish provides a good encryption rate and no L17 R17
cryptanalysis of it has been recorded to date. The algorithm
consists of two parts: a key-expansion part and a data-
encryption part. Blowfish uses a large number of subkeys Cipher Text
which are constructed during the Key expansion phase. This
phase converts a variable-length key of at most 56 bytes (448 Figure 4: Blowfish Algorithm
bits) into an array of sub-keys called P-array consists of Blowfish algorithm is as follows:
eighteen 32-bit sub-keys totaling 4168 bytes. There are also
four 32-bit S-boxes. The keys must be computed before any 1. The 64-bit plain text is split into two halves L0 and
data encryption or decryption [6]. The creation of sub-keys R0.
further increases security, because a hacker would have to 2. For each round i = 1, 2, …, 16
crack more than just the original key.
a. The left half L is XORed with the ith sub key
The second part of the Blowfish routine that is a data L i = L i ⊕ Pi
encryption is done through 16 Fiestel network rounds, a swap
operation and two exclusive-or operations. The F function b. The XOR of F(Ri, Ki) and the left half L is
takes the 32-bit input and divides it into 4 bytes (8-bits each). computed yielding Ri = F(Li)⊕ Ri
These four values are then used for table lookup in their
corresponding S-Boxes. A graphic representation of Blowfish c. The two sides are swapped to set the R and L
is given in Figure 4. for the next round, that is Li+1 = Ri and Ri+1 =
Li ⊕ F(Ri, Ki)
3. Swapp R16 and L16 again to undo the last swap.
4. R17 = R17 ⊕ P17, L17 = L17 ⊕ P18
5. L and R are recombined to construct the cipher text.
9
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
The F function looks like this: Divide L into four eight-bit bit.
quarters: a, b, c, and d. Then, F(L) = (((((S + S2) mod 232)
XOR S3) + S4) mod 232). One MASHING round is defined as follows, for each i = 0, 1,
2, and 3:
The complexity of the Blowfish key generating process made
it a considerable robust block cipher algorithm [7]. R[i] = R[i] + K[ R[i − 1] & 63 ];
The entire encryption operation with RC2 can now be
4.4 TWOFISH described as follows [8]:
Twofish is a symmetric block cipher with block size of 128
bits, and accepts a key of any length up to 256 bits. Twofish is 1. Initialize words R[0], ..., R[3] to contain the 64-bit
fast on both 32-bit and 8-bit CPUs. It can be used in network plaintext block.
applications where keys are changed frequently and where 2. Expand the key, so that words K[0], ..., K[63]
little or no RAM and ROM available. Twofish is a Feistel become defined.
network [8]. This means that in each round, half of the text
block is sent through an F function, and then XORed with the 3. Initialize j to zero.
other half of the text block.
4. Perform five MIXING rounds.
In each round of Twofish, two 32-bit words serve as input into
the F function. Each word is broken up into four bytes. Those 5. Perform one MASHING round.
four bytes are sent through four different key-dependent S- 6. Perform six MIXING rounds.
boxes. The four output bytes (the S-boxes have 8-bit input and
output) are combined using a Maximum Distance Separable 7. Perform one MASHING round.
(MDS) matrix and combined into a 32-bit word. Then the two 8. Perform five MIXING rounds.
32-bit words are combined using a Pseudo-Hadamard
Transform (PHT), added to two round subkeys, then XORed 9. The ciphertext is R[0], ..., R[3].
with the right half of the text. There are also two 1-bit
Although no design weaknesses have been identified in RC2
rotations going on, one before and one after the XOR.
which could lead to practical cryptanalytic attacks, it is
Twofish also has something called "Prewhitening" and
considered to be a slow cipher.
"Postwhitening;" additional subkeys are XORed into the text
block both before the first round and after the last round. 4.6 RC5
RC5 is a 32/64/128-bit block cipher developed in 1994. It was
4.5 RC2 designed also by Ronald Rivest in December of 1994. It is a
RC2 is a 64-bit block cipher with variable key size designed
symmetric block cipher having a variable number of rounds,
by Ron Rivest in 1987. "RC" stands for "Ron's Code" or
word size and a secret key.
"Rivest Cipher". The plaintext is divided into four words each
of 16 bits. There is a key expansion process before the As in RC2 there is a key-expansion routine that expands the
encryption or decryption take place. The key expansion user's key K to fill an expanded key array S. It is assumed that
process takes a user key between 1 and 128 bytes in length the input block is given in two w-bit registers A and B, and
together with a parameter that specifies the effective key- that key-expansion has already been performed, so that the
length of encryption, then an array K of 64 sub keys is derived array S[0...t - 1] has been computed. Here is the encryption
(16-bit each). Then encryption is done through two kinds of algorithm in pseudo-code [9]:
rounds. One is termed a MIXING round and the other a
MASHING round. There are in total 16 mixing rounds and 1. A = A + S[0];
two mashing rounds. In each round each of the four words in 2. B = B + S[1];
the intermediate cipher texts is updated as a function of the
other words. Each of the mixing rounds takes a 16-bit subkey. 3. For i = l to r do
An array of four 16-bit words R[0], ..., R[3] is used to hold the a. A = ((A | B) <<< B) + S[2 * i];
initial plaintext, the intermediate results, and the final cipher b. B = ((B | A) <<< A) + S[2 * i +1];
text.
The output is in the registers A and B.
One MIXING round is defined as follows, for each i = 0, 1, 2,
and 3: It is a simple algorithm which has a low memory requirement.
It is fast and yet secure if suitable parameters are chosen.
1. R[i] = R[i] + K[j] + (R[i − 1] & R[i − 2]) + (∼R[i −
1] & R[i − 3]); 4.7 RC6
Where & denotes bitwise logical and, ⊕ denotes bitwise It was one of the AES finalist developed also by Ronald
XOR and ∼ denotes bitwise complementation. All 16-bit Rivest in 1997. It uses 128 bit block size and supports key
word addition + is performed modulo 216. sizes of 128, 192 and 256 bits. It is an improvement of the
RC5 Algorithm and provides even better security. It makes
2. j = j + 1; use of 4 registers (Each one of 32 bit). It uses fewer rounds
and offers a higher throughput. The following is the
Here j is a “global” variable so that K[j] is always the first key
encryption algorithm in pseudo-code, where S is the array of
word in the expanded key which has not yet been used in a
keys generated by the key expansion routine:
MIXING operation.
3. R[i] = R[i] <<< s[i];
where s[0] = 1, s[1] = 2, s[2] = 3, and s[3] = 5. And
R[i] <<< s[i] denote that R[i] is rotated left by s[i]
10
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
11
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
5.4 Memory Utilization Blowfish, Twofish, RC2, RC5, RC6, and AES. Each
Memory utilization or memory usage is another important algorithm aims to introduce extra level of security and to
parameter that should be taken into consideration. The cost of satisfy performance requirements more than earlier proposed
memory often exceeds the cost of CPU. As a result the algorithms solution. This extra security level should balance
efficient utilization of memory has received much attention between a robust algorithm structure and a reasonable
when designing an algorithm. The memory requirement complexity computation. This work provides a detailed
depends on the key size, initialization vectors, and type of review of the structure of the mentioned algorithms along
operations. Table 4 and Table 5 give memory utilization for with a performance evaluation comparison that highlights the
encryption and decryption processes for each algorithm, strengths and limitations of each algorithm. From the tabular
respectively, while Figure 9 and Figure 10 graphically comparison, some key points can be concluded. First, the
interprets such values. Twofish and Blowfish algorithms outperform the others
followed by RC6 and AES, while 3DES and RC2 come at the
6. CONCLUSION tail of the list. Second, when it comes to memory usage, there
Data security and privacy have been always the main concern is no significant difference between most of the algorithms
about cloud computing services. Cryptography is a main trend except for 3DES which swept over almost three times of the
to achieve data security and privacy. Since the introduction of memory needed for the other algorithms. Third, while AES is
cloud computing technology, several cryptography solutions considered one of the most secure algorithms and no attacks
have been proposed for protecting outsourced data and user have been reported against it, Twofish and Blowfish are
privacy and for insuring that data are not being leaked to considered the fastest schemes for both encryption and
unauthorized third party. Most of these solution schemes aim decryption.The main goal of any encryption algorithm is
at achieving a tradeoff between security and functionality. security. However, other performance metrics may determine
This paper represents a comprehensive study of the major the preference use of one algorithm over another. In this
symmetric key block cipher algorithms, namely, DES, 3DES, section,
Table 1. Comparision of Stmmetric Algothims Structure
12
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
13
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
14
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
7. REFERENCES [4] privacy." Scientific American, vol. 228, no. 5, pp. 15-2,
[1] NIST SP 800-145, “A NIST definition of cloud 1973.
computing”, [5] FIPS PUB 46-3, “Data encryption standared (DES),”
https://csrc.nist.gov/publications/detail/sp/800-145/final, National Bureau of Standards, U.S. Department of
September 2011. Commerce, January 1977.
[2] W. Stalling, “Cryptography and network security [6] D. Coppersmith · D. B. Johnson · S. M. Matyas, “A
principles and practices,” Fourth Edition, Prentice Hall, proposed mode for triple-DES encryption,” IBM Journal
December 2006. of Research and Development, April 1996.
[3] H. Feistel, "Cryptography and computer
15
International Journal of Computer Applications (0975 – 8887)
Volume 182 – No. 48, April 2019
[7] B. Schneier, "The Blowfish Encryption Algorithm," Dr. (RSA, DES, 3DES and AES) for information security,”
Dobb's Journal , v.19, n. 4, pp. 38-40, April 1994. International Journal of Computer Applications, vol. 67,
no. 19, pp. 33-38, April 2013.
[8] B. Schneier, "Description of a New Variable-Length
Key, 64-bit Block Cipher (Blowfish)," Fast Software [14] M. Faheem Mushtaq, S. Jamel, A. Disina, Z. Pindar, N.
Encryption: Second International Workshop, Leuven, Shafinaz A. Shakir, M. Deris, " A Survey on the
Belgium, Proceedings, Springer-Verlag, pp.191-204, Cryptographic Encryption Algorithms", International
December 1994. Journal of Advanced Computer Science and
Applications, vol. 8, no. 11, 2017.
[9] L. Knudsen, V. Rijmen, R. Rivest, and M. Robshaw, "On
the Design and Security of RC2", Fast Software [15] J. Daemen and V. Rijmen, "AES Proposal: Rijndael,"
Encryption, 5th International Workshop, FSE '98, Paris, AES algorithm submission, September 1999.
France, March 23-25, 1998.
[16] M. Ebrahim, S. Khan, U. Khalid, “Symmetric algorthm
[10] R. Rivest, " The RC5 encryption algorithm", survey: A comparative analysis”. International Journal of
International Workshop on Fast Software Encryption, pp Computer Applications, vol. 61, no. 20, pp. 12-19,
86-96, 1994. January 2013.
[11] B. Schneier, J. Kelsey, D. Whiting, D. Wagner, C. Hall, [17] B. Schneier and D. Whiting, “A performance comparison
and N. Ferguson. “Twofish: A 128-bit block cipher.” In of the five AES finalists.” Proceedings of the Third AES
AES Round 1 Technical Evaluation CD-1: Candidate Conference, pp. 123-135, April 2000.
Documentation. National Institute of Standards and
Technology NIST, August 1998. See http://www. [18] Z. Hercigonja and D. gimnazija, “Comparative analysis
nist.gov/aes of cryptographic algorithms.” International Journal of
Digital Technology & Economy, vol.1, no. 2, 2016.
[12] A. Mandal, C, Parakash and A. Tiwari, “Performance
evaluation of cryptographic algorithms: DES and AES”, [19] D. Abdul Elminaam et al., "Performance Evaluation of
IEEE Students’ Conference on Electrical, Electronics Symmetric Encryption Algorithms", International
and Computer Science, pp. 1-5, 2012. Journal of Computer Science and Network Security,
vol.8 no.12, December 2008.
[13] G. Singh and Supriya, “A study of encryption algorithms
IJCATM : www.ijcaonline.org 16