Sync Dev: How Secure is a Sync Key?

Developing on the BitTorrent Sync API? Our developer evangelist is here to work with you.

Most of my speaking engagements around Sync focus on what I consider are three fundamentally great features of Sync: its speed, security and price.  We have some exciting speed data to share in the future, but for today, lets talk about security.  I have a bit of background in mathematics — security and cryptanalysis, specifically — so I’ve wanted to tackle the topic of Sync Key security and AES for a while now.

It’s also worth noting that keys form the foundation of links, an important new feature of the recent 1.4 update, as many of you may have seen.

So while preparing to write about Sync Key security, I had a number of great ideas around using BitTorrent HQ’s built-to-the-hilt, six-core Intel Xeon Apple Mac Pro to crunch numbers or do some brute forcing, but the more I thought about things, the less necessary that seemed. That said, I understand that not everyone has the time to go back a year or so on the Sync Forum, so I present to you some of the great information I’ve gleaned from Sync users.

Forum participant “Tsu” asks of the Sync Key:

But that is in case of someone actually trying to crack my e-mail or Dropbox account. They can’t access my e-mail account my random luck because a username and password match has to be made. In the case of a secret they only need to randomly get the same secret as me. Chances are slim but they do exist right?

It’s a good question – what are the chances that someone might randomly generate the exact same Sync Key that I have and gain access to my folder full of photos of my Dachshund, Chloe?

Forum member “JoelM” had this response, which I found accurate and concise and probably better-worded than I can manage:

I was not sure about the security of the secret too, but then I did some math. Sync uses or did use (I don’t know what it currently uses) Base32 encoding. That encoding uses a-z and 2-7 so you have a total of 32 characters to use in the secret.

Small example:
The secret is limited to 1 character and there is only one shared folder (only one secret is in use, the others are not used). So there is a 3.125% (1/32) chance of collision. It will take up to 32 guesses to find what secret is in use; or 0.640 seconds (based on 20 milliseconds per guess).

Those odds sound pretty bad.

Real world:
The secret is 32 characters. Let’s assume that there are 60 trillion shared folders (60 trillion secrets are in use, the rest are not in use). The total number of possible secrets for 32 characters is 1,461,501,637,330,900,000,000,000,000,000,000,000,000,000,000,000. The chance of a collision with any of those 60 trillion secrets is 0.000000000000000000000000000000004105%. Wolfram|Alpha says it will take up to 1.1*10^15 of the age of the universe (14 billion years) to guess one secret, not a specific one.

Thus to guess one random secret it will take up to 15 septillion, 437 sextillion, 700 quintillion years.

TL;DR:
Basically if every person on the planet was sharing 9,000 folders and trying to guess another secret, then the sun would be out long before one person got someone’s secret.

Check out the entire thread here for more context and info.

I also thought about discussing AES – which Sync uses to encrypt data in transit (the Sync API encrypts twice when you use encrypted Sync – once before transmit and again during!). AES has been discussed at length by folks much more qualified to talk about it.

So, rather than rehash what others have already said, I think it’s best to redirect you to these great sources: EETimes.com – How secure is AES against brute force attacks? and Schneier on Security – Can the NSA Break AES?

Nothing is 100% secure, but I feel fairly confident moving my data using Sync.  How about you?

Photo: Flickr/JimPennuci