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
0 votes
0 answers
57 views

Calculate SHA-256 for large data using finite memory space [closed]

I am embedded software developer I am working in cybersecurity project. In the application I'm receiving 2000 bytes of data but the local buffer size is only 1000 bytes. Currently I'm calculating the ...
karthick's user avatar
1 vote
0 answers
79 views

Zero Knowledge Proof for SHA-256 preimages

I need to design some protocol where actors will leverage Zero Knowledge Proofs (ZKP) to prove that they know the pre-image of some specific SHA256 hash without revealing the pre-image itself. Ideally,...
Bernardo Rodrigues's user avatar
1 vote
0 answers
72 views

Is it better to use PBKDF2 with SHA-512 and 1e6 iterations or SHA-256 and 6e6 iterations?

I'm implementing encryption in my browser extension that will allow users to encrypt their data and then share them with others. And since shared links can be leaked, I want to protect the data as ...
icl7126's user avatar
  • 111
0 votes
0 answers
62 views

HMAC-SHA256 key length against key recovery attack

I have trouble finding information on the security strength of HMAC-SHA256 against key recovery attacks with respect to the key size. To fit a certain application I must use a 128-bits key with a HMAC-...
dragonfire2000's user avatar
1 vote
2 answers
38 views

Let $X$ be the set of 256-bit strings and $x \rightarrow H(x)$ a map on this set, where $H$ is SHA-256. How often is $H^-1(y)$ empty?

It cannot be "frequent" because that implies $H$ is not really 256-bit. Are there statistical or mathematical bounds on this? Finding the inverse is computationally difficult, but what ...
Warren MacEvoy's user avatar
2 votes
1 answer
97 views

HMAC SHA256 walkthrough examples

I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully). I am trying to find examples where they show the results after each HMAC stage (XOR, append, H etc). Does anyone know of any ...
intrigued_66's user avatar
0 votes
0 answers
41 views

Explanation of KeePass 2 database key calculation?

I am currently taking a course in university where we are working with a KeePass 2 database file. I am still very new to everything which has to do with encryption. First I am going to provide the ...
David Krell's user avatar
-2 votes
1 answer
100 views

What is the critical importance of SHA and other hash families? [closed]

Assume integer factoring, discrete log are classical safe and LWE, McEliece etc are quantum safe. This question is only about SHA and hash families in general on why we need them if we have pkc ...
Turbo's user avatar
  • 908
1 vote
0 answers
37 views

Inconsistent SHA256 checksums [closed]

I encounter an odd issue when I calculate SHA256 checksums in Javascript. I use the following code: ...
randmin's user avatar
  • 111
2 votes
1 answer
100 views

Implementing a Merkle tree using a 128 bit hash function?

I need to implement a Merkle tree using a 128 bit hash function. In general, any hash function that guarantees pre-image, second pre-image and collission resistance should be fine to implement a ...
Lorenzo's user avatar
  • 139
2 votes
1 answer
456 views

When using AES-256 in combination with HMAC-SHA, should we use SHA-256 or SHA-512?

When using AES-256 (cipher mode CBC and padding mode PKCS7) in combination with HMAC-SHA for authenticated encryption (assuming alternatives like TLS and AES-GCM cannot be used), should we use SHA-...
SeekingAnswers's user avatar
1 vote
1 answer
352 views

What does the 256 in SHA3-256 and SHAKE256 refer to?

I am simply wondering what the bit-length in the algorithm variant in the table below refers to? For the hash functions I assume that this refers to the ouput length in bits. For instance for SHA3-256 ...
Rory's user avatar
  • 315
1 vote
1 answer
100 views

Collision Resistance in Random Bit Generator

