---
title: "Protect Your Users' Privacy With DTSHashedContacts"
url: https://deallocatedobjects.com/posts/protect-your-users-privacy-with-dtshashedcontacts
author: Jake Marsh
published: 2012-02-15
updated: 2013-11-16
link: https://github.com/crossforward/HashedContacts
topics: ["iOS Development", "Open Source"]
description: "As I’m sure many readers have heard, there has been some public outcry lately on the subject of iOS apps accessing the Address Book contacts of a their users and then sending the whole lot of them off to their servers, to accomplish their “friend matching” features."
---

# Protect Your Users' Privacy With DTSHashedContacts

By Jake Marsh, February 15, 2012. HTML: https://deallocatedobjects.com/posts/protect-your-users-privacy-with-dtshashedcontacts

This is a link post about https://github.com/crossforward/HashedContacts

As I'm sure many readers have heard, there has been [some](http://mclov.in/2012/02/08/path-uploads-your-entire-address-book-to-their-servers.html) [public](https://web.archive.org/web/20120216225825/http://blog.path.com/post/17274932484/we-are-sorry) [outcry](http://www.macrumors.com/2012/02/15/congress-weighs-in-on-ios-apps-collecting-address-book-and-other-personal-data/) lately on the subject of iOS apps accessing the Address Book contacts of a their users and then sending the whole lot of them off to their servers, to accomplish their "friend matching" features.

Many companies have [already](https://web.archive.org/web/20120216225825/http://blog.path.com/post/17274932484/we-are-sorry) [corrected](http://www.pcmag.com/article2/0,2817,2400154,00.asp) the error in their ways, (partially), and [even Apple has stated](http://www.macrumors.com/2012/02/15/apple-to-require-explicit-permission-for-ios-apps-accessing-address-book-data/) that a future iOS release will lock down Address Book access, in the same way that permission is required to access a user's geographic location now.

In the meantime however, if you'd like a quick, easy and safe way to build a "find my friends" type of feature into your app, I'd recommend looking at [`DTSHashedContacts`](https://github.com/crossforward/HashedContacts).

It's is a drop-in iOS library that provides a wrapper around the Address Book frameworks designed to ensure the privacy of user data. Before access is ever made to the Address Book the user will first be prompted for permission with a customizable `UIAlertView` prompt. Once access is granted the library returns hashed tokens representing the user's private data rather than the data itself.

Here's what it looks like to use it:

``` objc
[hashedContactsProvider emailTokensWithConfirmation:^(NSArray* tokens) {
//When permission given
} whenDeclined:^{
//When permission denied
}];
```

[Read more about `DTSHashedContacts` on Github](https://github.com/crossforward/HashedContacts)
