SHA-512 Hashing Algorithm Overview

Delton Rhodes
Delton Rhodes
SHA-512 Hashing Algorithm Overview

SHA-512, or Secure Hash Algorithm 512, is a hashing algorithm used to convert text of any length into a fixed-size string of 512 bits (64 bytes). Originally published in 2001, SHA-512 was developed by the US Government’s National Security Agency (NSA). This algorithm is commonly used for email addresses hashing, password hashing, and digital record verification. SHA-512 is also used in blockchain technology, with the most notable example being the BitShares network.

In this article, we explore the origins of SHA-512 and discuss how the algorithm has been used by BitShares as well other prominent blockchain projects. Lastly, we’ll look at a few examples of non-blockchain applications and examine how SHA-512 compares to the SHA-256 algorithm.

Origins of SHA-512 Development

SHA-512 is just one of several algorithms in the Secure Hashing Algorithm (SHA) family. In 2001, SHA-512 was published by the National Institute of Standards and Technology (NIST) as a U.S. Federal Information Processing Standard (FIPS). Before we look at the specifics of how SHA-512 is used today, let’s briefly cover the history of these algorithms.

Seed words 17-20 for the KMD Treasure Chest listed in order: rookie page afraid before

Failures of SHA-0 And SHA-1

SHA-0 is a 160-bit hash function that was first published in 1993 under the name “SHA.” Shortly after publication, SHA-0 was withdrawn due to the presence of a “significant flaw.” After later iterations were developed, its name was retroactively changed to “SHA-0.” In 1995, SHA-1 was published as a 160-bit hash function to resolve the security issues of SHA-0. Its characteristics are very similar to the MD5 hash function, which was first published in 1992. However, much like SHA-0, SHA-1 is no longer used in real-world applications due to security vulnerabilities.

SHA-2 Development

SHA-2 consists of two hash functions with different block sizes: SHA-256 and SHA-512. Additionally, there are four truncated versions of SHA-2. SHA-256, SHA-384, and SHA-512 were published in 2001. SHA-224 was published in 2004. SHA-512/224 and SHA-512/256 were published in 2012. The entire SHA-2 family is patented under US patent 6829355. The patent is also available through a royalty-free license, making it accessible to people like Satoshi Nakamoto.

SHA-3 Development

The SHA-3 family, formerly known as Keccak, consists of four cryptographic hash functions: SHA3-224, SHA3-256, SHA3-384, and SHA3-512, and two extendable-output functions (XOFs), called SHAKE128 and SHAKE256. All SHA-3 algorithms were published in 2015. Although they are widely considered to be more secure than SHA-2 algorithms, SHA-3 algorithms have yet to gain significant adoption.

Prominent Blockchain Projects That Use SHA-512

Compared to SHA-256, the adoption of SHA-512 by blockchain projects has been very minimal. Most blockchain networks that chose not to implement SHA-256 opted for other existing hashing algorithms. Some have developed entirely new hashing algorithms such as Equihash and CryptoNight with the specific goal of achieving ASIC-resistance in cryptocurrency mining. With that being said, here are a few examples of networks that use or have used SHA-512.

BitShares (BTS)

Although there isn’t any information available on the first blockchain project to implement SHA-512, we do know that BitShares (formerly ProtoShares) was one of the earliest to do so.

According to the BitShares website, the network introduced the Momentum Proof of Work (PoW) algorithm in October 2013. Momentum is a proprietary graph-based algorithm that uses 512-bit SHA-1 (also known as Cuckoo Cycle). As one critique stated, there were at least two clear issues with the BitShares implementation of Momentum. First, the SHA-512 hash fails to take advantage of SHA-256 acceleration instructions. Second, this implementation was found to be needlessly slow. Both of these challenges meant ASIC miners would be able to succeed over CPUs and GPUs, leading to network centralization issues.

The network’s genesis block was mined using Momentum PoW in November 2013. However, shortly afterward, BitShares founder Daniel Larimer determined that cryptocurrency mining was flawed. In July 2014, BitShares moved away from Proof of Work and became the first blockchain project to implement the Delegated Proof of Stake (DPoS) consensus mechanism.

LBRY Credits (LBC)

LBRY is a protocol that allows anyone to build apps that interact with digital content (e.g.  videos, audio files, documents, or any other type of file) on the LBRY network. Its native cryptocurrency is LBRY Credits (LBC), which can be used to access paid content on the network. LBRY has its own unique hashing algorithm that uses a combination of the SHA-512, SHA-256, and RIPEMD hash functions.

The blockchain network has a targeted block time of 2.5 minutes, and the maximum size of each block is currently around 2 MB (around 1800 transactions). From Block 55001 onward, the network’s block reward decreases logarithmically over the course of a 20-year period. Cryptocurrency mining on LBRY is currently dominated by GPUs and FPGAs. The project team has stated that it no longer views CPU mining as economically viable.

Kcash (KCASH)

