Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
3answers
80 views

Suitable 16-bit checksum?

I am writing a toy1 transport protocol and I am trying to implement a feature whereby: A 16-bit checksum is included in every packet. This checksum can be extended to be 48-bit if the data is large, ...
-1
votes
1answer
37 views

Is it possible for a hash in SHA-256 to have more than 8 digits? [closed]

Is it ever possible for a hash to have more than 8 digits in SHA-256?
0
votes
0answers
37 views

Why initialize values and array SHA256 with specific buffer?

Why initialize values and array SHA256 with specific buffer? ...
0
votes
2answers
100 views

How is the hash for a file calculated?

Is the file just read bit by bit to calculate the hash with those values or is there more to it? Are there any resources to read a bit more about file hashing?
1
vote
1answer
76 views

SHA256 message schedule examples

I need some example values for the message schedule stage of SHA256 to test this part of my implementation. If possible in binary, for the string 'abc'.
0
votes
2answers
53 views

For the hash computation of SHA-256, is it computed in parallel or series?

I'm trying to write my own SHA-256 implementation in VHDL, which runs in parallel execution style I have been using this as a reference to the SHA-256 algorithm: https://www.researchgate.net/file....
1
vote
1answer
58 views

ECDSA signature of a random 32 byte number vs. the hash of the number

I'm working on an application that involves signing a 32 byte random number generated by the OS. Assuming the RNG works as intended, is it safe to sign the random number itself rather than a hash of ...
0
votes
1answer
42 views

Bitcoin mining: how is a block header of 80 bytes processed in SHA-256? Isn't it too big?

The whole process of bitcoin mining was making sense to me until a moment of madness an hour ago, if there are 80 bytes of data to be processed in SHA-256, that's 640 bits of data to be processed in ...
2
votes
1answer
83 views

Use a hash-function twice

I'm creating a small messenger and I wanted to know if it makes sense to store user passwords double-hashed in our backend-database. I wanted the user the register in an app, which should save a hash ...
0
votes
1answer
75 views

Is there any Corelation between the SHA256 and SHA512 hash of the same data?

Is there any Corelation between the SHA256 and SHA512 hash of the same data ?
2
votes
2answers
312 views

What is the difference between SHA-3 and SHA-256?

I am new about cryptography, I learned that SHA-3 (Secure Hash Algorithm 3) is the latest member of the Secure Hash Algorithm family of standards, released by NIST....
-2
votes
1answer
61 views

Is it possible to unhash sha256 if you are given the sha256 and unhash of a variable? [closed]

Lets say that $a, b, c$ are variables and you know that $$\operatorname{sha256}(a) = b \\ \operatorname{decrypt}(b) = a \\ \operatorname{sha256}(b) = c \\ \operatorname{decrypt}(c) = b$$ Is it ...
6
votes
1answer
2k views

What does the symbol $W_t$ mean in the SHA-256 specification?

I'm really confused about the computation about SHA 256. $$W_t = \begin{cases} M_t^{(i)} & 0 \leq t \leq 15 \\ &\\ \sigma_1^{256}(W_{t-2}) + W_{t-7} + \sigma_0^{256}(W_{t-15}) + W_{t-16} &...
2
votes
2answers
318 views

How to prove that finding a cycle in a cryptographic hash function is hard?

I want to show that finding cycles in a cryptographic hash function is hard. My thought: assume there a black box, that given a cryptographic hash function $h$, finds some $x$ and $r$ in polynomial ...
1
vote
2answers
85 views

Can i generate a SHA512 hash if i know the SHA256 hash of some unknown data?

if the SHA256 Hash of some unknown data is known ! Can i find the SHA512 of that unknown data ?
1
vote
1answer
163 views

Is SHA-256 OK to use for key derivation for a key that is never persisted?

