# Comparative Study of Blockchain Hashing Algorithms with a Proposal for HashLEA
## 5 Security and Performance Analysis
### Collision Resistance  
In cryptography, a collision is defined as the occurrence of two distinct messages that generate the same hash value. Resistance to collisions is one of the most fundamental properties of a cryptographic hash function. Although collisions are unavoidable in scenarios involving large sample spaces, it is of paramount importance to make their occurrence as challenging as possible. Given the vastness of the sample space (\(2^{256}\) for a 256-bit hash), it is impractical to test every possible hash value. To assess the collision resistance of a hash function, an alternative approach proposed by [PERSON] [88] is more practical. This method entails the examination of hash outputs for identical values at corresponding positions subsequent to the introduction of bit alterations in the input messages, thereby enabling the prediction of the probability of generating identical hashes.  
In our study, we generated 2000 random input data and computed the resulting hash values in ASCII format. Subsequently, a single bit is altered at an arbitrary position in each input message, and the corresponding hash value is calculated. In accordance with [PERSON]'s methodology, the number of identical pairs of hexadecimal characters at identical positions between the original and modified hash outputs are calculated and are represented as \(N_{s}\). The objective is to minimize \(N_{s}\), as this indicates a higher resistance to collisions. The results, presented in Table 3, demonstrate the number of matching entries across the hash values. These results are compared with those of other widely used hash functions, which can be expected that as the digest size increases, the probability of finding matching entries also tends to increase. The proposed HashLEA function's collision resistance remains robust within the expected limits.  
\begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Number of Equal** & **0** & **1** & **2** & **3** & **4** \\
**Characters** & **0** & **1** & **2** & **3** & **4** \\ \hline
**X11** & 1770 & 219 & 10 & 1 & 0 \\
**X13** & 1737 & 245 & 17 & 1 & 0 \\
**X15** & 1735 & 255 & 10 & 0 & 0 \\
**X17** & 1727 & 254 & 18 & 1 & 0 \\
**Scrypt** & 1792 & 186 & 22 & 0 & 0 \\
**Quark** & 1773 & 214 & 13 & 0 & 0 \\
**Keccak** & 1786 & 205 & 9 & 0 & 0 \\
**Xevan** & 1789 & 203 & 7 & 1 & 0 \\
**Fugue** & 1752 & 240 & 7 & 1 & 0 \\
**Groestl** & 1749 & 237 & 14 & 0 & 0 \\
**Myr-Groestl** & 1789 & 196 & 15 & 0 & 0 \\
**SHAvite-3** & 1760 & 225 & 15 & 0 & 0 \\
**Skein** & 1767 & 215 & 16 & 2 & 0 \\
**Lyrazz** & 1754 & 234 & 11 & 1 & 0 \\
**Lyra2 re** & 1799 & 185 & 16 & 0 & 0 \\
**Lyra2 REv2** & 1771 & 217 & 11 & 1 & 0 \\
**Blake** & 1787 & 201 & 12 & 0 & 0 \\
**HashLEA** & 1768 & 218 & 14 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The number of matching entries across the hash values.  
Moreover, the absolute difference between the generated hash values is calculated in accordance with Equation (6), which quantifies the distance (\(d_{hash}\)) between two corresponding ASCII characters in the same position of the original (\(t_{i}\)) and modified (\(\tilde{t}_{i}\)) hash values. A comparison of the absolute difference values is presented in Table 4. The maximum, minimum, and mean values of \(d_{hash}\) are derived from the set of absolute differences. The average absolute difference (\(d_{avr}\)) is calculated by dividing the mean value by the number of matching pairs of hexadecimal characters. The results demonstrate that the proposed HashLEA function yields a value of 85.64, which is slightly higher than the ideal value but still within an acceptable range. This illustrates that HashLEA has a stable and robust collision resistance in terms of consistency and predictability.  
\[d_{hash}=\sum_{i=1}^{\left(\frac{\tilde{a}_{igcat}}{8}\right)}|dec(t_{i})-dec( \tilde{t}_{i})| \tag{6}\]