BBC IPlayer XOR Decryption
As has been widely reported, it is still possible to successfully download the x264 MPEG streams of BBC programmes from the BBC IPlayer service but that they are now XOR “encrypted” in such a way that they will only play on Apple mobile devices.

It’s not really encryption, is it
Long story short, the streams are XOR’d with a two-byte repeating pattern. It’s not yet clear how the iPhone picks up the two-byte key for this XOR scheme, or what kind of inside knowledge was needed to discover the capability (collusion?), but it’s rumoured that the XOR scheme has actually broken the iPod Touch functionality. If this is true it’s a massive WTF and probably rules out any idea of the BBC colluding with Apple over this.
Putting the moral arguments for the BBC’s latest move aside for a second. It’s fairly simple to deXOR the files and there are already a handful of pre-written scripts for doing just that.
So, What Are The Options?
Paul Battley has patched his iplayer-dl script so that it will continue to function in light of the XOR encryption. He’s also planning on patching the Windows GUI version for n00bs.
There’s a nice little perl script which should prove pretty useful for those of use already using one of the perl based solutions to access the TV shows we’re forced to pay for.
Most interestingly i’ve found some C++ code for decrypting the streams which is available at beebhack along with simple instructions for how to compile it for use.
The cat and mouse game continues. Yawn.
Update: June 12th 2008 Paul Battley has released updated versions of both his ruby command line tool and the Windows GUI download client. Not only that but this morning, new releases of both have appeared which utilise faster XOR decryption. His blog post details the changes.
The new project page for iPlayer Downloader is at http://po-ru.com/projects/iplayer-downloader/
Posted in Rants | Tagged with: anti-DRM, bbc, iplayer, open source


June 12th, 2008 at 4:50 pm
There is also fast XOR decode functionality in the Perl ‘get_iplayer’ script at http://linuxcentre.net/get_iplayer/ . This program also does BBC programme indexing and caching to make the whole process much less painful. It can also be called from a job scheduler such as cron to batch download programmes that match a certain search pattern.
June 18th, 2008 at 11:54 pm
It gets better. http://linuxcentre.net/get_iplayer/get_iplayer can now download (and stream) unencrypted iplayer movies. Seems that the BBC were using two web bugs to whitelist the cookies used for the stream download.
June 19th, 2008 at 8:02 am
Thanks, P. I’ll have to take a look