Skip to content
Manuel Reithuber edited this page Jun 19, 2013 · 3 revisions

Every Share is defined by its secret. The secret serves as AES encryption key (that's as detailed as it gets on the [official technology page]) and as a way to discover other peers with the same shares.

It usually is randomly created using good random number generators (/dev/random on unix, CryptoApi on Windows).

There is an additional secret ("read only secret") that gives you only read only access to a share. It is a substring of the SHA256 hash of the normal secret:

rosecret = ('R'+base32enc(sha256(base32dec(secret))).left(33)

And then there's the share hash, the hash that transmitted to the tracker and to other peers (See: Protocol). It again simply is a hash of the read only secret (without the leading 'R'):

shareHash = sha256(base43dec(rosecret.mid(1)))

So for example, if your secret was AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (don't use that as secret!):

secret    = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
rosecret  = 'R3ZD4TMT6XDJQBW5V6LBVHZRSYOJSMLHQ'
hex(shareHash) = '474c188ef1315b7c1c298059dbbc5e15fd8ab9e9904cf7942af115b5ee2f39f4' # this one's binary

Hash functions are one way functions. If you've only got the r/o secret, there's no way (other than trying out every possible combination) to get the normal secret.
The same goes for the shareHash. You can't get one of the secrets if the only thing you have is the share hash.

Clone this wiki locally