[BitTorrent] sha1 and .net class library

Harold Feit - Depthstrike.com Administrator dwknight at depthstrike.com
Fri Aug 27 13:19:23 EDT 2004


The infohash is calculated from the bencoded info dictionary in the
metafile.

I actually finished writing a vb.net based single-file torrent metafile
generator yesterday that does generate metafiles properly. (I hate byte
arrays in .net, I REALLY hate byte arrays in .net) My next steps will be to
handle multiple file torrents in the generator application and to add the
option to include several optional (unofficial) extensions to the metafile.
  -----Original Message-----
  From: antipast0 at yahoo.com [mailto:antipast0 at yahoo.com]
  Sent: Thursday, August 26, 2004 5:10 PM
  To: BitTorrent at yahoogroups.com
  Subject: [BitTorrent] sha1 and .net class library


  Hello all! I've been trying to calculate the info_hash from
  a .torrent, and it just seems like the SHA1 functions in .NET are
  broken. Either that, or I'm screwing up my text encoding.

  When I see an infohash in Azureus, for example, it looks like this:
  C159FAEF7CD129897FAB35BE2E98BFF420BFA2C2

  ... and I can get things to do a SHA1 hash similar to this, but they
  always come up different:
  6EF34A50CF03A98C4AA112DD47D572394234FE5B

  I guess my question would be... What encoding are the hashes in
  a .torrent file? Is that just raw binary? Hex? What are those block
  of hashes? I know that they are 20 blocks of hashes, but a lot of
  weird characters go on there.

  I've tried UTF8 (which has about the most success, if you can call it
  that), UTF7, Unicode, Big Endian Unicode, ASCII, etc...

  Its crazy that in PHP you just do sha1($infoarray) and everything
  works fine! Geez... silly microsoft.

  Second, when the specification says that this is a hash of the info
  dictionary's value, does that mean bencoded? and if so, does it
  include the dictionary's beginning "d" and ending "e" ? Perhaps I'm
  just including too much information, but technically that's the
  string value of the "info" key in the main dictionary.... Does it
  also include the length of the info dictionary beforehand?
  like "456:d..."

  Thank you guys so much,

  Thomas





        Yahoo! Groups Sponsor
              ADVERTISEMENT





----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/BitTorrent/

    b.. To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004


[Non-text portions of this message have been removed]




------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the BitTorrent mailing list