A method comprising, by a social networking system application on a mobile device: broadcasting, by a first mobile device of a first user, a message comprising an identifier associated with the first mobile device conditions for connecting to a network through the first mobile device and a user identifier for the first user receiving, by the first mobile device, a request from a second mobile device that comprises a second-user identifier corresponding to a second-user of the second mobile device wherein the second-user identifier corresponds to a respective user account of the second user in the social-networking system; determining, by the social networking system application on the first mobile device, whether the second mobile device is authorized to access the network through the first mobile device, and if the second mobile device is authorized to access the network through the first mobile device, by the first mobile device, configuring the first mobile device to provide network access to the second mobile device that is authorized to access the network, characterized in that, the method further comprises: encrypting the user identifier for the first user in the broadcast message using a symmetric key algorithm, wherein the key is a function of the user identifier for the first user, applying, by the second mobile device that received a broadcast message with the encrypted user identifier, a key generation function to generate keys for all users in a locally stored list of user identifiers in a local contacts database, decrypting the encrypted user identifier for the first user using one of the generated keys and declaring a match if the decrypted user identifier for the first user matches a user identifier in the local contacts data base. broadcasting, by a first mobile device of a first user, a message comprising an identifier associated with the first mobile device conditions for connecting to a network through the first mobile device and a user identifier for the first user receiving, by the first mobile device, a request from a second mobile device that comprises a second-user identifier corresponding to a second-user of the second mobile device wherein the second-user identifier corresponds to a respective user account of the second user in the social-networking system; determining, by the social networking system application on the first mobile device, whether the second mobile device is authorized to access the network through the first mobile device, and if the second mobile device is authorized to access the network through the first mobile device, by the first mobile device, configuring the first mobile device to provide network access to the second mobile device that is authorized to access the network, characterized in that, the method further comprises: encrypting the user identifier for the first user in the broadcast message using a symmetric key algorithm, wherein the key is a function of the user identifier for the first user, applying, by the second mobile device that received a broadcast message with the encrypted user identifier, a key generation function to generate keys for all users in a locally stored list of user identifiers in a local contacts database, decrypting the encrypted user identifier for the first user using one of the generated keys and declaring a match if the decrypted user identifier for the first user matches a user identifier in the local contacts data base. encrypting the user identifier for the first user in the broadcast message using a symmetric key algorithm, wherein the key is a function of the user identifier for the first user, applying, by the second mobile device that received a broadcast message with the encrypted user identifier, a key generation function to generate keys for all users in a locally stored list of user identifiers in a local contacts database, decrypting the encrypted user identifier for the first user using one of the generated keys and declaring a match if the decrypted user identifier for the first user matches a user identifier in the local contacts data base.