Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [sha-256]

SHA-256 is part of the SHA-2 family of hash functions with a 256-bit output and a 128-bit security level.

Filter by
Sorted by
Tagged with
5
votes
2answers
154 views

If a new hash function were made that simply truncated sha-256 to the first N bits, how much insight would it provide into sha-256?

Clearly it would provide perfect insight if all 256 bits were used. What about if 255 were used? Would the general behavior and properties of "sha-255" be expected to be close to sha-256? What about "...
2
votes
2answers
55 views

Given a hash function; assuming domain % codomain = 0 and uniform collision distribution; how is entropy lost by collisions (not output truncation)?

Assuming our domain and codomain both have 4 elements, the uniform distribution of inputs to outputs means the function is injective. It is widely agreed that randomly selecting a domain element ...
1
vote
1answer
55 views

are there more efficient methods than HMAC to achieve convergent encryption?

I’m thinking about the convergent encryption system described in the top answer to this question. However, it seems like preferred modern HMAC algorithms like HMAC-SHA256 (as used in step 2 to create ...
4
votes
2answers
110 views

Entropy preservation through cryptographic hash function

Background First, while studying MinEntropy a bit, I came across an NIST paper, "DRAFT SP 800-90B (second draft)," which suggests "twice" the entropy of the underlying block of a cryptographic hash ...
0
votes
1answer
33 views

Pre-Image Resistance of repeated, patterned SHA2-256 digests

Suppose $H = \operatorname{SHA2-256}$. Let $H_1 = H(\text{“Alpha1”})$. Let $H_2 = H(\text{“Alpha2”})$. … Let $H_N = H(\text{“AlphaN”})$. So all these digests are based off a common pre-image post-...
0
votes
1answer
28 views

Would a non-envelop, prefix only, SHA2 built MAC be susceptible to key recovery attacks?

When aiming to build a MAC, classic literature discusses the use of Envelopes or key "Sandwich" to build MACs. These were proved to be as secure as HMAC in “Sandwich” Is Indeed Secure: How to ...
1
vote
0answers
62 views

Can I prove that hash of modified preimage is valid

Assume that hash(X) == Y Alice knows both X and Y Bob only knows Y Alice generates a random nonce N and shares it with Bob. Alice calculates H = hash(X⊕N) and shares H with Bob. Can Alice prove to ...
0
votes
1answer
100 views

Is there a SHA-256 value which hashes to itself? [duplicate]

Getting curious about SHA-256 cycles (what happens if you hash a value repeatedly), I came across this question: Cycles in SHA256 The first answer suggests that using a 7-bit hash, it's possible to ...
3
votes
1answer
127 views

Why does LastPass use exactly 100100 PBKDF2 rounds

LastPass encryption scheme is recently changed to use more PBKDF2 rounds, specifically 100100. This seems like a really weird number choose. From what I understand brute force time scales linearly ...
1
vote
0answers
46 views

KCV scheme that encrypts a hash over key and IV

Is there anything wrong with this key-check value scheme? This question is a follow-up to an earlier question of mine. In summary, I want to devise a key-check value scheme that will enable my ...
7
votes
1answer
463 views

Security levels in NIST Post-quantum project: e.g. AES-128 vs SHA-256

In an article about NIST Post-quantum Standardization project I read about the security criteria of the proposed schemes and there was this table (Level I lowest security, level V highest): Level I: ...
0
votes
1answer
47 views

Hashing high entropy key into AES format

If I have a high entropy key (ECDHE shared secret), what type of hash should I use to format this into an AES-256 key? Is Sha256 or Sha3_256 sufficient to maintain entropy or do I need to use a KDF (...
1
vote
1answer
101 views

SHA-256 : Finding two strings that the first n bits of hash value are same [duplicate]

How can I find two strings that have the same hash value for first $n$ bits in SHA-256? I'm implementing it by Python and I have the following ideas and problems: Keep generating two random string ...
4
votes
1answer
146 views

How were the arbitrary values used inside SHA-256 algorithm determined?

I am studying the SHA-256 algorithm, and I am wondering something about it. How were the values used inside of the algorithm determined? Take a look for example at how the 16-64th Words are generated....
0
votes
3answers
177 views

CRC32 catches errors, but then what's the point of SHA?

If crc or CRC32 is specially designed to catch errors, then what's the point of SHA or md4-5 or any other hashing function? What I did was, I had a 190 mb png file (rendered in 16k resolution with ...
1
vote
1answer
60 views

Rationale of the SHA-256 sigma function definitions

When the sigma functions are defined in equations (4.4) and (4.5) in FIPS PUB 180-4, the defined functions show the traditional sigma summation symbol, with limits 0 to {256} and 1 to {256}. The ...
2
votes
2answers
158 views

Would SHA-256(SHA-256(x)) produce collisions?

Was reviewing some Bitcoin public-key hash literature and the use of RIPEMD-160 and the SHA-256 as below: RIPEMD160(SHA256(ECDSA_publicKey)) The Proof-of-work ...
1
vote
1answer
108 views

Is SHA256 resistant to second preimage attack?

I am looking into building a merkle tree algorithm and I need to know if SHA256 is resistant to second preimage attack.
85
votes
4answers
11k views

Has SHA256 been broken by Treadwell Stanton DuPont?

In a recent press release issued by Treadwell Stanton DuPont, the claim is made that their research laboratories have successfully broken all 64 rounds of the SHA256 hashing algorithm. They further ...
0
votes
1answer
47 views

Is the AES-GCM encryption using the SHA256 hash of the plaintext as IV secure?

I want to encrypt a list of unique values and I want the property of when I encrypt the same value I get the same ciphertext (determinism). The adversary only observes the ciphertexts of a unique set ...
0
votes
1answer
62 views

Hash key expansion

A hash H is given by H = SHA256(K + N), where K is an unknown 64 character hex key and N is a known nonce. The nonce N is then mapped to a final result R between 1 ...
2
votes
1answer
113 views

Using an AES-256-GCM key as a salt to SHA-256

Assume 256 bit keys are randomly generated and data is encrypted using AES-GCM-256 prior to being sent to a server. The goal is to enable the server to determine uniqueness of data it receives ...
2
votes
2answers
134 views

Statistical Analysis of Cryptographic Hashing Algorithms

I was wondering how can I use NIST Statistical Test Suite to check for the randomness of output generated by a cryptographic hashing algorithm, let say SHA-256? To be specific, how will I generate ...
2
votes
3answers
171 views

Use a SHA256 as a key for AES256

Is it safe to use the SHA256 of a hard-to-bruteforce string as the key to encrypt data with AES256?
3
votes
1answer
146 views

Circular hash collision where digest is pre-image: Could hash(a) = b, hash(b)=c, then hash(c)=a?

For any SHA-family of algorithms (including Keccak) except for SHA1, would it be theoretically possible for there to exist a pre-image a whose hash digest ...
1
vote
1answer
103 views

Is it possible to truncate AES output and keep uniqueness (no decryption needed)? [duplicate]

I would like to hash numbers less than 1000000000, so generally they could be stored on 30 bits. The aim is to obtain numbers that are not reversible, so my initial plan was to use SHA256 (with some ...
0
votes
1answer
70 views

Does every language's SHA256 implementation provide different result for the same value [duplicate]

Probably this is very naive question, based on lack of understanding but I was watching a video from Andreas M. Antonopoulos about blockchain, bitcoin and consensus algorithms and he asked for the SHA-...
0
votes
1answer
63 views

Bitcoin mining nonce and birthday attack

Having read the basics of mining and this about SHA256 (probabilistic?) partial preimage possible? and SAT solving - An alternative to brute force bitcoin mining, I have the following question: ...
1
vote
0answers
40 views

SHA256 creates a unique hash for two *.wim that have identical content - are there better methods for verifying *.wim contents? [closed]

I'm trying to verify that the contents of a Windows Image are identical for two WIM files; however, I think the timestamps for the file modifications are affecting the final checksums--even though the ...
5
votes
2answers
189 views

Collision resistance of partial SHA-256 hashes XOR'ed

My hashing algorithm computes the SHA-256 for each of 12 input strings and XORs them to get the final hash. Is there a risk of an attacker being able to forge 2 sets of inputs that yield the same ...
0
votes
1answer
80 views

Do I still need SHA256 if I already had a AES 256 key that is 44 characters long?

Several months ago, I was required to research on AES and SHA-256 to make a secured license system for my app. However, I was dumb enough that couldn't distinguish between the 256 bits from AES and ...
-1
votes
3answers
293 views

SHA-256: One input, two different outputs?

I am new to SHA-256. I have discovered that the same input could produce different SHA-256 hash ouputs depending on the (online) device I chose for generating the hash. Is this normal, or is there a ...
0
votes
1answer
55 views

How does sha-2 with fewer rounds work?

The wikipedia page about sha-2 states: Currently, the best public attacks break preimage resistance for 52 out of 64 rounds of SHA-256 or 57 out of 80 rounds of SHA-512 How exactly is the sha-256 ...
3
votes
2answers
144 views

Hashing a hash for authentication

I currently use Argon2 to derive a key (I will use a salt which I will save in a file as plaintext for when I later need to derive a key again) from a given password which I will use to encrypt a file ...
2
votes
3answers
193 views

Suitable 16-bit checksum?

I am writing a toy1 transport protocol and I am trying to implement a feature whereby: A 16-bit checksum is included in every packet. This checksum can be extended to be 48-bit if the data is large, ...
-1
votes
1answer
50 views

Is it possible for a hash in SHA-256 to have more than 8 digits? [closed]

Is it ever possible for a hash to have more than 8 digits in SHA-256?
0
votes
0answers
86 views

Why initialize values and array SHA256 with specific buffer?

Why initialize values and array SHA256 with specific buffer? ...
0
votes
2answers
156 views

How is the hash for a file calculated?

Is the file just read bit by bit to calculate the hash with those values or is there more to it? Are there any resources to read a bit more about file hashing?
2
votes
1answer
122 views

SHA256 message schedule examples

I need some example values for the message schedule stage of SHA256 to test this part of my implementation. If possible in binary, for the string 'abc'.
0
votes
2answers
102 views

For the hash computation of SHA-256, is it computed in parallel or series?

I'm trying to write my own SHA-256 implementation in VHDL, which runs in parallel execution style I have been using this as a reference to the SHA-256 algorithm: https://www.researchgate.net/file....
1
vote
1answer
67 views

ECDSA signature of a random 32 byte number vs. the hash of the number

I'm working on an application that involves signing a 32 byte random number generated by the OS. Assuming the RNG works as intended, is it safe to sign the random number itself rather than a hash of ...
0
votes
1answer
55 views

Bitcoin mining: how is a block header of 80 bytes processed in SHA-256? Isn't it too big?

The whole process of bitcoin mining was making sense to me until a moment of madness an hour ago, if there are 80 bytes of data to be processed in SHA-256, that's 640 bits of data to be processed in ...
2
votes
1answer
106 views

Use a hash-function twice

I'm creating a small messenger and I wanted to know if it makes sense to store user passwords double-hashed in our backend-database. I wanted the user the register in an app, which should save a hash ...
0
votes
1answer
109 views

Is there any Corelation between the SHA256 and SHA512 hash of the same data?

Is there any Corelation between the SHA256 and SHA512 hash of the same data ?
6
votes
2answers
5k views

What is the difference between SHA-3 and SHA-256?

I am new about cryptography, I learned that SHA-3 (Secure Hash Algorithm 3) is the latest member of the Secure Hash Algorithm family of standards, released by NIST....
-2
votes
1answer
87 views

Is it possible to unhash sha256 if you are given the sha256 and unhash of a variable? [closed]

Lets say that $a, b, c$ are variables and you know that $$\operatorname{sha256}(a) = b \\ \operatorname{decrypt}(b) = a \\ \operatorname{sha256}(b) = c \\ \operatorname{decrypt}(c) = b$$ Is it ...
6
votes
1answer
2k views

What does the symbol $W_t$ mean in the SHA-256 specification?

I'm really confused about the computation about SHA 256. $$W_t = \begin{cases} M_t^{(i)} & 0 \leq t \leq 15 \\ &\\ \sigma_1^{256}(W_{t-2}) + W_{t-7} + \sigma_0^{256}(W_{t-15}) + W_{t-16} &...
2
votes
2answers
345 views

How to prove that finding a cycle in a cryptographic hash function is hard?

I want to show that finding cycles in a cryptographic hash function is hard. My thought: assume there a black box, that given a cryptographic hash function $h$, finds some $x$ and $r$ in polynomial ...
1
vote
2answers
164 views

Can i generate a SHA512 hash if i know the SHA256 hash of some unknown data?

if the SHA256 Hash of some unknown data is known ! Can i find the SHA512 of that unknown data ?
1
vote
1answer
309 views

Is SHA-256 OK to use for key derivation for a key that is never persisted?

The scenario: On the one side a user enters a pass phrase to encrypt a stream of data (AES-GCM) and a symmetric encryption key is derived from the pass phrase using plain SHA-256 (so not a slow ...