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
6
votes
1answer
249 views

Security consequences of HMAC(m, K) instead of the correct way HMAC(K, m)

I am wondering what is the security loss or consequences of accidentally misusing an HMAC API library in this context: Regular, correct HMAC: ...
5
votes
3answers
1k views

If a SHA256 hash with high entropy is then hashed with one made from low entropy, is the resulting hash higher/same/lower entropy?

If one were to create a SHA256 hash using 256 coin flips converted to hex (which, as I understand it, is as "entro-phized" as one can capture in SHA256) then take that hash as a string, combine that ...
3
votes
1answer
2k views

SHA256 and RIPEMD160 collisions

H = ripemd160(sha256(ECMultiply(A,G))) A - 32-byte number, H - 20-byte number, ...
1
vote
1answer
2k views

SHA-256 by hand

Yes, it would take days. I am not in a rush, nor trying to solve any problem...I just like Maths. There is a video floating around (citation/source to come) of someone doing the first round of SHA-...
-2
votes
1answer
269 views

Is it known what input for sha256 would yield the same result as no input?

As the title says: do we know already for sha256 what input would yield the same output as when using no input at all?
1
vote
2answers
300 views

Is a MAC a valid way to ensure tamper-resistance?

According to some government standards I need to be able to ensure some data in a database has not been tampered with. My current idea is to store a MAC (HMAC-SHA256) next to each instance of the ...
6
votes
2answers
664 views

Are tags longer than 128 bit possible for AES-256-CCM and AES-256-GCM?

I have an existing application that uses AES-256-CBC for encrypting data blocks, and HMAC-SHA-256 on the plaintext for eliminating duplicate data blocks. For performance reasons, I would like to move ...
15
votes
2answers
10k views

How fast can a SHA-256 implementation go?

I'm looking for high-speed SHA-256 implementations, and specifically, ones with low latency; that is, the time between when you submit the message block, and when the output (or internal state) is ...
1
vote
1answer
843 views

Has a SHA256 output ever been found consisting entirely of the same character?

