insane101 Posted October 14, 2010 Report Share Posted October 14, 2010 Hi,I have some technical questions concerning the protocol.I know that each torrent file has a unique SHA hash value. But how is that value generated and from what. I know that the message to be hashed should be somewhere in the torrent file but how can you get it.Thanks in advance.//Frank. Link to comment Share on other sites More sharing options...
GTHK Posted October 14, 2010 Report Share Posted October 14, 2010 Get the BEncode Editor and poke a .torrent, the info hash is a hash of the info dictionary. bittorrent.org has specifications. Link to comment Share on other sites More sharing options...
Ultima Posted October 15, 2010 Report Share Posted October 15, 2010 http://wiki.theory.org/BitTorrentSpecification#Tracker_Request_Parametersinfo_hash Link to comment Share on other sites More sharing options...
insane101 Posted October 20, 2010 Author Report Share Posted October 20, 2010 Thanks for the replies. I checked out the info_hash on the specification website posted above. It says that the hash value should come from the value of the info dictionary. My question now is, what does it mean by the value of the info? The info dictionary has many things like the list of files, paths, torrent name... Also, at the end of the torrent file there is a string called pieces that contains unreadable characters. What is that used for? Link to comment Share on other sites More sharing options...
DreadWingKnight Posted October 20, 2010 Report Share Posted October 20, 2010 Also, at the end of the torrent file there is a string called pieces that contains unreadable characters. What is that used for?You didn't read the page ultima linked then. That clearly tells you what the pieces string is for. Link to comment Share on other sites More sharing options...
insane101 Posted October 20, 2010 Author Report Share Posted October 20, 2010 The specification states that I need to hash the info dictionaryvalue, what does this mean exactly? What part of the followingexamplewould I hash?:infod6:lengthi184102912e4:name10:..........12:piecelengthi262144e6:6:pieces3:...eDo I hash the 'e' encapsulation value at the end of the listdictionary value?Do I hash the massive 'pieces' value?Do I put the 'infod' value into the hash?Also, I have noticed that there are two 'e' values at the very end ofthe torrent file. Should I be placing both of these values into thehash, or one, or none?Thanks Link to comment Share on other sites More sharing options...
Ultima Posted October 22, 2010 Report Share Posted October 22, 2010 ... If you really want to understand this (and judging by the type of questions you're asking, you actually need to), then you might want to take some time out to really figure out how bencoding itself works. To answer you any other way wouldn't really be helping you; it'd just be stalling the pain. If you have specific questions trying to understand bencoding, then that's fine, but asking us whether or not to include that second e is a very obvious indication that it'll be dangerous for you to proceed without the necessary fundamental understanding on hand, because there isn't a simple yes-or-no answer to that question.The 'info' dictionary is the value pointed to by the 'info' key in the root dictionary. The 'info' key is bencoded as 4:info. The 'info' dictionary (value) is bencoded as d...e. The specs very deliberately/explicitly state that the bencoded value is what gets hashed. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.