Consider following simple RBG where SHA-256 of random noise (more than 200Bytes of 4 bits entropy per byte) is computed to produce 256 output bits $\text{output} = \operatorname{SHA-256}(\text{...
crypt's user avatar
  • 2,397
5 votes
2 answers
2k views

Is there a way to calculate a hash with two people so that no one knows the pre-image but if they get together they do?

I'm trying to find a way to have multi party hash computation, more specifically for SHA256. I want for two people to be able to compute a hash so that none of them knows the pre-image but when they ...
Dani Vilardell's user avatar
1 vote
0 answers
155 views

Is my TypeScript scrypt implementation using Web Crypto API safe and correct? (Open Source)

I want to use TweetNaCl.js for encrypting user data that is stored in LocalStorage. Therefore, I want to prompt the user to provide a PIN/password that shall be ...
kyr0's user avatar
  • 111
1 vote
0 answers
42 views

Verifying ECDSA-SHA256 HTTP Signature [duplicate]

With PHP, I'm trying to setup a HTTP signature verification for webhook requests coming from BlockCypher: https://www.blockcypher.com/dev/bitcoin/?php#webhook-signing This is their public key: ...
Carlos's user avatar
  • 33
2 votes
1 answer
412 views

is this how RS256 works in JWT?

I'm a newbie that is studying about JWT using RS256 algorithm for signing and verification. I have drawn a diagram that represents my understanding of how RS256 works. Basically, below is what I ...
William Le's user avatar
3 votes
2 answers
327 views

is SHA512 with 256 bit set is similar or same as SHA256?

I'm new in Cryptography, if i will use SHA512, but only with 256 bits, is it equal or similar to SHA256? I'm trying to understand if there is a way to use SHA512 as SHA256
ish's user avatar
  • 31
0 votes
1 answer
76 views

Correlation between IV value and the output of a hash function

As we know, the IV and the output of SHA-256 are identical in size. Suppose the input value to the SHA-256 is completely transparent. Is there any correlation between IV value and output? Is it ...
abbas's user avatar
  • 165
1 vote
1 answer
183 views

How do most implementations of SHA-256 work?

Why is it that most implementations define an sha256_init, sha256_update, and sha256_final ...
user avatar
8 votes
1 answer
170 views

AES vs. SHA2 in key-stream generation

A KDF in Counter Mode (e.g., see NIST SP 800-108r1, Section 4.1, similar to HKDF) produces the output as what AES-CTR would do if one replaces AES with SHA2 (or, to be exact, with HMAC). However, NIST,...
uk-ny's user avatar
  • 129
3 votes
1 answer
898 views

Why does SHA-256 have any to do with scrypt?

I was reading the Wikipedia page for scrypt because I wanted to learn more about it and I came across their pseudocode for the algorithm. What confused me was the following line: I don't understand ...
Darcy Sutton's user avatar
1 vote
1 answer
77 views

Is there any point in extending an 80-bit key before using it for HMAC-SHA256?

I have been asked to make a HMAC-SHA256 password digest from: a password some salt, and an 80-bit secret key. I've been advised that I should be using a key of 256 bits or more for HMAC-256. The key ...
fadedbee's user avatar
  • 835
3 votes
2 answers
742 views

Password Hashing based on Common Passwords

If an attacker has a database of 1,000 users' hashed passwords which are hashed with SHA-256 with a 128-bit salt and all of these users used 10,000 common passwords. How many hashes will the hacker ...
CryptoGuru's user avatar
1 vote
0 answers
233 views

What is more secure, HMAC with SHA-1, or with SHA-256 and take a substring?

I'm going to guess the latter, but just wanted to ask here. I want to have a relatively short signature, and my goal is to take a substring of the resulting hash.
Gregory Magarshak's user avatar
5 votes
1 answer
609 views

How can a preimage attack on SHA-256 always succeed within 2^256 evaluations when done though brute force?

I was reading the Wikipedia page for SHA-256 (SHA-2) and came across the following statement: For a hash function for which $L$ is the number of bits in the message digest, finding a message that ...
Darcy Sutton's user avatar
1 vote
1 answer
81 views

Mod operation while verifying an ECDSA signature with SECT233R1

I'm trying to perform ECDSA verification in hardware. I'm using the SECT233R1 curve (NIST B-233). I have a question about the hash function used while doing so. I want to use the SHA256 hash function ...
thatbangaloreanguy's user avatar
2 votes
1 answer
178 views

Generic attack on Hmac sha256

Is there any generic attack on HMAC SHA 256 ? I am currently reading up on attacks on Hmac sha-256. However most of the papers I've found are about side channel attacks such as Differential power ...
Donnie's user avatar
  • 33
4 votes
2 answers
932 views

Password hashing and salting with SHA-256 on $2^{64}$ password space

If a password is randomly chosen from a space of $2^{64}$ passwords and is stored as an SHA-256-bit hash and a 128-bit salt, how many hashes does an attacker need to perform to recover the password in ...
CryptoGuru's user avatar
1 vote
1 answer
336 views

Which hash functions provide 128 bit resistance?

I was wondering out of the functions (MD5, SHA-1, SHA-256, and SHA-512), do all provide 128-bit pre-image resistance and 128-bit second-image resistance? Also, out of these hash functions, do only SHA-...
CryptoGuru's user avatar
1 vote
1 answer
1k views

How long does it take to decrypt AES encrypted message with salt(for pbkdf2 key) and iv known

I'm new to crypto! The situation is, Aes-256-cbc encrypted message(including not encrypted iv & salt) is revealed. We also know pbkdf2 function uses 10000 rounds with sha256. All we need to ...
Hyunhum's user avatar
  • 11
-2 votes
1 answer
158 views

Does a pseudo-random number have the same security as its SHA digest message?

Is a random number generated by a CSRNG equivalently secure as the SHA hash of that number? I know that RNGs generate numbers that look random, and aren't necessarily random. For example, in a range ...
Angelo M.'s user avatar
-1 votes
2 answers
679 views

Can I 100% trust the PBKDF2(HMAC-SHA256) AES-256 CBC encryption algorithm for file encryption purposes or not, and why? (Winrar) [closed]

I am not an expert in cryptography and therefore I would like to address this problem to people who have been working on this topic for a long time and thus verify the facts from several sources. I ...
Hasbo's user avatar
  • 13
1 vote
1 answer
407 views

Is sha-256 better then sha-1 in aspects othen then the hash size?

Assume I create a hash using SHA-256 and then take only the first 160 bits of the hash, as the result. is the result more cryptographically secured than SHA-1? Or are the two algorithms equally secure ...
Aviv Aviv's user avatar
  • 113
8 votes
1 answer
705 views

Does "SHA-256/192" use different initial values from SHA-256?

I've seen some mentions of a "SHA-256/192" online. Clearly, this means the output of SHA-256 is truncated to 192 bits, but does it also use different Initial Values like SHA-512/256?
Myria's user avatar
  • 2,451
0 votes
2 answers
538 views

PKCS#7 SignedData - how is the "encryptedDigest" constructed for RSAES‐PKCS‐v1_5?

I need to use Azure Key Vault HSM to sign arbitrary data in a PKCS#7 CMS. There are plenty of libraries and packages that can do this if you supply them with the private key, but obviously I don't ...
user15045901's user avatar
0 votes
1 answer
136 views

Merkle–Damgård construction - the bigger input, the longer time to compute hash?

I'm trying to understand Merkle–Damgård construction. We can hash as many blocks of data as we want, if I understand it right. But then it looks like when input is bigger, then also time to compute ...
Tom's user avatar
  • 1,211
0 votes
2 answers
283 views

SHA256 - alternative algorithm to receive same hash?

My question is whether it is possible to use "another" algorithm than the sha256 to hash data but end up with the identical sha256 hash (obviously without using the sha256 algorithm)?
user103667's user avatar
2 votes
1 answer
256 views

Create a control hash string from different sources, is there a difference, advantage or disadvantage in comparison when using this ways?

I wanna create from several inputs/sources should be formed into one hash value for controlling of different thinks later. Example: String + File String + String File + File String + File + String ...
Z0OM's user avatar
  • 155
0 votes
0 answers
737 views

Generate SHA256 fingerprint from RSA public key (string only)

I have the public key, the string itself (not a file), and I am trying to figure out the SHA256 fingerprint, as in the image attached. The default key generated by PuttyGen is SSH-2 RSA with a SHA256 ...
user103636's user avatar
0 votes
0 answers
125 views

What is the minimum length of shortened HMAC to be considered safe?

Is it safe to truncate HMAC? What is the minimum length of a truncated HMAC so that HMAC is still considered to be safe to use? Are there any standards on when it comes to shortening HMAC? In my case, ...
g00dds's user avatar
  • 101
0 votes
1 answer
156 views

Should I use hash of passphrase as AES256 key

As title I have a password-like passphrase (8 chars at least) that is then hashed with argon2(with the salt is SHA256 of that passphrase). Then use it as AES256 key along with a random IV generated by ...
Kim Mỹ's user avatar
  • 155
4 votes
1 answer
189 views

What is the rationale for including addition in SHA-256?

Short Version: SHA-256 uses addition alongside a variety of bit-wise operations. What's up with that? I was reading a description of how SHA-256 worked and it included a description of the various ...
billpg's user avatar
  • 711
0 votes
1 answer
93 views

False positive error rate of truncated hash match

I’m having difficulty calculating the false positive error probability of matching a prefix of a hash that was truncated to m bits. Say I have string S1 that produces a SHA256 hash H1. I then save the ...
Pedro Paixao's user avatar
1 vote
1 answer
363 views

How to generate a SNARK arithmetic circuit for SHA256?

I am using zkSNARK to prove knowledge of preimage for SHA256. However, the library used only supports field operations (such as add and multiply), and it compiles down to arithmetic circuits. Thus, ...
sinoTrinity's user avatar
1 vote
0 answers
308 views

Creating a basic SHA256 hasher in Circom

I want to create a SHA256 hasher in Circom so I can validate that a person knows the pre-image of a SHA256 hash without revealing the pre-image. This is my current code but it doesn't work: ...
LostatCplusplus's user avatar
0 votes
1 answer
75 views

Double hashing scheme on not collision resistant hash

Given an hash H that is not collision resistant, for example 80-bit digest, if we use the following double hashing scheme: H(SHA2-256(x)). Does this scheme increase the collision resistance?
N-K's user avatar
  • 1
1 vote
1 answer
98 views

Fastest method of CNF equation solution verification

I am trying to find a way to mine bitcoin faster than an ASIC by using a CNF representation of sha(sha(hash)), which would be an equation containing a few hundred thousand clauses, let's call it n ...
Alex Breeze's user avatar
2 votes
1 answer
2k views

Can OpenSSL sign an ED25519 certificate with ECDSA-with-SHA256?

We are trying to generate some self-signed certificates to test our cybersecurity firmware before switching to a "real" CA-signed chain of trust. The specification we are coding to mandates ...
Adam Lawrence's user avatar
3 votes
1 answer
418 views

NIST expression for HMAC security strength

In NIST SP800-107, NIST claims that the security strength of HMAC is MIN(security of HMAC key, $2L$). $L$ is the length of the output of the underlying hash function. Let's take HMAC-SHA256 as an ...
Evgeni Vaknin's user avatar

1
2 3 4 5
12