Is it possible to have an output consisting purely of one character and does this change the entropy of that output? (If that's even possible to ascertain.) As an example, the Bitcoin cryptocurrency ...
-4
votes
1answer
476 views

I am not convinced that SHA2/3 or AES256 is secure

I have been researching cryptography for the past few weeks to try and make sense of a few things, but is simply not making any sense for me. If I encrypt a message, send it to another computer, how ...
1
vote
1answer
185 views

SHA256 IVs / NUMS numbers

I've read that if the IVs for SHA256 were arbitrary and / or unknown (secret) than a backdoor to predict outputs would be possible. How do the values chosen for the IVs / publishing the values ...
2
votes
1answer
244 views

Using negative values / unsigned integers to implement SHA-2

What happens if we allow implementation of SHA-2 using negative values? What happens if a negative value was used in the first round? Would the algorithm still result in a secure value? I have a ...
-3
votes
1answer
1k views

BigInteger imlementation requirement for SHA-256

Which BigInteger is needed for implementing SHA-256? SHA-256 has 64 hex symbols as output. I could use the data structure "string" to calculate the SHA-256 or a BigInteger. Do I need ...
25
votes
1answer
7k views

Why hashing twice?

I'm trying to understand the Bitcoin protocol, and sometimes see instructions like this: The TransactionId is defined by SHA256(SHA256(txbytes)) or The hash of the public key is generated by ...
2
votes
1answer
2k views

SHA256 Collisions

If we take every possible hash ($16^{64}$) and rehash it, the amount of possible outcomes for any given rehash is 1 out of $16^{64}$. So, all possible rehashes is equal to all possible unique hashes. ...
-1
votes
1answer
396 views

SHA256 - Which is less impossible?

To generate every possible hash would be ... impractical. To work backwards from any given hash is also incredibly labor intensive. Of the two, which is less impossible? Why?
4
votes
1answer
588 views

Finding the IV values for SHA-256

I should start by saying this question has little to no practical application. It is purely recreational. I am not trying to solve a specific problem, beyond "I wonder…" If I had an initial input (...
9
votes
2answers
584 views

Is there a guarantee that for each possible hash y there exists a number x such that with hash function H, H(x) = y?

Specifically talking about SHA-256 here and its involvement in Bitcoin, this was a question someone asked me which I didn't know the answer to. Yes, I am aware that SHA-256 can only have a hash from $...
3
votes
1answer
250 views

Prove you computed $hash^r(input)$ for some cryptographic hash function

What is the most efficient way to prove that a person computed $r$ rounds of some cryptographic hash function (ex. SHA256) on an input? Specifically, I'm trying to optimize (1) the running time of the ...
2
votes
1answer
300 views

Is there a security risk associated with using a PBKDF for an AES encryption key and Sha256 for a hash using the same password text?

I am writing an encryption program using C#. My goal is to secure files even if the computer is stolen and somehow logged into. Assumptions The code used to write the program is visible to a ...
29
votes
2answers
7k views

Fixed point of the SHA-256 compression function

SHA256 Free Start Self Collision (Full 64 rounds) IVec: 72BF9EF1 27B82DFB F298F3B7 22B6C32C 18A54860 4C032D91 ADD7B85B 7ED1A4AC Block: ...
2
votes
1answer
2k views

What makes a hash like SHA1 resistant to collisions?

I have been reading about SHA1 and SHA256 and how they actually hash a string of text to a unique hashed message. But what I dont understand is what makes them resistant to collisions. Whats the ...
3
votes
2answers
1k views

How long to wait to feed hashing using SHA 256?

I have a source which generates secrets at $8-10 bits $ per second. I need to use this secret to feed another generator every second. I am wondering how long should I wait while I am concatenating 8 ...
5
votes
2answers
3k views

Explanation of CAVP format for NIST Test Vectors for SHA-2 and 3

I want to run the SHA2 and SHA3 NIST algorithm test vectors provided in the zip files at the bottom of this page: http://csrc.nist.gov/groups/STM/cavp/secure-hashing.html#sha-2 I don't quite ...
1
vote
1answer
1k views

Must a key for a HMAC-SHA256 digest kept secure?

I need to check integrity of high secure system value - in this case encryption key(s) I would like to create HMAC digest of this user encryption key (key is used ...
61
votes
1answer
60k views

Why haven't any SHA-256 collisions been found yet?

I've been thinking about this for a few days, a SHA-256 algorithm outputs 64 characters which can either be a lowercase letter or a number from 0-9. Which should mean that there are 64^36 distinct SHA-...
0
votes
1answer
775 views

Concatenating a hash function for generating one hash for multiple files

Assuming we use SHA256 as hash function. In practice you see that a Merkle tree is used to concatenating multiple hashes together to one single root hash. A Merkle tree is a binary tree which always ...
7
votes
1answer
1k views

Why does LastPass hash their passwords with PBKDF2 this way?

LastPass is a password manager that I am sure many of you are familiar with. I have been studying LastPass's source code a bit. From their FAQs and what I can gather from their source code, the way ...
8
votes
1answer
768 views

Why does SHA-2 call for doing 10* padding in addition to appending the message length?

Appending the length of the message when padding of a SHA-2 message is sufficient to satisfy the Merkle-Damgård construction. However the padding in SHA-2 also pads with 10* between the end of the ...
1
vote
1answer
3k views

How long would it take for a sha256 digest loop to reach the original hash or start cycling? [duplicate]

If I started with a sha256 hash such as 3f46fdad8e5d6e04e0612d262b3c03649f4224e04d209295ef7de7dc3ffd78a7 and rehashed it continuously (without salting): i) What ...
1
vote
1answer
4k views

How should a string be converted to a number for use by a hash function? [closed]

After reading this question/answer I thought I'd try and implement the SHA-256 for my own education. My initial thought for converting the input into a number was to use a line of code like ...
8
votes
1answer
5k views

Should I use SHA256 or Blake2 to checksum and sign scrypt headers?

I use scrypt as a key derivation function (not to store passwords). To pass around the detached key header I use the standard encoding as implemented in Colin Percival's scrypt implementation (...
3
votes
1answer
404 views

Preimage attack given half of the preimage

512 bit X has been hashed using SHA256(X) = Y Given Y and half of X (the first 256bits) to attacker, how hard is to reveal whole X Can SHA256 or any real world function be cracked to allow this ...
9
votes
1answer
460 views

Are there any security issues when replacing the SHA-256 initialisation values?

As RFC 4634 describes in section 6.1, SHA-256 is initialized using eight 32-bit words. These were obtained by taking the first 32 bits of the fractional parts of the square roots of the first eight ...
2
votes
1answer
1k views

SHA-256 support for SecretKeyFactory in Java 6 and 7?

According to the following linked Java documentation, the relevant option for SecretKeyFactory algorithm (ignoring deprecated options involving MD5 or DES etc.) running in JRE 6 and JRE 7 is: ...
3
votes
1answer
605 views

Can a self-signed certificate's signature algorithm be changed?

I've a large number of self-signed certificates that are currently being used by multiple clients which were signed with the SHA1 ('SHA1WITHRSA' as it appears in the cert) algorithm at the time they ...
5
votes
1answer
6k views

What Are Advantages and Disadvantages of SHA-256?

I'm a newbie to Cryptography. I'm learning about SHA-256 hash function now and I wish to have an overall look on it. What are its advantages and disadvantages comparing to other hash functions, like ...
1
vote
0answers
42 views

Number of unique outputs in hash function (SHA256) against all possible inputs [duplicate]

If I use SHA256 as a hash function, and I try all inputs starting from 0 to 2^256 (means all possible combination of 256-bit), then will it give me 2^256 unique output without any collision? Or ...
38
votes
2answers
12k views

How does hashing twice protect against birthday attacks?

The bitcoin wiki says: Bitcoin is using two hash iterations (denoted SHA256^2 ie "SHA256 function squared") and the reason for this relates to a partial attack on the smaller but related SHA1 hash. ...
1
vote
1answer
270 views

I want to know difference of calculation cost between SHA(hash) and AES(reversible encryption)

I want do detect illegal modification of a string by using HMAC-SHA256 or AES/CBC/PKCS5Padding, with low calculation cost. Which is the best answer? I plan to save data in a DB with one of the ...
12
votes
1answer
389 views

Does SHA-512 leak info about SHA-256?

Does the SHA-512 value of an input leak any information about the SHA-256 value of that same input? Specifically, if I'm using SHA-512 to derive encryption and HMAC keys from a 256 bit ECDH shared ...
1
vote
1answer
651 views

Key shortening for hmac sha256

For learning purpose, I'm trying to implement HMAC using SHA256. In the pseudo code proposed in Wikipedia, the algorithm first focus on how to shorten or expand the key : ...
1
vote
1answer
617 views

SHA-256 Hashing problem from binary values

For a school project we have been given some example hexadecimal numbers to hash like the following: ...
2
votes
1answer
3k views

What inputs can SHA 256 take?

I'm a complete cryptography beginner and I'm interested in the cryptography behind Bitcoin, hashing, key cryptography etc. I suspect that SHA-256 can only take Alpha-Numerics but I was wondering if ...
1
vote
0answers
93 views

SHA-256 digest space [duplicate]

SHA-256 is a well know hash function that creates digests of 256 bits. This means that the size of the digest space is 2^256 (or at least it should be), ie, the range of the digest space is: from <...
1
vote
0answers
293 views

Handling key invalidation

I'm writing an Android app which will need to store some data for the user as a byte array of unknown length. The data must be encrypted. I have gone down the path of the hardware-backed keystore and ...
3
votes
1answer
207 views

Why don't I see the IV in the FINISHED fragment in TLS_RSA_WITH_AES_256_CBC_SHA communication with OpenSSL?

I'm implementing a TLS 1.2 server, comparing against OpenSSL to ensure I'm getting things right, and I've noticed that when the cipher is TLS_RSA_WITH_AES_256_CBC_SHA the IV isn't in the FINISH ...
4
votes
1answer
3k views

How to generate the SHA-2 constants?

The SHA spec states - eg, in the case of SHA-224 and SHA-256 - that the constants "represent the first 32-bits of the fractional parts of the cube roots of the first 64 primes". How are these values "...
13
votes
1answer
8k views

Is there any benefit from using SHA-512 over SHA-256 when AES just truncates it anyway?

I am still not very clear on how AES-256-CBC can use SHA-512 bit keys, but I assume that it just truncates the 512bit hash down to 256bit. In software like GnuPG and OpenPGP, is there any real benefit ...
4
votes
3answers
1k views

HMAC-SHA256 for hashing of credit card PANs?

Assume you had no option (really) but to store thousands of credit card PANs in a file. You do not need to decrypt them ever, but you do need to use it for checking if a given (new) PAN exists in ...

1
3 4
5
6 7
9