Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
61 votes
3 answers
13k views

Hashing or encrypting twice to increase security?

Over on the bitcoin forums I asked why the bitcoin client computes SHA-256(SHA-256(x)) as its cryptographic hash for a variety of purposes. The leading theory--since the bitcoin author has disappeared-...
maaku's user avatar
  • 711
40 votes
2 answers
13k views

How does hashing twice protect against birthday attacks?

The bitcoin wiki says: Bitcoin is using two hash iterations (denoted SHA256^2 ie "SHA256 function squared") and the reason for this relates to a partial attack on the smaller but related SHA1 hash. ...
4nt's user avatar
  • 503
27 votes
1 answer
10k views

Why hashing twice?

I'm trying to understand the Bitcoin protocol, and sometimes see instructions like this: The TransactionId is defined by SHA256(SHA256(txbytes)) or The hash of the public key is generated by ...
Timur Lemeshko's user avatar
19 votes
2 answers
9k views

SHA-256: (Probabilistic?) partial preimage possible?

Currently busying myself with the Bitcoin "mining" algorithm, I am wondering if the process really cannot be simplified. For reference, the algorithm is basically SHA-256d: $$\mathit{success} := \...
JimmyB's user avatar
  • 312
15 votes
4 answers
16k views

How to deal with collisions in Bitcoin addresses?

When creating a Bitcoin account, you need to issue a couple of private/public ECDSA keys. Then, you derive your account address by taking a 160-bit hash (through SHA-256 and RIPEMD) of the public key ...
perror's user avatar
  • 605
11 votes
3 answers
6k views

Is double SHA-256 the best choice for Bitcoin?

So I was just curious. I really look up to Blockchain technology and I have read that Bitcoin uses double SHA-256 for hashing. ( from what I understood, double sha256 is essentially $\operatorname{SHA-...
Pinkovai Krisztian's user avatar
9 votes
2 answers
895 views

Is there a guarantee that for each possible hash y there exists a number x such that with hash function H, H(x) = y?

Specifically talking about SHA-256 here and its involvement in Bitcoin, this was a question someone asked me which I didn't know the answer to. Yes, I am aware that SHA-256 can only have a hash from $...
Styil's user avatar
  • 93
8 votes
1 answer
3k views

How can uniformity of hash functions (e.g. SHA-256) be proved?

In reading about the Bitcoin protocol I noticed how much its proofs-of-work apparently depend on uniformity of the SHA-256 hash function. And so presumably do many other applications. How do ...
Drux's user avatar
  • 243
3 votes
1 answer
1k views

Has a SHA256 output ever been found consisting entirely of the same character?

Is it possible to have an output consisting purely of one character and does this change the entropy of that output? (If that's even possible to ascertain.) As an example, the Bitcoin cryptocurrency ...
Wingsuit's user avatar
  • 149
3 votes
2 answers
3k views

Would SHA-256(SHA-256(x)) produce collisions?

Was reviewing some Bitcoin public-key hash literature and the use of RIPEMD-160 and the SHA-256 as below: RIPEMD160(SHA256(ECDSA_publicKey)) The Proof-of-work ...
Gopalakrishna Palem's user avatar
3 votes
3 answers
2k views

Question regarding multiple SHA-256 rounds on a Bitcoin Brain Wallet passphrase…

I am attempting to come up with a way of memorizing a seed that could lead to any number of brain wallets for bitcoin. I need multiple wallets because a) I don't want all my eggs in one basket, and b)...
james853's user avatar
2 votes
1 answer
1k 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 ...
vengefulduck's user avatar
2 votes
1 answer
3k 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 ...
Edward Mordechay's user avatar
2 votes
1 answer
457 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 ...
RaulRider's user avatar
2 votes
1 answer
458 views

Sane implementations of Bitcoin cryptography routines w.r.t. side-channel attacks

Bitcoin uses SHA-256, Base58Check, ECDSA (Sep256k1) and RIPEMD-160 as the basis of its encryption (see this article for a short guide on how addresses are created). I would like to create an iOS-...
Etan's user avatar
  • 131
1 vote
1 answer
255 views

Is this simple Proof of Work algorithm based on SHA256 susceptible to length extension attack?

Each block's contents are hashed into 32 bytes using $\operatorname{SHA-256}$ (call this string $a$). In order for the block to be accepted, there must be a 256bit nonce (call this string $b$) ...
user491880's user avatar
1 vote
1 answer
383 views

Near preimages, applicable to Bitcoin?

Bitcoin mining relies on generating a smaller hash than the so-called target (a function of the so-called difficultly), thus is vulnerable to a truncated preimage attack (you just need to obtain a ...
user3201068's user avatar
0 votes
2 answers
2k 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 ...
Bram's user avatar
  • 3
0 votes
1 answer
788 views

Bitcoin mining nonce and birthday attack

Having read the basics of mining and this about SHA256 (probabilistic?) partial preimage possible? and SAT solving - An alternative to brute force bitcoin mining, I have the following question: ...
MirrorMirror's user avatar
0 votes
0 answers
44 views

i want to verify the following p2pkh transaction

I know to veify the p2pkh transaction we have to place the unlocking script and locking script in a stack and than evalute the stack. In such cases the the scriptpubkey_asm is of the form <OP_DUP ...
Code's user avatar
  • 1
-1 votes
1 answer
982 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?
user avatar
-1 votes
1 answer
263 views

How to pad in the SHA256 Algorithm (an example using Bitcoin Header)?

For any bitcoin block we combine various Header fields to create a string which is an input to a 2 pass SHA algorithm. The resultant hash must match with the Hash in the Block header for the Block to ...
J.Doe's user avatar
  • 151