i am reading lately a lot about hash from torrents an magnetic links etc.
but there is a question i dont understand.
I have the hash of a file and the infohash of a torrent, is the infohash = hash of the file ?
If yes what if the torrent descripes 6 Files to download ?
If no what does it stand for.
Here's how to pull the pertinent segment of a *.torrent datum for a bittorrent “info hash”.
I made this for an example.
The content of the “info” key is between (inclusive) offsets 0x4D and 0xA7. So…
You should see this:
Here is the
xxd
output, in–lieu ofshasum
, for more elucidation:You can refer to The BitTorrent Protocol Specification for an explanation, albeit a terse and rather grammatically inelegant one, as to their nomenclature and why the final 0x65 needs be excluded.
Concisely: the entire datum is encased in a pair of US-ASCII ‘d’ and ‘e’; the content of the “info” key, or field, is similarly so encased. You want everything between the first 0x64 — ‘d’, — which succeeds the US-ASCII string
4:info
, and the terminal 0x65 — ‘e’, — which is paired with the aforementioned 0x64.So I finally figured it out.
The “infohash” is the SHA1 Hash over the part of a torrent file that includes:
To show this a little more I took a random torrent file and used the “BEncode Editor” from Ultima to make it more clearly to me.
As you can see the the red box marked the information part of the torrent file. The torrent file includes not the Hash of the items, but the hashes of every piece.
I am sorry that this information is about a torrent that leads to a illegal movie, but i wanted to use a torrent that realy exists.