# Performance Analysis of Post-Quantum Cryptography Algorithms for Digital Signature
## 5 Performance Analysis  
This section is dedicated to the analysis of efficiency, focusing specifically on time-based metrics. The idea behind performance testing is to examine post-quantum algorithms in the proposed implementation comprehensively. There are several reasons why time is a key factor regarding cryptographic algorithms. The crucial ones are listed below.  
* Scalability--algorithms with faster processing times are better suited for managing large datasets or high-traffic scenarios. If the algorithm is time-efficient, the whole system will be able to handle more operations.
* User Experience--cryptographic algorithms should be fast enough to ensure smooth use of the applications. Latency drastically affects the experience of using a particular service. Additionally, some applications need real-time operation which cannot be supported by inefficient cryptography algorithms.
* Security--if the execution time of a particular algorithm is excessively long, this can create an opportunity for an attacker to collect information about the time this service needs. By measuring the time in different examples of input data, it is possible to obtain information such as the length of used keys. To prevent this vulnerability, it is necessary to ensure the used solutions are time-optimized and designed to ensure that the execution time is constant, which means they are independent of the input data.
* System Performance--cryptographic operations are almost always part of larger systems, and therefore, their time efficiency translates into the aggregate performance of complex services.  
Moreover, cryptography algorithms used in practice require balancing security strength and time efficiency. The proper trade-off is crucial, taking into account the usability of such solutions.  
In order to test the performance of post-quantum algorithms in a digital signature mechanism, it was necessary to have files that would be signed. It was assumed that entire files are encrypted by the private keys of each tested algorithm. To obtain a representative spectrum of results, three files of size 10 MB, 100 MB, and 1 GB were generated. This was achieved using the native Linux command dd, which is used to copy and convert data. Using this command, pseudo-random data from the /dev/urandom file were copied.  
Every functionality was tested for each algorithm. Each measurement was repeated 101 times. The first measurement time for a given algorithm was noticeably longer and was not included in the graphs and further analysis. This is due to the data being read from the disk and loaded into cache memory. By omitting the first measurement in each series, it was possible to exclude the disk read speed factor from the measurement component and obtain the proper time needed to execute the tested algorithm. Therefore, the presented graphs show the average execution time of the algorithm calculated from 100 iterations of a given operation. Error bars showing the Standard Error of the Mean (SEM) are also included for each algorithm. Before starting the measurements, it was necessary to prepare the various components. For the file signing and signature verification processes, three files of 10 MB, 100 MB, and 1 GB were prepared. A corresponding key pair was also generated for each algorithm. During the key pair generation evaluation, the files containing the key pairs were deleted after each iteration. Regarding the file signing tests, each iteration was run on the same file, and as with the key pair generation, the resulting file was deleted after each iteration. Following the same procedure, the signature verification tests were performed on the same file for each algorithm, in order to compare the results of the measurements.