Changeset 10809
- Timestamp:
- 02/15/08 00:49:49 (2 years ago)
- Files:
-
- 1 modified
-
dotorg/trunk_fixed/html/beps/bep_0008.html (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk_fixed/html/beps/bep_0008.html
r10763 r10809 38 38 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Tracker Peer Obfuscation</td> 39 39 </tr> 40 <tr class="field"><th class="field-name">Version:</th><td class="field-body">10 762</td>41 </tr> 42 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_0008.rst">2008-02-1 4 13:37:25 -0800 (Thu, 14Feb 2008)</a></td>40 <tr class="field"><th class="field-name">Version:</th><td class="field-body">10808</td> 41 </tr> 42 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_0008.rst">2008-02-15 00:46:13 -0800 (Fri, 15 Feb 2008)</a></td> 43 43 </tr> 44 44 <tr class="field"><th class="field-name">Author:</th><td class="field-body">David Harrison <dave at bittorrent.com>, Anthony Ciani <tony at ciani.phy.uic.edu>, Arvid Norberg <arvid at bittorrent.com>, Greg Hazel <greg at bittorrent.com></td> … … 82 82 <h1>Announce Parameter</h1> 83 83 <p>When using this extension, instead of passing the <tt class="docutils literal"><span class="pre">info_hash</span></tt> parameter 84 to the tracker, a n<tt class="docutils literal"><span class="pre">sha_ih</span></tt> is passed.</p>84 to the tracker, a <tt class="docutils literal"><span class="pre">sha_ih</span></tt> is passed.</p> 85 85 <p>The value of <tt class="docutils literal"><span class="pre">sha_ih</span></tt> MUST be the info-hash of the torrent, with a second 86 86 SHA-1 applied to it.</p> … … 96 96 <div class="section" id="announce-response"> 97 97 <h1>Announce Response</h1> 98 <p>If the tracker supports this extension, the response should be exactly the 99 same as if the <tt class="docutils literal"><span class="pre">info_hash</span></tt> was passed, except that any field that contains 100 peer information (such as <tt class="docutils literal"><span class="pre">peers</span></tt>, <tt class="docutils literal"><span class="pre">peers6</span></tt> or any other field defined 101 by another extension) MUST be obfuscated as described in the next section.</p> 98 <p>If the tracker supports this extension, the response should be exactly 99 the same as if the <tt class="docutils literal"><span class="pre">info_hash</span></tt> had been passed, except that any 100 field that contains peer information (such as <tt class="docutils literal"><span class="pre">peers</span></tt>, <tt class="docutils literal"><span class="pre">peers6</span></tt> or 101 any other field defined by another extension) MUST be obfuscated as 102 described in the next section.</p> 102 103 <p>There are additional parameters the tracker may OPTIONALLY return. 103 104 These are discussed in the <a class="reference internal" href="#optimizations">optimizations</a> section.</p> … … 107 108 <p>We distinguish between the <em>tracker peer list</em> and the <em>returned peer 108 109 list</em>. The <em>tracker peer list</em> contains the ip-port pairs of all 109 known peers in a given torrent, i.e., those peers that have reported to110 t he tracker that they are downloading or seeding a given file with a111 given infohash. The tracker may store this peer list however it 112 wishes. The <em>returned peer list</em> contains a packed array of ip-port 113 pairs conforming to the BitTorrent protocol specification. If the 114 s warm is sufficiently large then the returned ip-port pairs constitute115 a subsetof the ip-port pairs in the <em>tracker peer list</em>.</p>110 known peers in a given torrent, i.e., those peers that have reported 111 to the tracker that they are transferring the file with a given 112 infohash. The tracker may store this peer list however it wishes. 113 The <em>returned peer list</em> contains a packed array of ip-port pairs 114 conforming to the BitTorrent protocol specification. If the swarm is 115 sufficiently large then the returned ip-port pairs constitute a subset 116 of the ip-port pairs in the <em>tracker peer list</em>.</p> 116 117 <p>The returned peer list is encrypted using RC4-drop768 encryption using 117 118 the infohash as a shared secret and optionally employing an … … 129 130 containing the initialization vector. The initialization vector can 130 131 be of arbitrary length and is sent in plaintext.</p> 131 <p>If the tracker sends no initialization vector then the first 64-bits132 of the infohash are used as the RC4 key. If the tracker provides an132 <p>If the tracker sends no initialization vector then the infohash is 133 used as the RC4 key (160 bit key). If the tracker provides an 133 134 initialization vector then the RC4 key is generated by appending the 134 vector to the infohash and then hashing with SHA-1. The first 64 bits135 of the resulting hash are then used as the RC4 key. The string from 136 which the RC4 key is derived whether it be the infohash or the SHA-1 of 137 theinitialization vector appended to the infohash is called the135 vector to the infohash and then hashing with SHA-1. The resulting 136 hash is then used as the RC4 key. The string from which the RC4 key 137 is derived whether it be the infohash or the SHA-1 of the 138 initialization vector appended to the infohash is called the 138 139 <em>intermediate string</em>.</p> 139 140 <p>For example, given infohash <tt class="docutils literal"><span class="pre">aaf4c61ddcc5e8a2dabedef3b482cd9aea9434d</span></tt> … … 141 142 is derived as follows:</p> 142 143 <pre class="literal-block"> 143 intermediate = sha1( 'aaf4c61ddcc5e8a2dabedef3b482cd9aea9434dabcd' ) 144 key = intermediate[0:64] 144 key = sha1( 'aaf4c61ddcc5e8a2dabedef3b482cd9aea9434dabcd' ) 145 145 </pre> 146 <p>where [i:j] denotes the ith through <em>jth</em> bit including the <em>ith</em> but147 excluding the <em>jth</em>. The resulting key in hex is <tt class="docutils literal"><span class="pre">f36e9cae87cf33e0</span></tt>.</p> 148 < p>A 64-bit key is used to avoid U.S. export restrictions.</p>146 <p>where [i:j] denotes the <em>ith</em> through <em>jth</em> bit including the <em>ith</em> 147 but excluding the <em>jth</em>. The resulting key in hex is 148 <tt class="docutils literal"><span class="pre">f36e9cae87cf33e07645ef5ca745a8a83469f31e</span></tt>.</p> 149 149 <p>It is RECOMMENDED that the tracker use the initialization vector, and 150 150 that it change the <tt class="docutils literal"><span class="pre">iv</span></tt> on roughly the same period as the rerequest … … 275 275 return the desired number of peers then it MAY include peers that are 276 276 not assumed to support MSE. If a peer closes a connection in response 277 to an encrypted header then the initiating peer SHOULD try other peers278 in the peer list returning to the peer that closed the connection only 279 when all other peers known or not yet known to support MSE have been 280 t ried and have failedto provide "adequate performance." We277 to an encrypted header then the initiating peer SHOULD assume that the 278 peer does not support MSE. The initiating peer however SHOULD ONLY 279 initiate unencrypted connections when all peers have been tried and 280 those that support MSE fail to provide "adequate performance." We 281 281 intentionally omit any definition of "adequate performance."</p> 282 282 </div> … … 450 450 global iv, x, n, n_xor_y, obfuscated_tracker_peer_list 451 451 iv = rand(20) 452 rc4.key = sha(infohash + iv).digest() [0:8]452 rc4.key = sha(infohash + iv).digest() 453 453 rc4(768) # discard first 768 454 454 x = rc4(4)