# Utilizing Trusted Lightweight Ciphers To Support Electronic-Commerce Transaction Cryptography
## 3 Background of E-Commerce and Used Techniques
### Overview of Security Techniques  
This section will overview the techniques used in the proposed protocol. * Generating a large random prime number (\(Pn\));
- Choosing a random number in the period \([1,Pn-1]\) as a generator number (\(Gn\));
- Choosing an integer (\(Pr_{k}\)) larger than one and less than (\(Pn-2\)) as the private number;
- Calculating a public key part value (\(Pv\)), where \(Pv=Gn^{Pr_{k}}mod\ Pn\);
- The private key is \(Pr_{k}\), and the public key (\(Pu_{k}\)) is \(Pn\), \(Gn\) and \(Pv\). ElGamal encryption procedure:
- Representing the transaction request (plaintext) as an integer \(TR\), where \(0<\ TR<\ Pn-1\), and the public key (\(Pn\), \(Gn\), \(Pv\)) is used to achieve encryption;
- Choosing an integer random number \(Rn\) such that \(1<\ Rn<\ Pn-2\);
- Computing the first encryption value \(V_{1}\), \(V_{1}=Gn^{Rn}mod\ Pn\);
- Computing the second encryption value \(V_{2}\), \(V_{2}=(Pv^{Rn}*TR)mod\ Pn\);
- Encryption (\(E\)) is \(E=(V_{1},V_{2})\). ElGamal decryption procedure:
- Receiver receives the encryption \(E=(V_{1},V_{2})\);
- Using the private key (\(Pr_{k}\)) for decryption procedure;
- Then, \(r\) is computed as follows: \(r=V_{1}^{Pn-1-Pr_{k}}mod\ Pn\);
- \(E\) is decrypted by \(TR=(r*V_{1})mod\ Pn\). The ElGamal algorithm works to increase security, and it is difficult to break [30]. Although the ElGamal cipher algorithm is a popular public-key cryptography algorithm whose security is based on a difficult discrete logarithm problem, the traditional ElGamal  
Figure 3: Payment gateway in e-commerce. mal encryption algorithm still has some shortcomings including the long ciphertext and the time-consuming calculation, and the higher the complexity, the slower the encryption speed [31]. * **Advanced Encryption Standard** Block cipher technology, known as the \"advanced encryption algorithm\" (or \"AES\"), operates on 128 bit plaintext and uses the same key for both encryption and decryption. The 128 bit blocks are performed by the AES algorithm, which performs 10, 12, and 14 rounds of operations on each block. It uses an 80, 128, 192 and 256 bit cipher (see Figure 5[32]). It is made up of a 4-byte array that identifies the state, and in each cipher round, conversions are made as SubBytes (0), ShiftRows (0), MixColumns and AddRoundK (0). \begin{table}
\begin{tabular}{l l l} \hline \hline
**Factors** & **ElGamal** & **RSA** \\ \hline Developed & 1985 & 1978 \\ Researchers & Talber EIGamal & [PERSON], [PERSON], and [PERSON] \\ Key length value & \(\geq\)1024 bits & \(\geq\)1024 bits \\ Type of algorithm & Asymmetric & Asymmetric \\ Security attack & Meet in the middle attack & Timing attack \\ Simulation speed & Fast & Fast \\ Scalability & Good scalability & No scalability occurs \\ Key used & Different key used for encryption and decryption & Different key used for encryption and decryption \\ Power consumption & Low & High \\ Hardware and software & Not very efficient & Faster and efficient \\ implementation & Multiplicative group & Integer factorization \\ Security strength & The difficulty of computing a discrete logarithm & The difficulty of factoring the product of two large \\  & in a finite field & prime numbers \\ Encryption & It is more efficient for encryption & It is more efficient for encryption \\ Decryption & It is more efficient for decryption & It is less efficient for decryption \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Asymmetric cryptography algorithms. Figure 4: ElGamal keys with encryption and decryption. There are four primary functional blocks in AES:  
1. Byte substitution: The byte of each data block is substituted to another block utilizing an S-box. 2. Rows shift: Each row receives a cyclic shift to the right relying on where it is in the state matrix. 3. Columns mix: In this matrix multiplication process, each column of the state matrix is multiplied by the fixed matrix. 4. Round key addition: The new state matrix and the round key matrix are combined using an XOR technique [33].