<blockquote>
  <p>giving them a number H(studentID||Bi) where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)?</p>
</blockquote>

<p>For this purposes of this question, the bitcoin header Bi = H(Bi-1 || other stuff).  Under a black box assumption of H()'s behavior, the two schemes are practically equivalent.</p>

<p>You can't really argue that H(id || Bi-1 || H(bi-1||stuff)) is more secure than H(id || H(Bi-1||stuff)) on the basis of 'more data' because H() might well have an internally bottleneck E.g. it could be implemented H(bytes[0 .. n]) = H(H(...H(H(H(bytes[0])||bytes[1])||bytes[2])...||bytes[n])  (and, in fact, sha256 does work kind of like this, though not one byte at a time).</p>

<p>Without out a more formal definition of "security" I don't think it's possible to just answer the question.  But guessing at a meaning "could someone more easily rig their office hours under one instead of the other"-- the answer would be no.</p>

CC BY-SA 4.0
2019-02-14T03:10:03.210Z
2019-02-14T03:10:03.210Z
G. Maxwell
<p>A hash is just a way to summarize things into an unique ID.</p>

<p>The more elements the hashing contains the harder it is to break it, if you reverse a hash it would cause a preimage attack and the algorithm  of the hash would be useless because you would’ve broken its main concept which is hashing (not encrypting)</p>

<p>If everyone knows the way the hash is computed then everyone could fake the hash (In bitcoin, everyone knows the way it is computed because that’s how the nodes can verify whether a hash is valid or not and thus know whether the blockchain was modified). Having said that, you might want to consider the secret of the order for the hashing in order to make it “secure”.</p>

<p>A hash safety itself is measured by how hard it is to break it. Sha256 is one of the most powerful hashes because it’s almost impossible to generare a preimage attack, but if you need to make it safer, you could hash the hash, H(H1(H0))</p>

<p>Where H0 is the first hash. </p>

<p>That way it would get harder exponentially to break it, (the more rounds you use to hash information, the harder it gets by an exponent number).</p>

<p>I hope that works for you to understand. </p>

CC BY-SA 4.0
2019-02-14T02:22:04.303Z
2019-02-14T02:27:15.540Z
2019-02-14T02:27:15.540Z
Juan
<p>I am currently studying in college in the US and was actually curious about bitcoin and cryptocurrencies as a whole. I started looking on free university sites like Stanford university and New York University and even attempted to do questions of their past papers. I answered most of the questions, but I am stuck on one of the questions:</p>

<p><code>Suppose your professor wants to award each student in the class a random priority for office hours help by giving them a number H(studentID||Bi)
where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)?</code> (<a href="https://cs.nyu.edu/courses/fall17/CSCI-GA.3033-019/assignments/practice_final.pdf" rel="nofollow noreferrer">https://cs.nyu.edu/courses/fall17/CSCI-GA.3033-019/assignments/practice_final.pdf</a>)</p>

<p>I get that it maybe more secure if you use the <code>Bi-1</code> because you have more inputs to generate an output, but I feel like that is not the reason. </p>

<client><hash><block-hash>
Trying to understand why hash value is more secure from hash algorithm
Crypt0bl0ckm0nz
# Trying to understand why hash value is more secure from hash algorithm

(Asked by: username_0 on 2019-02-14)

I am currently studying in college in the US and was actually curious about bitcoin and cryptocurrencies as a whole. I started looking on free university sites like Stanford university and New York University and even attempted to do questions of their past papers. I answered most of the questions, but I am stuck on one of the questions:

`Suppose your professor wants to award each student in the class a random priority for office hours help by giving them a number H(studentID||Bi)
where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)?` (<https://cs.nyu.edu/courses/fall17/CSCI-GA.3033-019/assignments/practice_final.pdf>)

I get that it maybe more secure if you use the `Bi-1` because you have more inputs to generate an output, but I feel like that is not the reason.

**Tags:** client, hash, block-hash


---

## 2 answers

### Answer by username_1 on 2019-02-14. Score: 1

> giving them a number H(studentID||Bi) where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)?

For this purposes of this question, the bitcoin header Bi = H(Bi-1 || other stuff). Under a black box assumption of H()'s behavior, the two schemes are practically equivalent.

You can't really argue that H(id || Bi-1 || H(bi-1||stuff)) is more secure than H(id || H(Bi-1||stuff)) on the basis of 'more data' because H() might well have an internally bottleneck E.g. it could be implemented H(bytes[0 .. n]) = H(H(...H(H(H(bytes[0])||bytes[1])||bytes[2])...||bytes[n]) (and, in fact, sha256 does work kind of like this, though not one byte at a time).

Without out a more formal definition of "security" I don't think it's possible to just answer the question. But guessing at a meaning "could someone more easily rig their office hours under one instead of the other"-- the answer would be no.


---

### Answer by username_2 on 2019-02-14. Score: -2

A hash is just a way to summarize things into an unique ID.

The more elements the hashing contains the harder it is to break it, if you reverse a hash it would cause a preimage attack and the algorithm of the hash would be useless because you would’ve broken its main concept which is hashing (not encrypting)

If everyone knows the way the hash is computed then everyone could fake the hash (In bitcoin, everyone knows the way it is computed because that’s how the nodes can verify whether a hash is valid or not and thus know whether the blockchain was modified). Having said that, you might want to consider the secret of the order for the hashing in order to make it “secure”.

A hash safety itself is measured by how hard it is to break it. Sha256 is one of the most powerful hashes because it’s almost impossible to generare a preimage attack, but if you need to make it safer, you could hash the hash, H(H1(H0))

Where H0 is the first hash.

That way it would get harder exponentially to break it, (the more rounds you use to hash information, the harder it gets by an exponent number).

I hope that works for you to understand.


---

