SHA-256

Message:

What is a secure hash algorithm

A hash algorithm or hashing function is a procedure in which data of an arbitrary length (pre-image, message, input) is transformed in a reproducible way (mapped) to data of a fixed length. (hash, digest, output). This allows for computationally efficient storage and retrieval of data.

Secure hash algorithms are fundamentals of cryptography. They have the following features:

  1. One way function or pre-image resistance. It's much easier to calculate the hash from the data than to calculate the data from the hash. Think of a physical telephone book. It's easy to get a phone number from a name, but it's difficult to get a name from a phone number.
  2. Second pre-image resistance. Starting with a specific input, it's hard to find another input that has the same hash value. For instance, raising a real number to its third power has 100% pre-image resistance.
  3. Collision resistance. It's difficult to find any pair of inputs that hash to the same output.

What is SHA-256

SHA-256 is one of a family of secure hash algorithms published in 2001 as a US federal standard by NIST (The National Institute of Standards and Technology). The hash length is 256 bits, 64 hex characters or 32 bytes. The standard is available here . SHA-256 is used to enable many cryptocurrencies (e.g., Bitcoin) as well as other blockchain applications. It provides security for SSL/TLS protocols. It can be used as a cryptographic primitive for digital signature algorithms, message authentication codes and keystream ciphers, among others.