On the Security and Efficiency of Different Secure Hash Algorithms
Ankush Soni, Sanjay K. Sahay · 2025
Cryptographic hash functions are essential for securing data integrity in systems such as digital signatures, blockchain networks, and secure communication protocols. Among the widely adopted standards, Secure Hash Algorithm 2 (SHA2), particularly the 256-bit variant (SHA2-256), has been extensively used across various applications for over two decades. However, with advancements in computational power and the emergence of quantum algorithms like Grover’s, concerns have been raised about the long-term security and efficiency of SHA2-256. Therefore, in this paper, we present a detailed performance analysis of all major variants of SHA2 and Secure Hash Algorithm 3 (SHA3) across a wide range of input sizes ranging from 1 KB to 1 GB. Each algorithm was implemented from scratch in the C programming language and evaluated on both an Intel i7 processor and a Raspberry Pi 4B device to ensure a fair and unbiased comparison across platforms. The results show that lighter SHA3 variants, such as SHA3-224 and SHA3-256, offer better performance for small inputs but provide comparatively lower security margins. Interestingly, SHA2-512 outperformed SHA2-256 consistently across all data sizes, with up to 94% faster processing on large files, making it not only more efficient, but also cryptographically stronger. Despite this, SHA2-256 remains the default in most current systems. These findings highlight the need to reconsider default choices and promote the broader adoption of SHA2-512 in modern and emerging applications such as Internet of Things (IoT) devices, blockchain infrastructures, and other performance-sensitive environments where the efficiency and security levels of the systems are critical.