BitTorrent Developers Introduce ISP Busting Encryption

Written by Nash on Friday, February 15, 2008 at 11:48 PM

Their are some ISPs who would like people to believe that “slowing down” BitTorrent or “metering” bandwidth consumption serves the greater good. which we know is total bull crap they use as a excuse not to upgrade their networks to provide the bandwidth required by their customers.

to get around this unfair and unethical and some cases illegal practice of throttling the traffic, Several BitTorrent developers have joined forces to propose a new protocol extension with the ability to bypass the BitTorrent interfering techniques used by ISPs. This new form of encryption will be implemented in BitTorrent clients including uTorrent, so users are once again free to use their net connections how ever they wish. the RFC for the new extension can be found here.
Here is some example python code that shows implementation of the new encryption.


from sha import sha
from random import randint
from struct import unpack
from rc4 import rc4 # rc4(k) generates k RC4 pseudorandom bytes.

rand = open("/dev/random","r").read
rc4 = rc4()

# tracker configuration
MAX_PEERS = 100

# per torrent state.
infohash = sha("dummy_info").digest()
pseudo = '' # pseudorandom RC4 string.
num_peers = 1000 # current swarm size.
tracker_peer_list = rand(6) * num_peers
obfuscated_tracker_peer_list = ''

def xor(plaintext,pseudo):
isint = False
if type(plaintext) == int: # convert to byte string.
plaintext = "".join([chr(int(x,16)) for x in "%.4x" % plaintext])
isint = True
n = len(pseudo)
ciphertext = "".join(
[chr(ord(pseudo[i%n])^ord(plaintext[i])) for i in xrange(len(plaintext))])
if isint:
ciphertext = unpack("!I", ciphertext)[0] # convert back to unsigned int
return ciphertext

def init(): # called once per rerequest interval.
global iv, x, n, n_xor_y, obfuscated_tracker_peer_list
iv = rand(20)
rc4.key = sha(infohash + iv).digest()
rc4(768) # discard first 768
x = rc4(4)
y = rc4(4)
n = min(num_peers, randint(MAX_PEERS * 2, MAX_PEERS * 4))
n_xor_y = xor(n,y)
pseudo = rc4(n*6)
obfuscated_tracker_peer_list = xor(tracker_peer_list,pseudo)

def getpeers( numwant ):
global iv, x, n, n_xor_y, obfuscated_tracker_peer_list
response = {}
response['iv'] = iv
numwant = min(numwant, MAX_PEERS)
if numwant > num_peers:
response['peers'] = obfuscated_tracker_peer_list
return response
i = randint(0,num_peers)
response['i'] = xor(i,x)
response['n'] = n_xor_y
response['peers'] = obfuscated_tracker_peer_list[i*6:(i+numwant)*6]
if len(response['peers']) < numwant * 6:
r = numwant - len(response['peers']) / 6
response['peers'] = response['peers'] + obfuscated_tracker_peer_list[:r]
return response

init()
print getpeers(20)



0 Responses to "BitTorrent Developers Introduce ISP Busting Encryption"

About this blog

This is me, this is my rants, i don't apologize for my views , idea or actions if you don't agree with me you are free to express your views.