The scenario: On the one side a user enters a pass phrase to encrypt a stream of data (AES-GCM) and a symmetric encryption key is derived from the pass phrase using plain SHA-256 (so not a slow ...
0
votes
0answers
46 views

Is reverse engineering SHA256-HMAC function possible? [duplicate]

Assume HMAC function is used to generate a 6-digt integers time-based onetime password. As follows: $$K_h =\operatorname{HMAC}(k,t) = H((k\oplus\text{opad})\mathbin\| H((k\oplus\text{ipad})\mathbin\|...
4
votes
2answers
507 views

How can I hash an input into an arbitrary domain point?

I am trying to implement a signature scheme involving RSA signing of a message digest generated by SHA-$256$. I want to hash the input into an RSA domain point instead of the fixed $256$ bit digest ...
-1
votes
1answer
264 views

How to change hash checksum of a text file without changing the contents in the file

I have created a text file called test.txt and the content of the file is Hello World I would like to change the SHA checksum hash without modifying the contents and filename. Is there any way to do ...
2
votes
1answer
128 views

Is padding of the digest needed in SHA256 with RSA-2048 scheme?

For a signing scheme involving generating a $256$ bit digest using SHA256 followed by RSA with $2048$ bit modulus, the signature would always be 256 bit without padding even though sigantures of up to ...
2
votes
1answer
88 views

What should I use for consequent AES key derivation?

I am writing a small chat program to explore some methods and concepts in cryptography and currently I am using a shared AES key tunneled with RSA which upon further reading revealed many flaws both ...
2
votes
2answers
136 views

Does the knowledge of SHA256(secret) and SHA256(secret + known constant) give any information about the secret just SHA256(secret)?

Does knowledge of SHA256(secret) and SHA256(secret + known constant) give any information about the secret than just SHA256(secret)?
2
votes
1answer
65 views

Is it possible to guarantee a SHA-256 hash will begin with a certain 3 bytes?

I've found this online currency someone has built as a project and it's "miner" / Proof of Work algorithm is as follows: Generate 32 bytes of random data and hash it, store the original value and the ...
17
votes
2answers
4k views

What makes SHA256 secure?

For example, RSA relies on a mathematically hard problem, factoring, while ECDSA or similar rely on discrete logarithm problem. What makes SHA256 and similar hash functions, of the same family, ...
8
votes
1answer
512 views

What is the use of SCRAM-SHA-256 (over SCRAM-SHA-1)?

The Salted Challenge Response Authentication Mechanism (SCRAM) specified in RFC 5802 can use arbitrary hash functions to operate. The base version from RFC 5802 uses SHA-1. From my understanding, ...
2
votes
1answer
73 views

For two LUKS volumes made with the same password, can stealing the encryption key from one volume allow access to the other?

A running computer has two LUKS volumes that were made with the same password. One volume is open (key is in RAM), the other is closed. If the running computer is stolen, is the closed volume safe? ...
0
votes
1answer
52 views

How to name a signature algorithm that has no hashed component

I have an API-based service that digitally signs messages with RSA or ECDSA (system decides during runtime). The input is base64 encoded SHA-256 hash and the output is: signature of this hash ...
0
votes
1answer
48 views

What pieces of information do you need to unhash a key to find out the original message?

I am very new to the hashing world and despite hours of research (AKA Googling) I still don't understand this piece of information. What are the different pieces of information that are needed in ...
0
votes
1answer
170 views

Use partial hash to verify entire hash

I've had an idea about storing parts of SHA256 hashes and I'd like to find out how secure it is, or how much less secure it is than storing the entire hash. For example, users can share this list of ...
0
votes
1answer
605 views

Hash Collision Probabilities

Please give help! how can I calculate the probability of collision? I need a mathematical equation for my studying. Assume, I am using SHA256 to hash 100-bits. Thus: SHA256 {100} = 256-bits (hash ...
-1
votes
1answer
909 views

Is it possible to convert the output of sha256 hash to binary or decimal value? [closed]

Can the output value of the sha256 hash function be converted to binary or decimal number? I know that the output is a set of 256bits. Is it possible to convert the output data to an unique ...
4
votes
2answers
255 views

If you wrote a reversible SHA-256 algorithm, how many “metadata” bits would be required for reversability?

I was reading about reversible computing while thinking about FPGA circuits. I realized that it would be possible to write a reversible SHA-256 algorithm if you stored some additional information as "...
17
votes
1answer
3k views

What are the consequences of removing a single byte from a sha256 hash?

I'm working on a system (Ethereum) where it is significantly cheaper to store 32 bytes than 33 bytes. I'd like to create a table where data is stored based on its hash. Sha256 would meet this ...
48
votes
11answers
15k views

How do hashes really ensure uniqueness?

This might seem an impractical and unnecessary conversation, but I feel it's something I need to clarify. Especially, as I just got my first developer job in a blockchain startup. So hashes are said ...
3
votes
1answer
702 views

Is SHA1 secured enough as a PRNG

I read SHA1 is still a secured hashing function with no collision found as of now. However, it's just a matter of time for someone to come up with such a collision or attack. Therefore, in new ...
2
votes
1answer
220 views

Practical quantum attacks on SHA256 MAC and HMAC

Is SHA256 MAC (or HMAC) vulnerable to any quantum attacks? Game setup: The attacker's goal is to produce a valid MAC to be accepted by other devices in the ecosystem. The ecosystem consists of ...
0
votes
2answers
139 views

Can I find the IV of a single block of SHA256, given the plaintext and digest?

Each 512-bit block of SHA256 takes an initialization vector (IV) and message schedule and returns a digest. Knowing the message schedule and resulting digest, is it feasible to reverse the algorithm ...
19
votes
5answers
2k views

How many hex digits do I need to compare when manually checking hash functions?

I sometimes run sha256sum on large files after transferring them from one place to another, and will just skim the hash output to verify it's correct. But, I usually just look at the first/last 5 or 6 ...
0
votes
1answer
795 views

Signing with RSA-SHA256 algorithm using EC keys

Is it practical to sign a data using RSA-SHA256 algorithm with EC keys? I used a small NodeJS script and crypto module (uses openSSL internally) to test this and I could successfully sign the data ...
-2
votes
2answers
373 views

VeraCrypt a weak point [closed]

Biggest flaw in VeraCrypt(or other Encryption programs) is Hash Algorithm. VeraCrypt hashes (SHA,Whirlpool,Streebog) it is the only point where can break an encrypted disk. Because break algorithm (...
2
votes
1answer
82 views

Why is a 1 added after the message input and before adding padding zeros (if necessary) when using SHA256 or RIPEMD160? [duplicate]

In preparing an input for SHA256 or RIPEMD-160 a single bit (1) is appended to the message before adding any necessary zero padding and before adding the bitlength (64 bits) to form 1 or more 512 bit ...
0
votes
1answer
344 views

SHA's finite character set and collision

From what I've researched, SHA's hex encoded string contains the characters [a-fA-F0-9]. If we represent it in Base64, it can contain ...
1
vote
1answer
67 views

Does having an SHA256 hash compromise PBKDF2 secrecy?

If I have a password pwd, and I hash it with SHA256 and send it to a server for authentication (server will apply ...
8
votes
2answers
419 views

Which attacks are prevented by the different initial hash values for SHA-2 with truncated output?

NIST specified SHA-2 hash functions with truncated output. Those hashes use different initialization values than SHA-256 or SHA-512. SHA-224 is based on SHA-256. SHA-384, SHA-512/224 and SHA-512/256 ...
0
votes
2answers
115 views

Possible SHA-256 implementation weakness

I came across a SHA-256 implementation that seems not to conform to the standard and because I can't change the implementation I would like to know if it's safe for use or can be a potential weakness. ...
0
votes
2answers
446 views

Can I update sha-256 digest chunk-wise instead of the whole array at once?

I'm not sure whether this questions is about SHA-256 algorithm itself or the particular implementation I'm using. Usually, a hash algorithm implementation has functions, let us call them update and ...
0
votes
1answer
141 views

Is it safe to hash a packet with a shared secret to prove authenticity?

I am developing an online game, where the server is written in Node.js and the client uses Godot. The issue is that Godot has no cryptographic functionalities (it can only encrypt and decrypt files, ...
2
votes
2answers
183 views

Does Diffie Hellman guarantee secrecy?

I am studying my Cryptology exam and one question I got stuck below; Recall the Diffie-Hellman key establishment protocol. Alice runs this protocol over the Internet to communicate with Bob. ...
2
votes
1answer
101 views

SHA-256 Hash identical on two similar but not exact items

There are two discs that we have that have all the same files. However, using a new method for burning the discs, the second disc had modified file dates of 5/30/2018 while the original disc has dates ...