The functional verification of the existing and proposed methodologies was done in ModelSim using Verilog. The Xilinx Design Suite was used to perform the synthesis, which helps to compare the area and delay of the existing and proposed methodologies [28–29].
Figure 4.1 shows the simulation result of the existing method for the encryption process. The Verilog code for the encryption process accepts two inputs and one output. The inputs are stored in the variables plaintext of size 128 bit and key of size 128 bit, whereas the output produced is stored in the variable en_msg of size 128 bit. The variable plaintext stores the message that needs to be encrypted, while the variable key stores the secret key used to encrypt the plaintext. The variable en_msg stores the encrypted version of the plaintext, also known as cypher text.
From Fig. 4.1, the input message used for the testing is given in hexadecimal format, which is 00041214120412000c00131108231919, and it is stored in plaintext. The key is also provided in hexadecimal format, which is 2475a2b33475568831e2120013aa548, and it is stored in the key. After simulatingin ModelSim, the output is produced in hexadecimal format as e092d2abefcd5ad929155ad6c559aa78, and it is stored in en_msg.
Figure 4.2 shows the simulation result of the existing method for the decryption process. The Verilog code for the decryption process accepts two inputs and produces one output. The inputs are stored in the variables en_msg of size 128 bit and cipher_key of size 128 bit, whereas the output produced is stored in the variable de_msg of size 128 bit. The variable en_msg stores the message that needs to be decrypted, while the variable key stores the secret key used to decrypt the en_msg. The variable de_msg stores the decrypted message.
From Fig. 4.2, the input encrypted message used for the testing is given in hexadecimal format, which is e092d2abefcd5ad929155ad6c559aa78, and it is stored in en_msg. The key is also given in hexadecimal format, which is 2475a2b33475568831e2120013aa548, and it is stored in the key. After simulating in ModelSim, the output is produced in hexadecimal format as 00041214120412000c00131108231919, and it is stored in en_msg [30].
Figure 4.3 shows the simulation result of the proposed method for the encryption process. The Verilog code for the encryption process accepts two inputs and one output. The inputs are stored in the variables plaintext of size 128 bit and key of size 128 bit, whereas the output produced is stored in the variable en_msg of size 128 bit. The variable plaintext stores the message that needs to be encrypted, while the variable key stores the secret key used to encrypt the plaintext [31]. The variable en_msg stores the encrypted version of the plaintext, also known as cypher text.
From Fig. 4.3, the input message used for the testing is given in hexadecimal format, which is 00041214120412000c00131108231919, and it is stored in plaintext. Furthermore, the key is also given in hexadecimal format, which is 2475a2b33475568831e2120013aa548, and it is stored in the key. Finally, after simulatingin ModelSim, the output is produced in hexadecimal format as e092d2abefcd5ad929155ad6c559aa78, and it is stored in en_msg.
Figure 4.4 shows the simulation result of the proposed method for the decryption process. The Verilog code for the decryption process accepts two inputs and produces one output [32]. The inputs are stored in the variables en_msg of size 128 bit and cipher_key of size 128 bit, whereas the output produced is stored in the variable de_msg of size 128 bit. The variable en_msg stores the message that needs to be decrypted, while the variable key stores the secret key used to decrypt the en_msg. The variable de_msg stores the decrypted message.
From Fig. 4.4, the input message used for the testing is given in hexadecimal format, which is 00041214120412000c00131108231919, and it is stored in plaintext. The key is also given in hexadecimal format, which is 2475a2b33475568831e2120013aa548, and it is stored in the key. After simulatingin ModelSim, the output is produced in hexadecimal format as e092d2abefcd5ad929155ad6c559aa78, and it is stored in en_msg.
Figures 4.5 and 4.6 represent the synthesis reports generated by Xilinx Design Suite software. The device xc7a200t with the package 3ffg1156 in the Artix7 family was used for the synthesis. The figures show the number of slices and the number of LUTs utilized by the proposed method.
Table 4.1 compares the results of the existing and proposed methods in terms of area and delay. Concerning the values present in the table, we can calculate the efficiency percentage of the proposed method for area and delay.
Table 4.1
Comparison between Existing and Proposed Method
Performance Metrics | Existing Method | Total | Proposed Method | Total |
Encryption | Decryption | Encryption | Decryption |
No. of LUTs | 15,121 | 14,935 | 30,056 | 12,227 | 12,579 | 24,806 |
No. of Slices | 4,663 | 4,509 | 9,172 | 3,872 | 3,909 | 7,781 |
Delay (in ns) | 55.617 | 55.356 | 110.973 | 52.701 | 54.01 | 106.711 |
Table 4.2
Area and Delay Reduction Percentage
Performance Metrics | Percentage |
Area (No. of LUTs) | 17.467% |
Delay (in ns) | 3.841% |
Table 4.2 shows the efficiency of the proposed method when compared with the existing method. From Table 4.1, it can be observed that the proposed has less area consumption. The encryption and decryption processes of the existing method consume 15,121 and 14,935 LUTs, respectively, for a total of 30,056 LUTs. At the same time, the number of LUTs consumed by the encryption and decryption processes of the proposed method is 12,227 and 12,579, which produce a total of 24,806 LUTs. From Table 5.2, the proposed method has an area of 17.467% less than the existing method. This is due to a reduction in the number of registers used.
From Table 4.1, it can be observed that the proposed method has fewer delays than the existing method. The encryption and decryption processes of the existing system produce delays of 55.617 ns and 55.356 ns, which combine to produce a total delay of 110.973 ns. In contrast, the encryption and decryption processes of the proposed method produce delays of 52.701 ns and 54.01 ns, which combine to make a total of 106.711 ns. From Table 4.2, the proposed method has a delay of 3.841% less than the existing method. This is due to the reduction of registers while combing Sub Bytes and Shift Rows, which eliminates the storage and retrieval of data during the Sub Bytes transformation.
One of the most desired properties of cryptographic algorithms is the avalanche effect. It is measured by varying a single bit in the plaintext or the key, and the number of bits varied for that change. The following formula is used to find the avalanche effect:
% Avalanche effect = (nb / tb) x 100
where nb - number of bits changed in the output for the single-bit change
tb - total number of bits in the output
Table 4.3
Avalanche Effect of the Proposed Method
Plaintext | Secret Key | Ciphertext | Change in bits | %Avalanche effect |
00041214120412000c00131108231919 | 2475a2b33475568831e2120013aa5481 | e092d2abefcd5ad929155ad6c559aa78 | 65 | 50.78 |
2475a2b33475568831e2120013aa5483 | 7ec33428038a6dde937069e3e61cb1b5 |
2475a2b33475568831e2120013aa5486 | 4ea5599fb300b3a057fdf0e5c92ce8b6 | 68 | 53.14 |
2475a2b33475568831e2120013aa5487 | b5e4c3b1d53324aed8e859bd33cdbe4c |
2475a2b33475568831e2120013aa548c | 244a9f0a0d11cf47d7c4415a52b8b2d4 | 79 | 61.71 |
2475a2b33475568831e2120013aa548d | bff680b1cce2211c2b6b54215141f1a3 |
Table 4.3 shows the avalanche effect calculation for the proposed method. Here, the plaintext of size 128 bit is constant, the secret key of size 128 bit is varied by one bit, and the cypher text of size 128 bit is generated for the inputs.A change in a single bit of the key has resulted in a drastic change in the ciphertext, making the algorithm more secure. The higher the avalanche effect, the more secure the algorithm. An more than 50% avalanche effect shows that the algorithm is more secure.