What's the deal with Deno? We talk with a major contributor to find out. Listen now.

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
5
votes
1answer
703 views

Is it problematic to use PBKDF2-HMAC-SHA256 to derive a 512-bit XTS key?

PBKDF2 should only be used to generate a larger output than the hash function it uses if the output is used in such a way that it has a flat keyspace. As far as I am aware, XTS does not have a flat ...
11
votes
1answer
7k views

Are hash functions strong against quantum cryptanalysis and/or independent enough of mathematics?

I work on ethereum and other blockchain technologies. And seeing that quantum pc's are someday going to see the light I have some questions / doubts. I was wondering if hash functions are strong ...
3
votes
1answer
3k views

AES-CBC then SHA vs AES-GCM for encrypting and authenticating a web token

I am trying to have something like JWT but kinda ad hoc and encrypted. The token itself is simply a stringified JSON that contains the user ID and Unix timestamp. Now, I tried to use AES-128-GCM, ...
-4
votes
1answer
97 views

How to reversely compute from hash [closed]

What are practical methodologies to derive the following ciphertext: 1bd0d370b262d748b21c40cc7e5746642b4c06079a224c65e443e429289753c2
0
votes
2answers
782 views

What would the implications be of a single randomly discovered SHA-256 collision? [closed]

Imagine if someone messing around with hashes accidentally came across two inputs to SHA-256 that produced the same output. Not a concerted effort, not Google/NSA or crypanalysis. No tin foil hats. ...
-1
votes
1answer
469 views

How are multiple iterations of SHA-256 handled for longer inputs?

I wrote a python program to perform the SHA-256 function. It works just fine until I try to hash longer strings. If I hash (in HEX) ...
2
votes
1answer
441 views

Why is modulo being used for congruence in SHA-2 padding when the outcome is always the same?

I am reading up on SHA-2 algorithms and I came across this paper: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf In section 5.2.1 it talks about the formula for padding a message. There ...
32
votes
4answers
32k views

How can hashes be unique if they are limited in number? [duplicate]

I'm curious, how can for example SHA-256 be unique if there are only a limited number of them?! For clarification: how many MD5 hashes are there? $16^{32}$ MD5 hashes can be produced. $16^{64}$ SHA-...
0
votes
1answer
3k views

Generating AES-256 Private Key from user string

So I wish to encrypt a string using AES-256 and want to provide the user to specify the password for unlocking the string. I plan to use sha-256 to hash to users entered password and use this as the ...
0
votes
2answers
728 views

In a very simplistic and step by step example, how do I get the 'w' values for SHA256?

I've been to https://docs.google.com/spreadsheets/d/1mOTrqckdetCoRxY5QkVcyQ7Z0gcYIH-Dc0tu7t9f7tw/edit#gid=1194752368, http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and-paper.html, and https:...
0
votes
1answer
1k views

MAC size 128 bits or more?

Just a quick question: I've seen implemented BouncyCastle's class AeadParameters with MAC length of 128 bits, which was allegedly recommended. Though when I looked up HMac to implement my own MAC in ...
2
votes
2answers
2k views

Why SHA-256 (or any other) is too fast for passwords but “slow” for collisions to be found?

Normally, the standard answers of why passwords shouldn't be stored using a groups of hash algorithms, including SHA-256 or higher, even if salted, are "because they are 'fast' hashes", "the attacker ...
0
votes
1answer
89 views

SHA algorithim with different hash value

I am new in hash cryptography. I am trying to build the sha256 hardware accelerator. I am thinking about using the different hash value to optimize the performance. I am trying to fetch custom hash ...
1
vote
2answers
295 views

Optimal way to bind two hashes

Currently I have: H1 = SHA256 H2 = SHA1 Both H1 and H2 have fixed length. What's the most efficient way to bind H1 and H2 together into H3? The goal is to ...
0
votes
1answer
87 views

Security of using sha(secret + rand)

I have come across some security implementations in which party A will compute MD = sha256(secret + rand) and transmit MD and rand to a counterpart B. If the second party knows the secret, then when ...
0
votes
2answers
1k views

Probability last character sha256 hash

A quick question. I want to use the last character of a SHA256 hash (blockhash of a bitcoin block) as my random source. Is 100 /16(amount of different chars) = 6.25% true for all characters or are ...
1
vote
1answer
302 views

