# Low-Cost Full Correlated-Power-Noise Generator to Counteract Side-Channel Attacks
## 3 AES: Structure, Implementation, and Vulnerabilities
### Vulnerabilities, Metrics, and Attacks  
The security level of the ciphers was primarily based on their mathematical formulation, but the physical implementation of these algorithms led them to become more vulnerable to physical attacks. It is advisable to identify all potential security vulnerabilities and to implement countermeasures in order to prevent any leakage of information. A well-known method to analyze vulnerable leakage points is called Test Vector Leakage Assessment (TVLA) [18]. This test is a preliminary experimental security metric whose objective is to certify vulnerability points of a cipher, block, or any device. In essence, the TVLA metric detects the presence of potential private information leakages. TVLA has been carried out for the AES. Its configuration involves the cipher (as DUT) holding a fixed known key and receiving a plaintext that alternates between random and fixed values in every encryption. The resulting graph is displayed in Figure 3.  
All the encryption rounds and three post-processing rounds are shown. As can be observed, there is evident information leakage, as the TVLA values exceed the threshold of \(+/-4.5\)[18]. Given the result, the proposed countermeasures must protect all the encryption rounds, as the original implementation of AES is vulnerable to power attacks on the majority of them.  
To confirm that the leakage detected in our preliminary security evaluation leads to successful attacks, experimental first-order CPA attacks have been performed. Unlike TVLA, the CPA attack is focused on discovering private information, specifically the key in the case of AES, rather than solely determining its vulnerability. The attack has been successful for the AES employed in this paper--a SubByte attack is shown in Figure 4; thus, the AES implementation is vulnerable against first-order CPA attacks. In this work, first-order CPA attacks have been taken into account. However, new types of attacks are appearing every day, such as those based on machine-learning techniques or higher-order attacks, which makes it interesting to evaluate the security levels against numerous hardware attacks in the future for further and complete analysis.  
\begin{table}
\begin{tabular}{c c c} \hline
**Feature** & **AES-128** & **AES-256** \\ \hline Encryption clock cycles & 11 & 15 \\ \hline Decryption clock cycles & 21 & 22 \\ \hline Frequency (MHz) & 66.20 & \\ \hline LUTS & 3616 & \\ \hline \end{tabular}
\end{table}
Table 1: Resources required for the implementation of AES128-256 in Spartan-6 XC6 SLX75-2 CSG484.  
Figure 3: TVLA—unprotected AES.  
It is common to observe attacks on the first or the last round, in which the knowledge of plaintexts or ciphertext, respectively, is necessary. In this instance, the last round exhibits a greater degree of leakage compared to the first round, making it more susceptible to vulnerabilities. The CPA attack on the last round will get the last subkey of the expanded key \(K_{n_{t}}\). Afterwards, a second step is necessary, which is to reverse the Key Schedule process until the original key is obtained. The difficulty of reversing the key-programming process depends on the key length. While attacking the AES-128 involves discovering only one of the subkeys of the expanded key, reversing the process for AES-256 requires knowledge of two consecutive subkeys [13,19]. This fact often necessitates the execution of two consecutive interdependent attacks [13,19]. The first consecutive attack follows a similar approach as that used for AES-128, but the second attack, which is directly contingent on the success of the first one, must be carried out. Any error or uncertainty in the initial attack further complicates the process of key recovery. That is the reason why the AES-256 attack is more difficult and time consuming for the attacker, assuming greater concern than AES-128. Consequently, in this study, while the AES implementation has been designed for both 128-bit and 256-bit key sizes, only the AES-256 is subjected to experimental analysis.