Preventing the misuse of the libspotify key

The terms of use of libspotify indicate that the key should be stored in a secure manner. The only recommendation for storing the key that I found is to compile your application and distribute the binary. Itโ€™s not easy for me to see this as anything other than security from the unknown, since the key is easily retrieved using the debugger.

Is this a Spotify approach? What if I only compile the file containing the key and distribute the rest of my application as open source?

I assume that the essence of my question is this: how can I avoid breaking ToS without requiring each user to get their own key?

+4
source share
1 answer

The logic is this (I work for Spotify): requiring our developers to jump over a bunch of hoops just to get their API key into their binary will not be worth it - the developers will be disabled by it and everyone will be unhappy.

However, we donโ€™t want the keys to spread, simply because if everyone uses one key, we cannot reliably track it, and if this key is ultimately used for something malicious, and we kill it, a lot applications will be suddenly broken.

To force in a terrible car analogy, imagine that an API key is a valuable item, and your application is a car. If you leave the item on the car seat (i.e., having your API key in plain text), you practically invite someone to hack and steal it (i.e. use your key in your application). If you put it in the glove box (compile it into your binary), if someone breaks your car (parses your application) because he knows that the item is in the glove box, this is pretty much a game anyway.

In short: compilation in the key is an absolutely safe protection against obscurity, but we feel that it is enough to discourage people from accidentally reusing the API keys of other applications when it is quite trivial to get from us directly.

I assume that the essence of my question is this: how can I avoid breaking ToS without requiring each user to get their own key?

If you distribute your application in binary form, compiling it is fine. If you distribute it in its original form, you cannot include the key.

+6
source

All Articles