Kcash uses the SHA512-ZERO encryption algorithm. While there isn’t much info available on the technical specifications of this implementation of SHA-512, the focus of the Kcash blockchain network is to enable data privacy through a technology called zero-knowledge proofs. Popular blockchain networks such as Monero and Zcash also use zero-knowledge proofs; however, they have opted to implement other hashing algorithms.

Other Projects

A number of other blockchain projects either currently use SHA-512 or have used it in the past. However, these projects have yet to gain significant user adoption. While there were discussions as early as 2010 about the possibility of blockchain networks switching from SHA-256 to SHA-512, the general consensus is that this wouldn’t provide any practical benefits.

Non-Blockchain Applications For SHA-512

SHA-512 is also used in a variety of non-blockchain applications. It’s oftentimes used in conjunction with SHA-256 but sometimes used by itself. Nonetheless, as with blockchain applications, SHA-512 adoption for other technical applications clearly pales in comparison to SHA-256.

SHA-512 was used to authenticate archival video from the International Criminal Tribunal of the Rwandan genocide. Unix and Linux vendors use both SHA-256 and SHA-512 for secure password hashing. An email suppression list solution called OPTIZMO provides the storage and distribution of SHA-512 hashed email addresses for major clients such as Salesforce, LendingTree, Hotwire, and eharmony.

SHA-256 And SHA-512 Compared

Now that we understand how SHA-512 is used in real-world applications, let’s look at how it compares to SHA-256 by assessing three critical factors: security, computational efficiency, and compatibility.

Security

While there are a variety of potential attack vectors to evaluate, collision resistance is possibly the most important component of security for any hashing algorithm. The purpose of a hashing algorithm is to ensure that it’s virtually impossible to find two different inputs that produce the same output (known as a collision). If a collision is found, the accuracy of the original, unhashed message comes into question. Several collisions were found in SHA-0 and SHA-1, meaning those algorithms are not secure enough for real-world applications.

Since no technology is currently capable of breaking SHA-2 encryption and no collisions have been found, the security provided by SHA-256 and SHA-512 is practically identical. It’s theoretically possible that SHA-512 would have a slight security advantage given the rise of quantum computers. Nonetheless, it’s much more likely that all SHA-2 algorithms would need to be replaced with newer generations of quantum-resistant algorithms in order to effectively mitigate potential collision attacks.

Computational Efficiency

SHA-256 produces smaller outputs than SHA-512. This means it generally requires less bandwidth to store and transmit data. Using SHA-256 generally requires less memory and also less processing power in some cases. As this test shows, SHA-256 is 31% faster than SHA-512 when hashing shorter inputs. Meanwhile, SHA-512 is only 2.9% faster when hashing longer inputs.

The Bitcoin network hashes a lot of smaller inputs (e.g. 33-byte public keys and 80-byte block headers), which likely explains why Satoshi Nakamoto chose SHA-256 over SHA-512. There's also the fact that SHA-512 is better on 64-bit processors, while SHA-256 is better on 32-bit processors. When the Bitcoin network launched in 2009, 32-bit processors were much more widely used than 64-bit processors. In addition, the requirement for higher rounds of blockchain consensus and larger block sizes of SHA-512 adds computational overhead that slows down the transaction validation process.

Compatibility

Another factor for the limited adoption of SHA-512 is the potential for compatibility issues for both blockchain and non-blockchain applications. For example, with the depreciation of SHA-1 due to security vulnerabilities, SHA-256 was chosen as the default SSL/TLS certificates. Because SHA-512 isn’t widely implemented, a few compatibility issues exist that make it a less practical solution.

Had Bitcoin adopted SHA-512, it’s very likely that this hashing algorithm would play a more prominent role today in blockchain technology. Because SHA-256 was implemented on the Bitcoin protocol, other blockchain networks (e.g. Bitcoin Cash and Bitcoin SV) that have been created as a result of hard forks of Bitcoin also continue to use SHA-256. In turn, this has meant that powerful ASIC hardware mining rigs have been manufactured specifically for the SHA-256 algorithm.

For less established blockchain networks, it’s also much easier to win over miners by using a hashing algorithm that is compatible with their existing hardware. Even if a smaller network wanted to use SHA-512, the possibility of limited miner adoption may lead to major security issues like inexpensive 51% attacks due to low hash rates.

Additionally, within the Secure Hashing Algorithm family, SHA-3 (formerly known as Keccak) now provides a faster and more secure solution than both SHA-256 and SHA-512.

Learn More About Hashing Algorithms

If you’re interested in understanding how hashing algorithms are used in blockchain technology, check out other articles in Komodo’s Blockchain Fundamentals series. You can find in-depth guides to other hashing algorithms, including SHA-256, Equihash, CryptoNight, Scrypt, and Lyra2REv2.

If you'd like to learn more about blockchain technology and keep up with Komodo's progress, you can join Komodo Discord and sign up for the monthly newsletter.

Begin your blockchain journey with Komodo today.



Great! Next, complete checkout for full access to Komodo Platform | En
Welcome back! You've successfully signed in
You've successfully subscribed to Komodo Platform | En
Success! Your account is fully activated, you now have access to all content
Success! Your billing info has been updated
Your billing was not updated