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.
588
questions
1
vote
1
answer
116
views
Safety when disclosing hashes of secrets used to calculate other secrets
In my application, I am generating a big random number and publishing a SHA256 hash of it. After the hash it published (but not the secret), anyone can submit any number, and the system will calculate ...
4
votes
2
answers
790
views
Does encrypting a hash of the message yield a secure MAC?
Is $mac = enc(hash(x))$ a secure MAC for hash = SHA256 and enc AES in CBC mode or ECB mode. Normally AES-CBC is malleable. But in this case I use a hash function for the one-way property.
For ...
4
votes
1
answer
997
views
Is SHA-256 a one way permutation when restricting the domain to {0,1}^256? [duplicate]
Suppose we consider the space of $\lbrace 0,1 \rbrace^{256}$ as the domain and SHA-256 as our hash function. Does SHA-256 become a one way permutation?
Has anyone tried to prove this? Or can it be ...
2
votes
1
answer
1k
views
How hard/easy will be to break a SHA-1 or SHA-256 hash if the attacker knows part of the original text?
I'm creating an algorithm to hash some text variables (20/30 characters long) to send them across an insecure channel. I'm not dealing with high security data, so no credits card numbers or any other ...
3
votes
3
answers
2k
views
Question regarding multiple SHA-256 rounds on a Bitcoin Brain Wallet passphrase…
I am attempting to come up with a way of memorizing a seed that could lead to any number of brain wallets for bitcoin. I need multiple wallets because a) I don't want all my eggs in one basket, and b)...
8
votes
1
answer
2k
views
Will rehashing an SHA256 hash continually, eventually produce every possible value? [duplicate]
So let's say you had infinite time and energy. You have a hashed string of some sort. Because you have infinite time and energy, you can produce a collision(or the original value) easily enough. But, ...
2
votes
1
answer
720
views
SHA-256 Round Equivalence
I have calculated the average number of operations in 1 round of SHA-256 as follows:
Additions: 9.25
Bitwise Rotations: 9
Bitwise Shifts: 1.5
Bitwise AND: 5
Bitwise XOR: 10
I have certain ...
2
votes
1
answer
1k
views
split up sha256 hash and compare indiv block results
We have a h/w accelerator in our SoC and it can do sha256. The restrictions are it's input descriptors (which defines the input packet and len) must not straddle 64K boundary. When it does we can ...
4
votes
1
answer
14k
views
How is input message for SHA-2 padded?
I read about how is an input message prepared to be hashed by MD4,MD5 or SHA-1:
Step1 Append padding bits
The input message is "padded" (extended) so that its length (in bits)
equals to 448 ...
13
votes
2
answers
4k
views
Efficient Incremental Updates to Large Merkle Tree
I have a data set with 300 Million entries and every 5 minutes 4000 random entries in this table change. I need to calculate the merkle root on this data set to validate integrity multiple times ...
10
votes
2
answers
12k
views
How does SafeNet MobilePASS generate passwords?
We use MobilePASS at work but the latest version of the android client seems to be buggy so I wanted to have a go at implementing the algorithm myself.
You can download the client to play with here: ...
2
votes
1
answer
422
views
Is it possible to derive the midstate of a sha256 hash?
Let's say I have an unknown string with the known sha256-hash of it. I was wondering if it was possible to now calculate the sha256 of the concatenation of the unknown string and "abc".
(In PHP: <...
18
votes
2
answers
9k
views
SHA-256: (Probabilistic?) partial preimage possible?
Currently busying myself with the Bitcoin "mining" algorithm, I am wondering if the process really cannot be simplified.
For reference, the algorithm is basically SHA-256d:
$$\mathit{success} := \...
5
votes
2
answers
4k
views
What does "message schedule" mean in SHA-256?
I am trying to understand the sha-256 algorithm from FIPS 180-2. I understood the padding and parsing of the message string. However after that it states (page 15):
For $i = 1$ to $N$:
{
...
3
votes
2
answers
196
views
Does knowledge of original file size provide a cryptographic weakness?
I'm encrypting files using an AES-256 CBC cipher and an SHA-256 HMAC every 64KB in the file. Since AES CBC needs an amount of input bytes to be divisible by 16, I use PKCS#7 padding to bring the ...
2
votes
2
answers
895
views
Many consecutive hashes to slow down brute force attack?
I've heard that hash algorithms like bcrypt are more secure because they take longer to complete, and therefore take much longer to brute force, without a ...
6
votes
1
answer
8k
views
SHA256 HMAC brute force with chosen plaintext attacks
This is a follow up to Is It Possible To Reconstruct a Cryptographic Hash's Key
I am using a SHA-256 HMAC function on a single-word input: sha256hmac(privatekey,word) = output. The private key length ...
8
votes
1
answer
2k
views
How can scrypt be improved to counter GPU mining
I know scrypt was designed to lessen the GPU/ASIC advantage.
We now have litecoin as a real-world example of this. However, it hasn't worked out perfectly. Most coins are mined by GPUs, although the ...
5
votes
2
answers
8k
views
AES+CTR+HMAC Encryption and Authentication on an Arduino
In my project we would like to encrypt and authenticate the the communication channel between our server and our Arduino nodes, which relies on an underlying TCP channel.
We have chosen AES in CTR ...
1
vote
1
answer
494
views
PBKDF2 when dkLen and hLen have the same size
I was reading RFC 2898 and something is not clear to me. When I use PBKDF2 with SHA-256 and I want a derived key with length 32 bytes (the same length as my hash function output), your derived key ...
26
votes
3
answers
10k
views
"Weaknesses" in SHA-256d?
According to this answer, "SHA-256d" was proposed in one of the Ferguson/Schneier books like so:
SHA-256d(x) = SHA-256(SHA-256(x))
Apparently, the motivation for ...
2
votes
1
answer
3k
views
Hashing a password with SHA256 on the client then bcrypt on the server
I'm trying to implement a cryptographically secured storage site (not Mega, or anything similar) and am trying to prevent the user's password from ever touching the server. The password is used to ...
13
votes
1
answer
8k
views
What does Maj and Ch mean in SHA-256 algorithm?
I'm guessing they're some kind of standard function but what do they do and what do the names mean? A little explaination or link me to an article would be great.
11
votes
1
answer
3k
views
Using SHA-256 with different initial hash value
FIPS 180-3 defines the initial hash value for SHA-256 as the first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19. What would be the risks of using a different value (...
5
votes
2
answers
38k
views
SHA-256 and AES-128
Does it make an encrypted string more secure if I use SHA256(x) instead of x as the secret key for AES-128 encryption? I do know that SHA-256 produces 64 characters of hashed string regardless of what ...
16
votes
2
answers
2k
views
Why is the salt used only once in PBKDF2, while the password is used often?
The purpose of PBKDF2 is to create a derived key (DK) from a master password (PW) and a salt, often using a function like HMAC-SHA256. I have read that the salt should be as random as possible. But ...
60
votes
3
answers
26k
views
"SHA-256" vs "any 256 bits of SHA-512", which is more secure?
In terms of security strength, Is there any difference in using the SHA-256 algorithm vs using any random 256 bits of the output of the SHA-512 algorithm?
Similarly, what is the security difference ...
13
votes
2
answers
13k
views
128 bit hash with least chance of collision?
I'm building a storage system for JSON documents where they are looked up on a 128 bit key. These JSON documents have a timestamp within them, but apart from that are user-entered data. These JSON ...
5
votes
4
answers
371
views
Are derived hashes weakening the root?
Given a root hash
root = H(plaintext)
and two (or more) derived hashes
h1 = H(salt1 + root)
h2 = H(salt2 + root)
would the ...
4
votes
1
answer
2k
views
Can one group the SHA-256 outputs depending on partial inputs?
Is it possible to predict a hash key based on half key?
Let's have some example:
I have 100000000 hash results, and they are generated by either
...
14
votes
3
answers
12k
views
How can I calculate the SHA-256 "midstate"?
Recently I've been trying to implement some Bitcoin-related code, and I've stumbled upon a weird concept, a SHA-256 "midstate". Some explanation is given here.
The general concept is that Bitcoin ...
7
votes
3
answers
3k
views
A simple block cipher based on the SHA-256 hash function [duplicate]
I've come up with this little routine for doing encryption using the SHA-2 (in this case SHA-256) hash function. As such it is a block cipher with a 256 bit (32 byte) block size and an arbitrary key ...
4
votes
1
answer
547
views
Does hash_df use binary or an ASCII hexadecimal representation for numbers to be passed to the hash function?
I'm implementing the HASH_DRBG algorithm.
As per NIST-SP800 90 document for HASH DRBG Generation, section 10.4.1 "Derivation Function Using a Hash Function (Hash_df)", the Hash_df algorithm contains ...
42
votes
4
answers
41k
views
Best way to reduce chance of hash collisions: Multiple hashes, or larger hash?
I would like to maintain a list of unique data blocks (up to 1MiB in size), using the SHA-256 hash of the block as the key in the index. Obviously there is a chance of hash collisions, so what is the ...
15
votes
3
answers
6k
views
At the current time, is SHA256 the de facto standard for strong cryptographic hashes?
At the current time, is SHA256 the de facto standard for strong cryptographic hashes?
From what I am seeing of more sites utilizing it, I would suppose the answer to this is yes, but would like to ...
60
votes
3
answers
13k
views
Hashing or encrypting twice to increase security?
Over on the bitcoin forums I asked why the bitcoin client computes SHA-256(SHA-256(x)) as its cryptographic hash for a variety of purposes. The leading theory--since the bitcoin author has disappeared-...
28
votes
7
answers
11k
views
Is calculating a hash code for a large file in parallel less secure than doing it sequentially?
I would like to improve the performance of hashing large files, say for example in the tens of gigabytes in size.
Normally, you sequentially hash the bytes of the files using a hash function (say, ...
33
votes
1
answer
8k
views
Should I use the first or last bits from a SHA-256 hash?
I have the need for a hexadecimal token that is smaller than the normal length of the hexadecimal representation of a SHA-256 hash.
Should I take the first bits or the last bits? Which of them ...