SHA-256 is part of the SHA-2 family of hash functions with a 256 bit output.
2
votes
2answers
105 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 ...
1
vote
2answers
71 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 prute force, without a noticable ...
2
votes
1answer
164 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 ...
3
votes
0answers
82 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 ...
1
vote
2answers
173 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 ...
0
votes
1answer
39 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 ...
5
votes
3answers
299 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 ...
1
vote
1answer
89 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 ...
0
votes
0answers
207 views
Building a SHA-256 processor using only logic gates [closed]
Is it possible to build a simple SHA-256 circuit using only basic logic gates (no ICs)? I want to do this as a challenge (and maybe find some bitcoins...joke). How may logic gates do you estimate ...
3
votes
1answer
187 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.
6
votes
1answer
194 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 ...
2
votes
2answers
846 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 ...
9
votes
2answers
256 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 ...
11
votes
2answers
1k 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 ...
4
votes
2answers
554 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 ...
4
votes
4answers
264 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 ...
1
vote
1answer
161 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
...
4
votes
2answers
928 views
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 ...
3
votes
3answers
595 views
A simple block cipher based on the SHA-256 hash function
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 ...
3
votes
1answer
130 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 ...
13
votes
4answers
6k 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 ...
10
votes
3answers
1k 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 ...
9
votes
7answers
1k 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, ...
7
votes
1answer
363 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 ...