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

learn more… | top users | synonyms (1)

2
votes
1answer
29 views

Hashing entropy with only 128 bits of internal state

I am looking to implement the Fortuna algorithm (https://www.schneier.com/fortuna.pdf) on a system with very restrictive memory constraints, using AES-128 as the underlying cipher. As the key size is ...
2
votes
1answer
37 views

Is a 256 bit HMAC-SHA256 key compromised if the tail is used for identification?

Using a truncated hash of a key seems to be a safe way to identify the key (i.e. key fingerprint), but what about truncating a key itself in the case of HMAC-SHA256? Example: ...
0
votes
1answer
42 views

How does the HOTP dynamic truncation function generalize to longer hashes?

HOTP, the HMAC-based One-Time Password algorithm from RFC 4226, uses a "dynamic truncation" function to turn the 20 byte HMAC-SHA-1 value into a 31 bit string. The dynamic truncation (from Section ...
3
votes
2answers
64 views

Chopping off SHA256 entropy?

I have a NoSQL key-value database. I want to insert couple million of records to it. For the key generation, I'm, using a prefix (something like data-one-) and ...
0
votes
0answers
7 views

How to correctly convert TAG value to the right format so that to Verify HMAC? [migrated]

I'm working on HMAC generation and verifying to check data integrity. I can correctly generate the MAC value but when sending it through socket to another program for verification, I faced with ...
0
votes
1answer
115 views

How to crack SHA256 only letters

I recently created a program that hashes a password using SHA256 and potentially using salt. How can I crack that if I know that the password only contains lowercase letters?
2
votes
2answers
272 views

AES + CBC encryption for a stream of UDP packets

I am developing an application that is based on UDP, and I need to send a stream of packets. As you can imagine, packets can get lost or corrupted. I need to make sure that the content of those ...
5
votes
2answers
303 views

SHA-256 exhaustive search

How do I calculate the number of computations needed to break SHA256 in case we are using it for safely storing passwords (together with a salt)? Are there any formulas that can be employed? For ...
1
vote
1answer
45 views

Can I use HKDF to improve security of HMAC used with weak hash function?

I am writing a framework which encrypts/decrypts files (or streams, in general) with symmetric key using block cipher (for example, AES). To authenticate encrypted file, I use HMAC, which is ...
17
votes
3answers
3k views

SHA512 faster than SHA256?

I'm getting this strange result that SHA512 is around 50% faster than SHA256. I'm using .net's SHA512Managed and SHA256Managed ...
2
votes
2answers
69 views

SHA256_HMAC for deriving session keys using a counter

I need to generate some session keys from a master key that was generated from an ECDH key exchange. The master key is 256 bits and I need 256 bit sessions keys. Is it safe to use SHA256_HMAC with ...
-3
votes
1answer
67 views

SHA-256 hash of null input?

What is the SHA-256 hash if the input is null, i.e. an empty bitstring? (Not the hash of 0 or "0".)
2
votes
0answers
65 views

DPA Attack on HMAC SHA-256

I have read the paper Differential Power Analysis of HMAC SHA-2 in the Hamming Weight Model and I want to understand the DPA Attack. In section 3.2.1 Path 1 (page 4) there is written: The last ...
2
votes
1answer
95 views

Hash length extension attack - SHA256 to 512 - impossible, correct?

Just want to be sure about something before I sign off on a method we're about to put into place. We have a secret, to which a user-defined key is appended. The user can see the SHA256 hash of the ...
1
vote
1answer
75 views

The difference in size between ECDSA output and hash size

So if I use secp256k1 for example, I've got my key size of 256 bit, and say I sign a SHA256 hash of a message, with size 256 bit, I get an output of size 512bit. Why is there a difference between the ...
0
votes
2answers
127 views

DH with AES - is that an acceptable security scheme over UPnP?

I'm trying to devise a good security scheme to protect comms over Wi-Fi. Right now, I have 2 devices that already communicate via UPnP but I need to secure this communication. I've come up with this: ...
2
votes
2answers
192 views

PGP digital signature vs SHA256 HMAC Comparison

First let me admit that I am not a mathematician or a cryptographer. I am responsible for assisting in making a recommendation on a project that is consolidating payment processes within a company's ...
2
votes
1answer
188 views

How does ROTL work?

what does ROTL stand for? I know it does left shifting but what about the acronym? When we do a left shift, do we take the leftmost bit and add it at the end, by making the second bit the first, and ...
1
vote
1answer
65 views

SHACAL-2 vs. AES as underlying block cipher for Secure Hash (aka SHA-256)

The hashing scheme SHA-256 (for instance) is based on Merkle-Damgard construction with the underlying compression function based on the block cipher SHACAL-2 configured in Davies Meyer mode. SHACAL-2 ...
1
vote
1answer
74 views

What is SHA-256 in Conjunctive Normal Form?

What is the conjunctive normal form (CNF) representation of $\text{SHA-256}(m)=h$, where $m$ is of fixed (or bounded) size and $h$ is 256 bit?
0
votes
1answer
91 views

Using HMAC SHA256 to protect payment files in local trusted network

in a project that I am working on we have been tasked with eliminating PGP while providing sufficient security to protect payment files only within the Company's trusted network. We arrived at HMAC ...
0
votes
2answers
70 views

Integrity compromised - HASH modified

As we are all aware that HASHing is user to verify integrity in cryptography. I have a query about hashing. Suppose a man in the middle attacker manipulates the data and creates new HASH (by running ...
6
votes
3answers
202 views

Is there a way to use bcrypt with passwords longer than 72 bytes securely?

From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? Or is this ...
1
vote
1answer
132 views

Probability of SHA256 Collisions for Certain Amount of Hashed Values

I wonder if you can help me figure out that question: Is there a known probability function f: N -> [0,1], that computes the probability of a sha256 collision for a certain amount of values to be ...
6
votes
1answer
277 views

The effect of truncated hash on entropy

Suppose i have a 128 bits random binary string (128 bits of entropy), then i hash it using SHA-256, then i take the first 128 bits of the output hash. Does the taken bit string still have (almost) 128 ...
1
vote
3answers
121 views

Cycles in SHA256

In the recommendations, it seems cycles is used usually as in "CPU Cycles", but, that's not what I mean here. What I mean, is this: Let's say I start with a particular 256 bit value. Call this v. I ...
-1
votes
1answer
92 views

Should I remove these use cases of MD5/SHA1 from my program?

I have a web app (a register and login system) written already but i am now improving it. One of its design goals was high security. I have some use cases of md5 and sha1 in it and now i am in doubt ...
1
vote
1answer
118 views

Replacing the PRF in PBKDF2 with Keccak

I am unable to find a reliable, tested library for a decent password based key derivation function e.g. Scrypt in the programming language I am using, but I have a reliable library for PBKDF2 (which ...
3
votes
2answers
99 views

What practical uses can random hash collisions be put to?

Using magic, I've built a machine that instantly generates hash collisions. To try it out, I set the dial to SHA256 and typed in "e7cf3ef4f17c3999a94f2c6f612e8a888e5b1026878e4e19398b23bd38ec221a". I ...
4
votes
2answers
139 views

Signing Files vs. Signing File Hashes

What are the security pitfalls that may occur by signing a list of file hashes, versus signing individual files? In short, the security trade-offs between: ...
0
votes
1answer
70 views

If you know the messages, and the results of HMAC(key, message) can you find the key?

If the attacker has 1 billion 4KB (random-noise) messages and sha256-HMACs for those messages (all using the same key), can they calculate the key that was used, before the universe dies?
1
vote
1answer
82 views

Is the result of HMAC-sha256 distinguishable from random noise?

Is if the result of HMAC-sha256 distinguishable from random noise? If so, given: a collection of 1000 keys, and 1000 messages of random noise, 100 signed by each of only 10 of those keys Can ...
0
votes
1answer
65 views

FIPS-Compliant SHA2

I want to use SHA-512 for hashing in a system that must be FIPS-compliant. When I look at the FIPS 140 list of approved providers, I don't see SHA from any provider as being an approved algorithm, I ...
0
votes
1answer
255 views

How to implement HMAC SHA-256

I am trying to figure out how the HMAC SHA-256 hashing algorithm works. I know that we have to use the following: H (K ^ opad)|| H ((K ^ ipad)|| text)). The ...
0
votes
1answer
175 views

Help converting sha256 to 32-bit stream

I need some help with hash value calculation. I am a bit confused by this statement that I found on w3 website on calculation of a DigestValue for xmldsig ( ...
0
votes
2answers
149 views

Voting system validation

I'm developing an application to run elections. A voting system. I would like to give the ability to the voters to check later if their vote were correct computed/casted. assumptions: each user has ...
2
votes
2answers
287 views

Can RSA signing be implemented on top of RSA encryption/decryption?

I need to use RSA-SHA256 signing. Unfortunately not all Microsoft CryptoAPI providers support that. It's possible that I might get a handle to a CryptoAPI provider that can just encrypt/decrypt with ...
2
votes
3answers
329 views

Any weakness when sha256'ing output of sha256, repeatedly?

Is it significantly easier to reverse a sha256 hash if you know that the input was a 32 byte output of sha256? I assume for most outputs of sha256 there will be zero, one or two possible 32 byte ...
3
votes
1answer
66 views

Is using SHA256 to extract entropy from a p-rand nonce a good way to create keying material?

Using $SHA256(N)$, where $N$ is 64 bytes of output from the Microsoft Windows CryptGenRandom function. Are there any known vulnerabilities with using this method to ...
-1
votes
1answer
163 views

Is XORing a SHA256 better than truncating it? [duplicate]

Let say I want to truncate SHA256 to 128 bits. What would be the best way to minimize a probability of a collision and improve collision resistance? Taking the last 16 bytes Taking the first 16 ...
2
votes
1answer
139 views

Are there any cryptographic flaws in my webhook signing process?

Out of band my services have exchanged secret keys. These secret keys are then used to prevent two things of the webhooks (HTTP calls triggered by Service A to Service B when an event occurs in ...
4
votes
1answer
133 views

Session-specific Symmetric Key Derivation Using SHA256

I was wondering if there were any security implications of deriving session keys from a symmetric key using SHA256 in the following manner: $Ks = SHA256(Nonce||K)$, where $Nonce$ is the session ...
2
votes
2answers
357 views

SHACAL in SHA-256

I was reading about hash functions, namely SHA, and I read that it is made of the Merkle-Damgard construction. And then the text said that the compression function used is based on the Davis-Meyer ...
3
votes
2answers
895 views

ECDSA with SHA256 and sepc192r1 curve: Impossible, or how to calculate $e$?

I need to use ECDSA as the signing algorithm and SHA256 for hashing the message. I'm running into troubles verifying the signature calculated on two different platform (one is BouncyCastle, another ...
3
votes
1answer
340 views

KDF based on HMAC-SHA-256

Is KDF based on HMAC-SHA-256(Hashed Message Authentication Code, Secure Hash Algorithm) algorithm a suitable option to generate symmetric key from the secret key? What is the basic funda, behind ...
4
votes
3answers
301 views

SHA256 output to 0-99 number range?

Is it mathematically possible to take a SHA256 hash and turn it into a 0-99 number where each number in 0-99 range is equally likely to be picked? As a 256 bit hash means the highest value possible ...
5
votes
1answer
405 views

Is SHA256 good enough to shrink a key?

I have a key that is the combination of two shorter keys generated by PBKDF2, which together are long more or less 64 bytes. Now I need to shrink it down to 32 bytes and I'm not sure what to use to do ...
1
vote
1answer
197 views

Where do I truncate the bits in SHA 256 hash algorithm?

I'm implementing SHA-256 in PHP using strings. Where do you truncate in the algorithm? There are a lot of places where there's binary addition happening so the number of bits in $W(i)$ keep ...
4
votes
2answers
120 views

Does knowing multiple hash of the same content make it more likely to generate original plain text?

Say I'm trying to brute force the original plain text of an SHA256 hash, does knowing the RIPEMD160 hash of the same text help? In other words, does providing access to hash values of the same text ...
3
votes
1answer
378 views

AES VS PRNG+HASH+XOR

I was thinking of doing symmetric encryption using just hashing and simple XOR encryption. It would work as: Alice and Bob share a symmetric key Alice manages to send an (authenticated) IV to Bob ...