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
0
votes
2answers
100 views

How to pad a 448 bit message for SHA256?

I recently implemented a very simple SHA256 hashing program in C++, since the SHA256 hash function's block size is 512 bits or 64 bytes, and messages less than that size have to be padded as per the ...
2
votes
1answer
53 views

SHA-256 security for initial 32 bits

I have concerns regarding truncated SHA-256 hashes in an application I am building at the moment: Nomenclature secret - the full 256-bit SHA-256 result of hashing ...
3
votes
1answer
55 views

If I allow arbitrary initial hash values for SHA-256, what would be the weaknesses?

The initial hash values (IV) of SHA256 are fixed. However, let's say I modify the SHA256 hash function to allow the attacker to use arbitrary IVs rather than fixed IVs. What kind of weaknesses would ...
0
votes
0answers
16 views

Does every 256 bit number have a distinct sha256 result? [duplicate]

If I were some how able to create a table of all 256 bit inputs and outputs of sha256, would each of the inputs have a distinct output?
4
votes
2answers
1k views

Is it safe to convert a 256-bit nonce into a 192-bit nonce by SHA-256ing and then truncating it?

I'd expect a 192-bit nonce derived from a 256-bit nonce by computing the SHA-256 hash and then truncating it to 24 bytes to behave like an approximately uniformly randomly generated 192-bit nonce and ...
1
vote
1answer
47 views

Can I retrieve a re-hashed (hash) value, for instance by additional hashing?

I have a double-SHA-256 of some text $$ h_2 = \operatorname{SHA256}(\operatorname{SHA256}(m)).$$ I don't need the plain text ($m$), but somehow I need to get first $$h_1 = \operatorname{SHA256}(m).$$ ...
1
vote
1answer
59 views

If I concatenate two colliding SHA-256 messages with the same prefix and suffix, will the resulting hash output still collide with each other?

So let's say that there are two messages, $x_1$ and $x_2$, which hash to the same output. In other words, these two messages collide with each other: $$\operatorname{SHA256}(x_1)=\operatorname{SHA256}...
1
vote
1answer
127 views

Problem understanding SHA-256

I'm reading this paper: fips180-4-draft-aug2014 I'm on page 23 where they have two values for SHA-256: T1 and T2. While I understand the operations done, I don't understand the bigger picture. Why ...
1
vote
0answers
35 views

Does fixing partial bits of a SHA256 hash increase the probability of finding a preimage using the meet-in-the-middle attack?

Let’s say I want to find a partial rather than full preimage using the meet-in-the-middle attack. For example, my goal is to find a preimage so that the first 76-bit output of the hash are all ...
1
vote
1answer
42 views

Difference between MAC(key, msg) and SHA(key || msg)

I know that SHA(key || msg) is vulnerable to string concatenation attack. However, what if we specified key bit-length and msg bit-length? For example, key bit-length is 256 bit and msg bit-length is ...
2
votes
1answer
102 views

Finding the IV values of SHA-256 given all message blocks

Given all message blocks $w[i],i \in 0:63$ and assume that $n<128$ (arbitrary) bits $x_1,x_2,...,x_n$ of the IV values are unknown (e.g., $h_7$ bits are unknown) while other IV values coincide with ...
2
votes
1answer
77 views

Does double hashing increase resistant against first preimage attacks?

Let's take Bitcoin as an example. Bitcoin uses SHA256, which can be vulnerable to collision and preimage attacks - although this is extremely unlikely to happen in the near-future. However, let's ...
8
votes
1answer
418 views

“official” guidelines about the minimum length of a truncated hash

I am looking for some reference documentation suggesting a minimum reasonable length for a truncated hash (specifically, a truncated SHA-256 hash) to ensure preimage resistance. Obviously, truncating ...
1
vote
1answer
98 views

Scrypt KDF cipher (scrypt CLI) - known vulnerabilities and cryptanalysis?

There is a scrypt cipher that is used for example by some cryptos like LItecoin for their mining algorithm. I never heard of scrypt. I know eg SHA-256 which is well analyzed and considered as secure ...
0
votes
1answer
66 views

Does hashing a hash of a password over and over again increase its security?

I've heard of password cracking attacks using a list of commonly used passwords. Suppose in my situation, I can never be sure about the strength of the password, that a user inputs to my interface. So ...
10
votes
1answer
215 views

Minimizing exchanges for ZK proof of a message with given SHA-256

Consider the problem of proving knowledge of a message $m$ which has a certain public SHA-256 hash $h$, without disclosing $m$ or usable information about it, while minimizing the information exchange ...
1
vote
1answer
24 views

Does concatinating mutliple digests of hashes from CSRN result in a CSRN?

Kind of a noob question. Suppose; We generate 1,000 cryptographic-ally secure random numbers & store each of them in an array1. For each number in this array1, we take the hash sha256(CSRN) then ...
1
vote
1answer
179 views

What is the use of encoding a hash output?

In many applications, the MD5 algorithm is used which produces a 128-bit output which is represented as a sequence of 32 hexadecimal digits. This output is further encoded using a base62 or base64 ...
2
votes
1answer
87 views

Partial key reveal for SHA-256 hash

Let's say I have a message 0123456789abcdefghijklmnopqrstuvwxyz which gives me the SHA-256 hash ...
1
vote
0answers
95 views

Idea behind internal SHA-2 functions

In the SHA-2 family, specifically SHA-256, there are functions called Sigma0 and Sigma1, which look like this: ...
2
votes
1answer
68 views

Is iterative sha256 adequate for local password manager?

I'm fairly entry-level crypto; not a cryptographer by any stretch... I am at the level of ability to implement most of the traditional packages in python; the hashlib hashes and EAS, ECDSA ...
4
votes
2answers
198 views

“One-Wayness” of SHA 1

I recently started learning about Hash Functions for my first time, and I've gone through and have tried to understand the SHA1 process. Brilliant does an excellent job of explaining it step by step. ...
1
vote
2answers
144 views

Read the result of the hash by SHA-256 as a number

I want to read the full output hash of SHA-256 as a number. How I can do it? Is it in the range of 0 to 2^256?
6
votes
1answer
115 views

Do a 160-bit SHA-1 hash and a 160-bit slice of a SHA-256 hash have the same strength in terms of collision-free?

Take OpenPGP fingerprint for example. If the 40-digit hex standard remains unchanged, would it be helpful to upgrade SHA-1 to SHA-256 (but only taking the last 160 bits), in terms of reducing the risk ...
0
votes
1answer
327 views

SHA256 output to 1-6 number range?

I want to calculate a random number (1 to 6) from the output of sha256. Can I assurance the probability of 6 abilities is the same?
0
votes
2answers
89 views

If all encrypt algorithms in TLS1.3 ciphersuites are AEAD , why do they keep including a Hash algorithm?

In TLS1.3 all allowed algorithms included in cipher suites are AEAD, which means they don't just encrypt but they authenticate too (thus if I don't misunderstand, they give not only confidentiality ...
5
votes
2answers
248 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
75 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
104 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
151 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
40 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
30 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
76 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
333 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
162 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
52 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 ...
8
votes
1answer
642 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
57 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
192 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
157 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
270 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
102 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
322 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
178 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.
87
votes
4answers
12k 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
99 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
79 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
176 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
159 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 ...
6
votes
5answers
512 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?

1
2 3 4 5
8