Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 18298

SHA-2 is a family of cryptographic hash functions designed by the NSA and published by NIST in 2001. The family includes various output lengths (224, 256, 384, and 512 bits).

9 votes
Accepted

Are SHA-256 and SHA-512 collision resistant?

Cryptographic hash functions by design cannot be collision-free since they operate on arbitrary-sized input to fixed-sized outputs sizes $$H:\{0,1\}^* \to \{0,1\}^b$$ where $b$ is the $H$'s output si …
kelalaka's user avatar
  • 49.5k
3 votes
Accepted

Worth taking performance hit of HMAC to gain additional security?

If we assume that 1 and 2 are true then HMAC-SHA-512 is a better choice. For the time comparison, as stated Paul Uzsak, if there is no specific time relevant problem around ~50% faster shouldn't be c …
kelalaka's user avatar
  • 49.5k
4 votes

"SHA-256" vs "any 256 bits of SHA-512", which is more secure?

The other answers did not mention the Length-Extension attacks on the Merkle–Damgård construction. Length extension is given a hash value $h$; $$h = \operatorname{SHA-256}(\text{IV},\text{secret_key}\ …
kelalaka's user avatar
  • 49.5k
6 votes
Accepted

NIST example shows extra hexadecimal characters in Block Contents of SHA512-256

It is the byte padding of SHA-512 encoded as the big-endian, simply add bit 1, that is the last 0x80 in the begging part fill zeros then add the size in the 128-bit big-endian in the end. 0x18 is 24 …
kelalaka's user avatar
  • 49.5k
3 votes
Accepted

How is the hash for a file calculated?

Hash functions operate on blocks like SHA-256 has 512-bit input block. In SHA-256, your data $m$ is divided into 512-bits blocks $m_1,\ldots,m_n$ where each entered into the hash function. The final b …
kelalaka's user avatar
  • 49.5k
11 votes
Accepted

Extending the size of input for SHA-2 function

$2^{64-1}$ bits that make 2.30584301 exabytes *. If you are not restricted to SHA256, then use SHA512 that allows files to have size at most $2^{128}-1$, or use SHA3 that has no limit. The NIST must u …
kelalaka's user avatar
  • 49.5k
2 votes

Using SHA384 as an asymmetric cipher?

Stream cipher from hash functions: possible For any cryptographically strong pseudo-random function (PRF) the CTR mode of encryption can be defined. You can build such a PRF from a hash function. On …
kelalaka's user avatar
  • 49.5k
8 votes

Why SHA-512/256 when we already have SHA-384?

The truncated versions of SHA2 are introduced in 2005 and in the Cryptographic hash Workshop, in 2005, Kelsey listed the reasons as; Interoperability and security reasons Need drop-in replacement for …
kelalaka's user avatar
  • 49.5k
12 votes

Outlook of trustworthiness of SHA-2

AES-128 (2000) has been around for 20 years and there is no attack faster than brute-force, except the multi-target that affects all block ciphers and hash algorithms. As you can see, an algorithm can …
kelalaka's user avatar
  • 49.5k
2 votes

What is the minimum message length to obtain the full potential of a hash?

First of all, the output sizes of SHA2 are 224, 256, 384 or 512-bit and of SHA3 are 224,256, 384, 512-bit. Normally, hash functions are accepting arbitrary length inputs and producing fixed-length o …
kelalaka's user avatar
  • 49.5k
6 votes
Accepted

The length extension attack and security on length shortening of a hashed message by one byte

Could is also be possible to generate $H(\text{message}[1..n-1])$ from $H(\text{message}[1..n])$ if I know the last byte? No, the length extension attacks are not working exactly like that. Let see …
kelalaka's user avatar
  • 49.5k
20 votes
Accepted

Why does SHA2-224 use different IV's than SHA2-256?

The $\operatorname{SHA-224}$ is defined in the exact same manner as $\operatorname{SHA-256}$ with different initial values and the digest is obtained truncating the hash value, FIPS PUB 180-4 Page 23. …
kelalaka's user avatar
  • 49.5k