BitTorrent protocol encryption
Protocol encryption (PE), message stream encryption (MSE) or protocol header encrypt (PHE){{efn|Usually referred to as the more proper protocol header encryption.}} 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 (ISPs). However, encryption will not protect one from DMCA notices from sharing illegal content, as one is still uploading material and the monitoring firms can merely connect to the swarm.
MSE/PE is implemented in BitComet, BitTornado, Deluge, Flashget, KTorrent, libtorrent (used by various BitTorrent clients, including qBittorrent), 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 (non-BitTorrent) systems including eMule.{{cite web|url=http://www.emule-project.net/home/perl/help.cgi?l=1&rm=show_topic&topic_id=848|title=eMule protocol obfuscation (encryption)|publisher=emule-project.net|date=2006-09-16|access-date=2010-03-11|archive-date=2009-09-25|archive-url=https://web.archive.org/web/20090925023618/http://www.emule-project.net/home/perl/help.cgi?l=1&rm=show_topic&topic_id=848|url-status=live}}
Purpose
As of January 2005, BitTorrent traffic made up more than a third of total residential internet traffic,{{cite magazine|url=https://www.wired.com/wired/archive/13.01/bittorrent.html|title=The Bittorrent Effect|magazine=Wired|date=2007-05-30|access-date=2017-03-05|archive-date=2006-03-26|archive-url=https://web.archive.org/web/20060326210400/http://www.wired.com/wired/archive/13.01/bittorrent.html|url-status=live}} although this dropped to less than 20% as of 2009.{{cite web|url=http://www.sandvine.com/downloads/documents/2009%20Global%20Broadband%20Phenomena%20-%20Executive%20Summary.pdf|title=2009 Global Broadband Phenomena|publisher=Sandvine.com|date=2009-11-16|url-status=dead|archiveurl=https://web.archive.org/web/20091122162729/http://www.sandvine.com/downloads/documents/2009%20Global%20Broadband%20Phenomena%20-%20Executive%20Summary.pdf|archivedate=2009-11-22|df=}} 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 (PHE) 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.{{cite web|url=http://www.ipp2p.org/news_en.html|title=News|publisher=IPP2P.org|date=2006-01-04|access-date=2006-01-29|archive-date=2013-05-20|archive-url=https://web.archive.org/web/20130520031545/http://www.ipp2p.org/news_en.html|url-status=live}} 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 (then known as Azureus) decided to design and simultaneously implement a new, open protocol obfuscation method, called message stream encryption (MSE). It was included in Azureus CVS snapshot 2307-B29 on 19 January 2006.{{cite web|url=http://sourceforge.net/mailarchive/forum.php?thread_name=200601200753.k0K7rYp0016440%40aelitis.com&forum_name=azureus-commitlog|title=[Azureus-commitlog] CVS Snapshot Azureus2307-B29.jar has been released !|publisher=Sourceforge.net|date=2006-01-19|access-date=2013-04-08|archive-date=2019-09-24|archive-url=https://web.archive.org/web/20190924171204/https://sourceforge.net/p/azureus/mailman/azureus-commitlog/thread/200601200753.k0K7rYp0016440@aelitis.com/|url-status=live}}
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 (PE).
=MSE/PE in BitTorrent client versions=
- [https://aria2.github.io/ aria2] supports MSE/PE as of build v1.34,{{Cite web|url=https://aria2.github.io/manual/en/html/aria2c.html?highlight=encryption#cmdoption-bt-force-encryption|title=aria2c(1) — aria2 1.34.0 documentation|website=aria2.github.io|access-date=2019-05-29}} but is not enforced by default.
- BitComet version 0.63 was released 7 March 2006. It removed the old protocol header encryption and implemented the new MSE/PE to be compatible with Azureus and μTorrent.{{cite web|url=http://www.bitcomet.com/doc/changelog.htm|title=BitComet Client Release Notes|publisher=Bitcomet.com|date=2006-03-07|access-date=2006-03-07|archive-date=2010-12-17|archive-url=https://web.archive.org/web/20101217053502/http://www.bitcomet.com/doc/changelog.htm|url-status=live}}
- BitTornado supports MSE/PE as of build T-0.3.18. As of January 5, 2007, this build is still marked "experimental" on the Download page.{{cite web|url=http://forums.degreez.net/viewtopic.php?t=7074|title=BitTornado T-0.3.18|publisher=Degreez.net forum|date=2007-01-05|access-date=2007-01-06|archive-date=2017-03-25|archive-url=https://web.archive.org/web/20170325113536/http://forums.degreez.net/viewtopic.php?t=7074|url-status=live}}
- BitTorrent (Mainline) supports MSE/PE since version 4.9.2-beta on May 2, 2006.{{cite web|url=http://www.bittorrent.com/versionnotes.html|title=Version Notes |publisher=BitTorrent.com|date=2006-05-02|archive-url=https://web.archive.org/web/20060613094322/http://www.bittorrent.com/versionnotes.html |archive-date=2006-06-13}}
- Deluge supports MSE/PE as of Deluge-0.5.1.{{cite web|url=http://deluge-torrent.org/?p=15|title=Changelog: Deluge 0.5.1 (11 June 2007)|publisher=Deluge-torrent.org|date=2007-06-11|archive-url=https://web.archive.org/web/20080401062051/http://deluge-torrent.org/Changelog.php |archive-date=2008-04-01}}
- KTorrent implemented MSE/PE in SVN version 535386SVN [svn://anonsvn.kde.org/home/kde/trunk/extragear/network/ktorrent server]. KDE.org. 2006-04-29.Subversion client required. on April 29, 2006.{{cite web|url=http://ktorrent.pwsp.net/forum/viewtopic.php?t=432|title=Encryption has been added !|publisher=KTorrent.pwsp.net forum|date=2006-04-29|archive-url=https://web.archive.org/web/20070605174155/http://ktorrent.pwsp.net/forum/viewtopic.php?t=432 |archive-date=2007-06-05}}
- libtorrent{{Cite web|url=http://www.libtorrent.org/reference-Settings.html|title=www.libtorrent.org/reference-Settings.html|last=Norberg|first=Arvid|website=www.libtorrent.org|language=en|access-date=2017-02-16|archive-date=2017-02-17|archive-url=https://web.archive.org/web/20170217065352/http://www.libtorrent.org/reference-Settings.html|url-status=live}} implemented protocol encryption in v0.13{{Cite web|url=https://github.com/arvidn/libtorrent/blob/master/ChangeLog|title=libtorrent/ChangeLog at master · arvidn/libtorrent · GitHub|website=github.com|language=en|access-date=2017-02-16|archive-date=2017-05-10|archive-url=https://web.archive.org/web/20170510112541/https://github.com/arvidn/libtorrent/blob/master/ChangeLog|url-status=live}} released on 10 December 2011.{{Cite web|url=http://permalink.gmane.org/gmane.network.bit-torrent.rtorrent.devel/2525|title=Gmane -- Mail To News And Back Again|website=permalink.gmane.org|access-date=2017-02-16|archive-url=https://web.archive.org/web/20170217065728/http://permalink.gmane.org/gmane.network.bit-torrent.rtorrent.devel/2525|archive-date=2017-02-17|url-status=dead}}
- rTorrent supports MSE/PE as of rTorrent-0.7.0.{{cite web |url=http://rakshasa.no/pipermail/libtorrent-devel/2006-December/000982.html |title=[Libtorrent-devel] LibTorrent 0.11.0 and rTorrent 0.7.0 released |publisher=Rakshasa.no mail archive |date=2006-12-13 |access-date=2007-06-10 |archive-url=https://web.archive.org/web/20070502055625/http://rakshasa.no/pipermail/libtorrent-devel/2006-December/000982.html |archive-date=2007-05-02 |url-status=dead }}
- Transmission supports MSE/PE as of Transmission-0.90.{{cite web|url=http://transmission.m0k.org/forum/viewtopic.php?t=2631|title=Transmission 0.90 Released! |publisher=Transmission.m0k.org forum|date=2007-10-24|archive-url=https://web.archive.org/web/20071027022525/http://transmission.m0k.org/forum/viewtopic.php?t=2631|archive-date=2007-10-27}}
- Vuze (formerly Azureus) supports the final spec since 25 January 2006 (CVS snapshot 2307-B33).{{cite web|url=http://sourceforge.net/mailarchive/forum.php?thread_name=200601252228.k0PMSnp0024117%40aelitis.com&forum_name=azureus-commitlog|title=[Azureus-commitlog] CVS Snapshot Azureus2307-B33.jar has been released !|publisher=Sourceforge.net|date=2006-01-25|access-date=2013-04-08|archive-date=2019-09-24|archive-url=https://web.archive.org/web/20190924171211/https://sourceforge.net/p/azureus/mailman/azureus-commitlog/thread/200601252228.k0PMSnp0024117@aelitis.com/|url-status=live}} Azureus version 2.4.0.0 was released 10 February 2006, and was the first stable version of a client to support MSE/PE. However, glitches in Azureus' implementation resulted in improperly encrypted pieces that failed hash checking. The glitches were rectified as of version 2.4.0.2.{{cite web|url=http://azureus.sourceforge.net/changelog.php?version=2.4.0.2|title=Azureus : Java BitTorrent Client - Changelog|publisher=Azureus.sourceforge.net|access-date=2006-03-20|archive-date=2006-03-20|archive-url=https://web.archive.org/web/20060320195041/http://azureus.sourceforge.net/changelog.php?version=2.4.0.2|url-status=live}}
- μTorrent premiered MSE/PE 4 days after Azureus with beta 1.4.1 build 407.{{cite web|url=http://forum.utorrent.com/viewtopic.php?id=5384|title=μTorrent 1.4.2 beta 435|publisher=uTorrent Announcements|date=2006-01-29|url-status=dead|archive-url=https://web.archive.org/web/20060514085453/http://forum.utorrent.com/viewtopic.php?id=5384|archive-date=2006-05-14}} μTorrent version 1.5 (build 436) was released on 7 March 2006; it was the first stable version of μTorrent with PE.[http://forum.utorrent.com/viewtopic.php?id=7199 "μTorrent 1.5 released"] {{webarchive|url=https://web.archive.org/web/20130529090641/http://forum.utorrent.com/viewtopic.php?id=7199 |date=2013-05-29 }}. uTorrent Announcements. 2006-03-07.
Operation
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 (1024 bytes) 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.{{cite web|url=http://tools.ietf.org/html/rfc3526#section-8|title=RFC 3526 chapter 8|publisher=IETF.org|access-date=2007-08-26|archive-date=2017-01-18|archive-url=https://web.archive.org/web/20170118225103/https://tools.ietf.org/html/rfc3526#section-8|url-status=live}} 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 (a.k.a. MSE) 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.{{cite journal |url=http://www.iis.se/docs/hjelmvik_breaking.pdf |title=Breaking and Improving Protocol Obfuscation |last1=Hjelmvik |first1=Erik |last2=John |first2=Wolfgang |journal=Technical Report |date=2010-07-27 |publisher=Department of Computer Science and Engineering, Chalmers University of Technology |issn=1652-926X |access-date=2010-08-17 |archive-date=2020-11-11 |archive-url=https://web.archive.org/web/20201111154419/https://internetstiftelsen.se/docs/hjelmvik_breaking.pdf |url-status=live }}
The Sandvine application uses a different approach to disrupt BitTorrent traffic by making seeding impossible. Sandvine intercepts peer-to-tracker communication to identify peers based on the IP address and port numbers in the peer list returned from the tracker. When Sandvine later sees connections to peers in the intercepted peer lists, it may (according to policy) break these connections by sending counterfeit TCP resets. Various solutions exist to protect against Sandvine's attack including encrypting both peer-to-tracker and peer-to-peer communication, using Microsoft's Teredo so that TCP connections are tunneled within UDP packets, filtering TCP resets before they reach the TCP layer in the end-host, or switching entirely from a TCP-based transport to a UDP-based transport. Each solution has its trade-offs. Filtering out TCP resets typically requires kernel access, and the participation of the remote peer since Sandvine sends the reset packet to the local and remote peers.
Criticism
Bram Cohen, 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".{{cite web|url=http://bramcohen.livejournal.com/29886.html |title=Obfuscating BitTorrent |last=Cohen |first=Bram |author-link=Bram Cohen |publisher=Bram Cohen blog |date=2006-01-29 |url-status=dead|archive-url=https://web.archive.org/web/20060207023731/http://bramcohen.livejournal.com/29886.html |archive-date=2006-02-07 }} Many BitTorrent community users responded strongly against Cohen's accusations.{{cite web|url=http://forum.utorrent.com/viewtopic.php?id=5742|title=Debate over Protocol Encryption|publisher=uTorrent.com forum|date=2006-02-04|url-status=dead|archive-url=https://web.archive.org/web/20071022175414/http://forum.utorrent.com/viewtopic.php?id=5742|archive-date=2007-10-22}}
Cohen later added encrypted connections to his Mainline client{{cite web|url=http://www.bittorrent.com/versionnotes.html|title=BitTorrent Mainline Version History|publisher=BitTorrent.com|date=2006-10-15|archive-url=https://web.archive.org/web/20070225131829/http://www.bittorrent.com/versionnotes.html|archive-date=2007-02-25}} with the ability to receive but not originate them.{{citation needed|date=April 2013}} 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."[http://torrentfreak.com/interview-with-bram-cohen-the-inventor-of-bittorrent/ "Interview with Bram Cohen, the inventor of BitTorrent"] {{Webarchive|url=https://web.archive.org/web/20130715130429/http://torrentfreak.com/interview-with-bram-cohen-the-inventor-of-bittorrent/ |date=2013-07-15 }}. TorrentFreak. 2007-01-17. Retrieved 2013-04-07.
Notes
{{noteslist}}
References
{{reflist|colwidth=30em|refs=
|url=https://www.ndss-symposium.org/wp-content/uploads/2017/09/weav.pdf
|date=9 Feb 2009
|title=Detecting Forged TCP Reset Packets
|author1=Nicholas Weaver|author2=R. Sommer|author3=Vern Paxson
|conference=NDSS Symposium 2009
}}
}}
External links
- [http://wiki.vuze.com/w/Message_Stream_Encryption "Message Stream Encryption"]. Vuze.
- [http://wiki.vuze.com/w/Bad_ISPs "ISPs that shape BitTorrent"]. Vuze.
- [https://web.archive.org/web/20170711104140/http://www.slyck.com/news.php?story=1083 "BitTorrent End to End Encryption and Bandwidth Throttling - Part I" with μTorrent developers]. Slyck News.
- [https://web.archive.org/web/20160510034323/http://www.slyck.com/news.php?story=1098 "BitTorrent End to End Encryption and Bandwidth Throttling - Part II" with Azureus developers] Slyck News.
- [http://yro.slashdot.org/story/06/02/06/2039241/bittorrent-and-end-to-end-encryption "BitTorrent and End to End Encryption"]. Slashdot.
- [http://bittorrent.org/beps/bep_0008.html "Tracker Peer Obfuscation"]. BitTorrent.org.
- [https://web.archive.org/web/20121109160226/http://sourceforge.net/apps/mediawiki/spid/index.php?title=Identifying_the_Message_Stream_Encryption_%28MSE%29_protocol "Identifying the Message Stream Encryption (MSE) protocol" for Statistical Protocol IDentification]. SourceForge.
- [http://www.cisco.com/en/US/products/ps5855/products_configuration_example09186a0080ac3082.shtml "Block P2P Traffic on a Cisco IOS Router using NBAR"]. Cisco.
- [https://web.archive.org/web/20131006215023/http://gotux.net/arch-linux/aria2c-downloader-through-vpn-tunnel/ "Aria2c VPN/Proxy Tutorial"]. GoTux.
{{BitTorrent}}