how hashes work
typical hash functions take inputs of variable lengths to return outputs of a fixed length a cryptographic hash function combines the message passing capabilities of hash functions with security properties hash functions are algorithms that determine how information is encrypted for example secure hashing algorithm 256 sha 256 goes through a process to encrypt the input it receives by 1using sha 256 the word hello will produce an output that is the same number of characters 64 as hello world and hello john however the hash will be significantly different for all three keep in mind that capital letters change the hash also 2the function used to generate the hash is deterministic meaning it will produce the same result each time the same input is used while sha 256 can generate a hashed output in milliseconds with very little computing power it makes determining the input difficult 1not all cryptocurrencies use sha 256 keccak256 equihash scrypt ethash and blake3 are also examples of hashing functions used this makes hashing ideal for securing cryptocurrency because it would take thousands of years to reverse the encryption to determine the original input with modern technology hash functions are commonly used data structures in computing systems for tasks such as checking the integrity of messages and authenticating information cryptographic hash functions add security features making detecting the contents of a message or information more difficult in particular cryptographic hash functions exhibit these three properties 3because of the features of a hash they are used extensively in online security from protecting passwords to detecting data breaches to checking the integrity of a downloaded file hashing and blockchainsthe backbone of a cryptocurrency is the blockchain which is a globally distributed ledger formed by linking together individual blocks files of transaction data and information through hashing blockchains only contain transactions that are validated validation is completed by comparing hashes which prevents fraudulent transactions and double spending cryptocurrencies use hashes in different ways for instance miners solve bitcoin s hash problem by using the data in a block as input and generating a hash the goal is to generate a hash that is equal to or less than the network s target hash the mining program adjusts variable numbers until it generates a hash less than or equal to the target hash once the problem is solved each node compares the block header by hashing it twice and comparing its result to the new block s hash 