From personal knowledge I know SHA-2 hashes are irreversible and do not use a key.
But a person I know has contradicted the above very confidently, I'm now confused and couldn't find the answer I wanted by googling.
Can anyone clear me up on this issue ?
Thanks
SHA-2 is an algorithm, a generalized idea of how to hash data. SHA-2 has several variants, all of which use the same algorithm but use different constants. SHA-256, for example, sets additional constants that define the behavior of the SHA-2 algorithm, one of these constants is the output size, 256.
The basic operation of hash functions does not need any key and operate in a one-way manner. The one-way operation means that it is impossible to compute the input from a particular output. The basic uses of hash functions are: Generation and verification of digital signatures.
SHA-256 is a patented cryptographic hash function that outputs a value that is 256 bits long. What is hashing? In encryption, data is transformed into a secure format that is unreadable unless the recipient has a key. In its encrypted form, the data may be of unlimited size, often just as long as when unencrypted.
SHA-2 is the cryptographic hashing standard that all software and hardware should be using now, at least for the next few years. SHA-2 is often called the SHA-2 family of hashes because it contains many different-size hashes, including 224-, 256-, 384-, and 512-bit digests.
Hash functions like SHA-* do not need a key, they just calculate a hash-value from any input.
There are other functions like HMAC, which indeed use a key, together with a hash function. So it is possible to use a key together with SHA-2, to generate a HMAC, that's what the person possibly had in mind, and what SLaks tried to point out. A HMAC has a different purpose than a hash function though.
SHA-2, like all hash algorithms, do not use keys.
The definition of a hash function is a map from a single input to an output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With