# Utilizing Trusted Lightweight Ciphers To Support Electronic-Commerce Transaction Cryptography
## 5 Security and Performance of Proposed E-Commerce Applications
### Performance of Proposed E-Commerce Applications  
To test the eligibility of the proposed protocol, this section illustrates the performance results of the algorithms and techniques used in our protocol. Our codes were implemented on a laptop with Intel @ Core TM i5-2540M CPU @ 2.60 GHz, RAM 4 GB, operating system Ubuntu 18.04.6 LTS and OS type 64 bit. In addition, we used Java language to deal with the ElGamal, AES and CRT algorithms. Our protocol relied on ElGamal public and private keys of 1024 bit length, the AES algorithm of 256 bit keys to encrypt e-commerce requests and the CRT approach to generate fast 256 bit private keys.  
At first, we implemented the encryption and decryption procedures without e-commerce requests to find the execution/running time one hundred times, as shown in Figure 11. The previous figure shows that the encryption operations in the AES-256 algorithm require more execution time than the decryption operations. Our proposed protocol uses real e-commerce files (see Figure 8) with various sizes such as an invoice file with 1.6 KB, purchasing file with 3.9 KB and selling file with 2.9 KB. Next, we performed AES-256 encryption operations on e-commerce requests (invoice, purchasing and selling) to find the execution time, as shown in Figure 12. From the aforementioned figure, purchasing request encryption requires the most execution time, and the reason for this is that the size of the  
Figure 10: Scyther security tool test of proposed e-commerce protocol.  
purchasing files is larger (3.9 KB) than the invoice and selling files. In addition, Figure 13 shows the implementation of AES-256 decryption operations for invoice, purchasing and selling requests, where we note that invoice files require less execution time than the rest of the files because the invoice file size is 1.6 KB, which is the smallest among the rest of the files. Figures 12 and 13 show that the encryption procedures require more execution time than the decryption procedures. Furthermore, Figure 14 shows the execution time of the public and private keys of the ElGamal-1024 algorithm as well as the use of a CRT to generate the private keys. As we can see from the previous figure, the private keys need less execution time than the public keys of the ElGamal algorithm, and the CRT approach generates the private keys faster than the private keys of the ElGamal algorithm. In addition, Table 4 provides an execution time comparison of the private keys for both traditional ElGamal and ElGamal-CRT. We can see from the previous figure that ElGamal-CRT achieves less execution time than traditional ElGamal. Table 5 shows a comparison of memory consumption between public key algorithms such as traditional ElGamal, RSA and ElGamal-CRT. The table shows that the ElGamal-CRT algorithm uses less memory than RSA and traditional ElGamal. Finally, the total running time for encryption with XOR operation and keys division is 0.369143 ms, and the total running time for decryption is 0.274815 ms.  
Figure 14: Running time for ElGamal keys (public, private and CRT with private key).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Key Length** & **ElGamal Private Key in ms** & **ElGamal-CRT-Private in ms** \\ \hline
1024 & 0.0181114 & 0.0021469 \\
2048 & 0.0362228 & 0.0042938 \\
3072 & 0.0543342 & 0.0064407 \\
4096 & 0.0724456 & 0.0085876 \\
7680 & 0.1358355 & 0.01610175 \\
15,360 & 0.271671 & 0.0322035 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Key generation comparison of traditional ElGamal and ElGamal-CRT.  
Figure 13: Running time for AES-256 file decryption (invoice, purchasing and selling).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Traditional ElGamal (bits)** & **RSA (bits)** & **Proposed ElGamal-CRT (bits)** \\ \hline
1024 & 1024 & 256 \\
2048 & 2048 & 512 \\
3072 & 3072 & 768 \\
4096 & 4096 & 1024 \\
7680 & 7680 & 1920 \\
15,360 & 15,360 & 3840 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of public key algorithms in terms of memory used.