Keys are the hardest currency to get but they can be earned. Keys are mainly earned by finishing quests or achievements. It is a very slow process and many people resort to buying them directly.
You can buy them directly from Zynga using the in game purchasing system. Just click on the + sign next to your key balance in the game and you will be offered various key packages that you can buy for cash.
This is the article page for keys. See the category page here for a list of the different types of in game currency and related pages.