BitTorrent protocol encryption


Protocol encryption, message stream encryption or protocol header encrypt are related features of some peer-to-peer file-sharing clients, including BitTorrent clients. They attempt to enhance privacy and confidentiality. In addition, they attempt to make traffic harder to identify by third parties including internet service providers.
MSE/PE is implemented in BitComet, BitTornado, Deluge, Flashget, KTorrent, libtorrent, Mainline, μTorrent, qBittorrent, rTorrent, Transmission, Tixati and Vuze. PHE was implemented in old versions of BitComet. Similar protocol obfuscation is supported in up-to-date versions of some other systems including eMule.

Purpose

As of January 2005, BitTorrent traffic made up more than a third of total residential internet traffic, although this dropped to less than 20% as of 2009. Some ISPs deal with this traffic by increasing their capacity whilst others use specialised systems to slow peer-to-peer traffic to cut costs. Obfuscation and encryption make traffic harder to detect and therefore harder to throttle. These systems were designed initially to provide anonymity or confidentiality, but became required in countries where Internet Service Providers were granted the power to throttle BitTorrent users and even ban those they believed were guilty of illegal file sharing.

History

Early approach

Protocol header encryption was conceived by RnySmile and first implemented in BitComet version 0.60 on 8 September 2005. Some software like IPP2P claims BitComet traffic is detectable even with PHE. PHE is detectable because only part of the stream is encrypted. Since there are no open specifications to this protocol implementation the only possibility to support it in other clients would have been via reverse engineering.

Development of MSE/PE

In late January 2006 the developers of Vuze decided to design and simultaneously implement a new, open protocol obfuscation method, called message stream encryption. It was included in Azureus CVS snapshot 2307-B29 on 19 January 2006.
This first draft was heavily criticized since it lacked several key features. After negotiations between different BitTorrent developers a new proposal was written and then implemented into the Azureus and μTorrent betas within days. In μTorrent, the new protocol was called protocol encryption.

MSE/PE in BitTorrent client versions

The BitComet PHE method used in versions 0.60 to 0.62 is neither published, nor is it compatible with MSE/PE.
MSE/PE uses key exchange combined with the infohash of the torrent to establish an RC4 encryption key. The key exchange helps to minimize the risk of passive listeners, and the infohash helps avoid man-in-the-middle attacks. RC4 is chosen for its speed. The first kibibyte of the output is discarded to prevent the Fluhrer, Mantin and Shamir attack.
The specification allows the users to choose between encrypting the headers only or the full connection. Encrypting the full connection provides more obfuscation but uses more CPU time.
To ensure compatibility with other clients that don't support this specification, users may also choose whether unencrypted incoming or outgoing connections are still allowed.
Supported clients propagate the fact that they have MSE/PE enabled through PEX and DHT.

Security

The estimated strength of the encryption corresponds to about 60–80 bits for common symmetrical ciphers. Cryptographically, this effective key length is quite low, but appropriate in that the protocol was not designed as a secure transport protocol but rather as a fast and efficient obfuscation method. AES was proposed as the encryption method, but not adopted because it consumed too much CPU time. The required Diffie–Hellman keys to achieve a security equal to AES would have been much bigger or require elliptic curve cryptography, making the handshake more expensive in terms of used CPU time.

Effectiveness

Analysis of the BitTorrent protocol encryption has shown that statistical measurements of packet sizes and packet directions of the first 100 packets in a TCP session can be used to identify the obfuscated protocol with over 96% accuracy.

Criticism

, the inventor of BitTorrent, opposed adding encryption to the BitTorrent protocol. Cohen stated he was worried that encryption could create incompatibility between clients. He also stressed the point that the majority of ISPs don't block the torrent protocol. In 2006 Cohen wrote "I rather suspect that some developer has gotten rate limited by his ISP, and is more interested in trying to hack around his ISP's limitations than in the performance of the internet as a whole". Many BitTorrent community users responded strongly against Cohen's accusations.
Cohen later added encrypted connections to his Mainline client with the ability to receive but not originate them. Notably, when μTorrent was purchased by BitTorrent, Inc. and then became the next mainline release, the ability to originate encrypted connections was retained, but it became turned off by default. In an interview in 2007, Cohen stated "The so-called 'encryption' of BitTorrent traffic isn't really encryption, it's obfuscation. It provides no anonymity whatsoever, and only temporarily evades traffic shaping."