Confused about Merkle Damgard Transform - short messages?

With the Merkle Damgard Transform, how does it handle messages that are shorter than the input message length - hash digest length? Or in other words, how is the last block handled? So for example, if ...
3
votes
1answer
7k views

Difference between SHA 512, SHA 512 Half, SHA 256

I was trying to create a python wrapper for RIPPLE crypto currency, and i ran into SHA 512 half which i have no idea or reverse googled it to no avail. Can someone help me understand the difference. ...
15
votes
2answers
32k views

Do identical strings always have the same SHA-256 value?

If you hash a string using SHA-256 on your computer, and I hash the same string using SHA-256 on my computer, will we generate the same value? Does the algorithm depend on a seed (so we'd both need ...
1
vote
1answer
660 views

HMACSHA256 2.5 times faster than HMACSHA512

According to the answers to a previous question, the 512 version should be faster on x64 devices. And even if it were executed on an x86 (32 bit) device - there shouldn't be such a big difference. ...
3
votes
2answers
8k views

What happens if a SHA-256 input is too long (longer than 512 bits)?

What I understand is: When we parse a message into 512 bit message blocks. Then we extend the first message block to 64 entry array and start with the compression function. What happens if the ...
1
vote
1answer
909 views

Forward Patterns in SHA 256

Would it be possible to find a correlation between the inputs of SHA 256 and it's outputs? More specifically, by using deep learning, would there exist a correlation between the inputs of an SHA 256 ...
-2
votes
1answer
187 views

Secure password storing mechanism [closed]

I recently thought about a secure password storing mechanism. I wanted to ask if the following password storing mechanism is resistant against rainbow tables with a secure password and the attacker ...
1
vote
1answer
696 views

How exactly is the input message of SHA-256 (pre-)processed?

I’m very interested how SHA-256 handles messages, but I’ve got 3 questions. (As I have already read in some answers before, SHA-256 is not directly performed on the message but on an array, thanks for ...
5
votes
3answers
10k views

What's the difference between PBKDF2 and HMAC-SHA256 in security?

Being a software developer, I haven't dealt with crypto so far. So I know very little, sorry for that already. I am aware that you should use bcrypt, scrypt, Argon2 or PBKDF2 for generating a hash ...
0
votes
2answers
5k views

Single string producing two different hash results with SHA-256

Is it possible that a single string produces two different hash results after going through the same SHA-256 hash function? The code I'm working on right now is doing this, and I assumed this should ...
2
votes
1answer
6k views

Is there a way to tell if a given string is a sha256 hash?

Just like, for instance, we can easily check if a given number is a visa card number, by verifying prefix and checksum - can we do anything similar for hash?
2
votes
1answer
149 views

In what aspects is the function based on four iterations of SHA-256 compression function weaker than the SHA-512 compression function?

Let $F_{512}(B, C)$ denote the underlying function (single block manipulation function) of SHA-256. This function takes a 512-bit block $B$, 256-bit initialization vector $C$ and produces 256 pseudo-...
1
vote
1answer
107 views

Determining if at least 1 bit is set in the output of SHA256

Given the SHA256 hashing algorithm, is there any shortcut to determine whether 1 bit will be set in the output in a given position (or set of positions)? Relaxing ...
1
vote
1answer
414 views

Can we map SHA-256 output bits to fixed-length input bits?

If I have a set of $N$-byte input values to be hashed using SHA-256, then what are the mapping functions for each of the 256 bits of the output? It seems to me that hashes are one-way partially ...
1
vote
1answer
641 views

Security of a sha-256 based stream xor cipher?

Provided that I have some data I want to cipher and a password to do it: I generate a random IV I define c = sha256(password) I generate an infinite stream where <...
-2
votes
1answer
632 views

Is it possible to attack an SHA-256 hash seeded with PHP’s mt_rand function?

Is it possible to attack this construction if the attacker only knows the hash? ...
3
votes
1answer
468 views

How to sequence SHA256 block circuit to obtain hash of a message comprising multiple 512 blocks?

I am trying to obtain a circuit that computes the SHA256 hash for an input message that is greater than 512 bits. I understand how the message is to be padded (we append a 1 and then some zeroes, ...
1
vote
1answer
642 views

Padding Oracle Attack with AES-128-CTR and MAC

Assume Alice and Bob are communicating using 'MAC then Encrypt' paradigm. Specifically, they are using HMAC with SHA256 as the hash function and the output is truncated to 40 bits. They are using AES-...
0
votes
2answers
467 views

Making a one-way function harder to reverse

Let's suppose that for a crypto protocol a 32-byte-to-32-byte one-way function is needed. Proposals are: $\textrm{sha256}(x)$ $\textrm{hmac}(\textrm{sha256}, x, x)$ $\textrm{hmac}(\textrm{sha256}, x, ...
1
vote
1answer
1k views

Is it safe to truncate/compress SHA256?

I am writing a small personal project where I would like to use AES to encrypt some documents. It seems to work pretty well, but I was wondering about one point of my code. The current structure is <...
1
vote
1answer
567 views

How is a “SHA256 reduced by X of Y rounds” built?

Wikipedia reports: A 2011 attack breaks preimage resistance for [...] 52 out of 64 rounds for SHA-256. Pseudo-collision attack against up to 46 rounds of SHA-256. I am having trouble determining/...
8
votes
2answers
3k views

Argon2 with SHA-256 instead of Blake2

Can SHA-256 be substituted for Blake2 in the Argon2 algorithm? I am working my way through the C reference source code for Argon2 and hand-translating it to Go. I was just wondering why Blake2 was ...
3
votes
4answers
4k views

Would possessing a string with the SHA-256 hash of all zeros lead to an attack on SHA-256?

Would possessing a string with the SHA-256 hash of all zero bits lead to an attack on SHA-256? I could easily imagine that a specialized attack leaked knowledge of how to do it, but I could equally ...
2
votes
1answer
173 views

How to implement a hash function $H \colon \{0,1\}^* \to \mathbb{Z}_p^*$?

I would like to implement a hash function $H \colon \{0,1\}^* \to \mathbb{Z}_p^*$ such that $p$ is a prime number and $\log_2(p) > 256$. I am wondering if it is a good idea to use the hash function ...
1
vote
1answer
819 views

How difficult is it to crack sha256(sha256(pin)) with a 6 digit pin and no salt?

My friend forgot the password to his electrum wallet but knows that it's a 6 digit pin. I looked into it and from what I can find electrum uses the sha256(sha256(pin)) to generate the key used to ...
1
vote
1answer
3k views

Is there any hardware available to calculate single sha256 hash? [closed]

I'm looking for a hardware that can generate sha256 hash of the input.
12
votes
1answer
8k views

Are there any well-known examples of SHA-256 collisions?

The popularity of SHA-256 as a hashing algorithm, along with the fact that it has 2256 buckets to choose from leads me to believe that collisions do exist but are quite rare. Are there any well-...
1
vote
1answer
213 views

Using non-standard constants for SHA-256

For SHA-256, FIPS 180-4 states the following on the constants: These words represent the first thirty-two bits of the fractional parts of the cube roots of the first sixty-four prime numbers. If ...
2
votes
1answer
1k views

Can someone give me an example of a Merkle–Damgård transformation?

I started reading "Bitcoin and Cryptocurrency Technologies - Princeton University" (coursera) and in the first chapter it talks about Merkle–Damgård transformations for SHA-256. I was trying to ...
6
votes
1answer
10k views

Apple secure notes. How secure?

In terms of cryptography, how secure is Apple Secure Notes? Can one store sensitive information there? The relevant section of the Apple white paper is quoted below: The Notes app includes a Secure ...
1
vote
2answers
283 views

Can a hash of the original plain text file be used to brute force an encrypted copy?

I have encrypted files stored on a public cloud, in the same directory on the cloud I have the sha256 hash of the files before they were encrypted in a text file. The keys used to encrypt the files ...
-1
votes
1answer
1k views

Birthday attack against SHA256 [duplicate]

Lets say I have a database that contains X SHA256 hashes . How do I calculate the likelihood of a me creating a hash out of random values that collides with any hash in the stored database?
3
votes
1answer
1k views

Cryptographic hasing functions init-update-final

Does anyone care to explain what is the idea behind the init-update-final functions of cartographic hash functions (e.g. SHA*_Init, ...
2
votes
1answer
245 views

Hash function and Digital Encryption Algorithm

I am familiar with the fundamentals of cryptography as well as Digital Signatures. I understand how DSA like RSA works and the fundamentals of mathematics behind digital signing and verification. I ...

1 2 3
4
5
9