Open-sourcing Nameless Credential Service

  • Meta has open-sourced Anonymous Credential Service (ACS), a extremely accessible multitenant service that enables shoppers to authenticate in a de-identified method.
  • ACS enhances privateness and safety whereas additionally being compute-conscious.
  • By open-sourcing and fostering a group for ACS, we consider we are able to speed up the tempo of innovation in de-identified authentication.

Information minimization — amassing the minimal quantity of information required to help our companies — is one in all our core ideas at Meta as we develop new privacy-enhancing technologies to guard person knowledge on our household of merchandise. The objective is to ship priceless person experiences whereas amassing and utilizing much less knowledge. 

Our method to logging is one essential instance of this follow. Logging helps our engineers and builders consider efficiency and reliability, enhance product options, and generate stories.

Consumer identities aren’t essential in most logging use instances and must be excluded from logging knowledge. Eradicating authentication is one approach to take away identifiers. However doing so makes the system weak to numerous assaults, together with knowledge injection

At Meta, we’ve constructed a greater approach for shoppers to authenticate in a de-identified method: Nameless Credential Service (ACS). At a excessive stage, ACS helps de-identified authentication by splitting authentication into two phases, token issuance and token redemption. Within the token issuance section, shoppers contact the server via an authenticated channel to ship a token. The server indicators the token and sends it again. Then, within the de-identified authentication (or token redemption) section, shoppers use a de-identified channel to submit knowledge and authenticate it using a mutated type of the token relatively than a person ID.

ACS has performed an essential function in how we do de-identified authentication at scale. Now we’ve open-sourced it so the bigger group can each profit from ACS and assist speed up innovation in de-identified authentication.

Right here’s how we developed ACS, and how one can get began utilizing it.

An outline of the nameless credential protocol

The anonymous credential protocol is constructed on high of verifiable oblivious pseudorandom capabilities (VOPRFs) and blind signatures. 

Taking logging for example once more, we remedy the issue of de-identified logging by splitting the workflow into two steps: First, shoppers use an authenticated connection to the server to acquire an nameless credential prematurely. Then, at any time when the shoppers have to add logs, they ship the nameless credential together with the logs in an unauthenticated connection to the server. The nameless credential serves as proof that the shopper is genuine.

de-identified authentication anonymous credential service

Right here’s how the method performs out:

Step 1 (token issuance):

  1. The shopper generates a token.
  2. The shopper blinds the token.
  3. The shopper sends the blinded_token to the server, together with authentication knowledge.
  4. The server indicators the blinded_token after which sends the signed_blinded_token again to the shopper.
  5. The shopper unblinds the obtained token, leading to a signed_unblinded_token.

Step 2 (token redemption):

  1. The shopper sends the unique token, signed_unblinded_token, together with the enterprise knowledge it wants for the use case (e.g., logging occasions) to the server.
  2. The server validates the request with tokens. If the shopper is genuine and approved to entry, the server will course of the enterprise knowledge.

This protocol is efficient as a result of:

  • The enterprise knowledge and authentication knowledge are separated.
    • The enterprise knowledge is distributed with unblinded tokens, and authentication knowledge is distributed with a blinded token. It’s noteworthy that the token issuance step and token redemption step don’t occur on the identical time — the shopper can retailer tokens for a number of hours and even a number of days. If the shopper desires to log knowledge however is out of tokens, they will fetch a token and redeem it instantly. However these two steps are put into separate requests to assist forestall an identification from being inferred from the info.
  • The token, along with signed_unblinded_token, serves because the legitimation of the shopper. The token issuance server makes use of a secret key to signal tokens, and that secret key can’t be inferred from client-side observations (see: decisional Diffie–Hellman assumption). 

Challenges of the nameless credential protocol

To make the protocol work in real-life, large-scale programs, there are extra challenges to be solved.

Token redemption counting

Ideally, one credential might be redeemed solely as soon as. However in follow, it’s acceptable to permit a credential to be redeemed a number of instances (as outlined by the use case) to scale back server load. We utilized a real-time, dependable, and secured counting service to restrict the variety of token redemption instances.

Key rotation

The nameless credential protocol requires a key pair. The server makes use of a secret key to signal the token (step 1.4) and validate the redemption request (step 2.2). The shopper wants a corresponding public key to unblind the token (step 1.5).

Given this, key administration — particularly, rotating keys continuously and discarding stories from outdated keys — performs an important function in guaranteeing that we are able to mitigate the influence of shoppers if they’re compromised after they’re issued a credential. These key rotations should be deployed throughout the fleet in a constant  and environment friendly method. The important thing administration service interacts with the configuration administration system to mutate key supplies for ACS tenants in accordance with the cipher suites and key rotation schedules specified of their configuration recordsdata. 

There are additionally challenges round distributing new verification keys to shoppers that want to confirm credentials.

Key transparency and attribute-based VOPRFs

The design of our attribute-based VOPRFs is motivated by our want for an environment friendly and clear technique round key rotation.

Frequent key rotations present a safety measure for ACS. Nevertheless, a malicious server can establish customers by signing each with a user-specific key that may be tied again to them throughout credential redemption. 

Key transparency makes it doable for customers to find out about all of the accessible public keys, stopping the server from assigning user-specific key pairs. Furthermore, at Meta we have to handle many keys for every ACS use case, and sustaining naively generated keys will not be scalable.

We solved this downside by introducing key derivation capabilities (KDFs). At a excessive stage, given any attributes (e.g., a gaggle of strings), new secret keys might be derived from public keys, which might additional be derived from a single public key. By setting the attributes to seek advice from the time epoch for which the keys are legitimate, shoppers might be verified simply with out the necessity to fetch new public keys.

Because of this, we are able to lengthen the transparency of the first public key — which might be shipped with shopper code or posted to a trusted location — to those derived public keys with none extra effort.

Deploying nameless credential protocol at scale

With these concerns in thoughts, a typical ACS deployment seems to be extra like:

Setup (step 0):

  1. The shopper obtains the server’s major public key and different public parameters.
  2. The server generates a key pair utilizing given attributes (use case identify, time epoch, recognized to shoppers) after which sends the general public key to the shopper.
  3. The shopper validates the general public key with the first public key and attributes.

Step 1 (token issuance):

  1. The shopper generates a token.
  2. The shopper blinds the token.
  3. The shopper sends the blinded_token to the server, together with authentication knowledge.
  4. The server checks the token issuance fee for the precise person. It then indicators the blinded_token and sends the signed_blinded_token again to the shopper.
  5. The shopper unblinds the obtained token, leading to a signed_unblinded_token. 

Step 2 (token redemption):

  1. The shopper sends the unique token, signed_unblinded_token, together with the enterprise knowledge it wants for the use case (e.g., logging occasions) to the server.
  2. The server validates the request and checks the redemption instances for the precise token. If the shopper is genuine and approved to entry, the server will and course of the enterprise knowledge. 

Step 0.3 performs an essential function in sustaining key transparency. If a malicious server is assigning public keys that correlate to person authentication knowledge, the validation step would fail and the shopper may refuse to make use of the general public key obtained.

Learn the paper “DIT: De-identified authenticated telemetry at scale” for extra mathematical particulars for the protocol.

The ACS library

The ACS repo gives a portal and extensible C library (within the /lib/ folder), whose fundamental parts embrace:

  • The VOPRF protocol: This contains client-side token blinding, unblinding, and producing a shared secret for token redemption. For servers, the protocol contains signing the blinded token and producing a server-side shared secret for token redemption. There are two variations of the blinding methodology offered within the library.
  • An attribute-based key derivation perform: It is a key rotation resolution. If the attributes are set to a typical recognized worth (e.g., time epoch), shoppers can confirm the authenticity of the server simply. There are a number of KDFs offered within the library. We suggest Robust Diffie–Hellman Inversion (SDHI) or Naor-Reingold for higher key transparency.
  • Discrete log proof: That is used to show the authenticity of the server. It’s used twice within the protocol — first, to confirm the general public key derived from attributes within the setup step, and second, to confirm the signed token in token issuance step
  • Elliptic curves: The ACS library is modular, and customers can select most popular elliptic curves. Ed25519 and Ristretto are at present offered.     

The library is meant to be deployed on cellular gadgets, so we wish to decrease exterior dependencies to maintain the binary dimension small. Presently, libsodium is the one dependency for the ACS library.

Along with that, we now have applied a SimpleAnonCredService (server + shopper) in C++ for demonstration functions. The service is constructed with Apache Thrift 0.16. (See the /demo/ folder within the repo.)

Learn how to use ACS in an actual system

Let’s use an instance to reveal the workflow. Suppose we’re sustaining a service that enables authenticated customers to get climate stories. A naive system will seem like this:

# shopper
# server
if check_authentication(request.authentication_data): = report_data

Step one is to separate the authentication_data from report_data, which is the primary function of the ACS challenge. 

# shopper - authentication
token = random_string()
blinded_token, blinding_factor = blind(token)
signed_blinded_token = request_token_from_server(authentication_data, blinded_token)
signed_unblinded_token = unblind(signed_blinded_token, blinding_factor)
# shopper - get knowledge
client_secret = client_finalize(token, signed_unblinded_token)
get_report(token, client_secret)
# token issuance server
if check_authentication(request.authentication_data):
    signed_blinded_token = consider(blinded_token)
    response.signed_blinded_token = signed_blinded_token
# token redemption server
server_secret = server_finalize(request.token)
if server_secret == request.client_secret: = report_data

After the shopper is authenticated and requests the info it wants, the shopper generates a token, blinds the token, and sends the token to the server. After an authentication verify, the server indicators the token and sends it again to the shopper. The shopper then unblinds the signed token, after which verifies it with the general public key and proof.

Lastly, the shopper redeems the token. The server validates the key key and proceeds to enterprise logic if the validation succeeds. If the validation fails, the server rejects the request.

Once we launched key rotation and KDF, it added two extra steps to start with of the method:

  1. The shopper downloads the first public key from the server. This major public key’s for validation of the general public key in step 2.
  2. The shopper will get a public key for offered attributes. The attributes might be any checklist of strings (e.g., use case names, dates) which can be allowed by the server. KDFs permit for key transparency. After this step, the shopper will probably be assured that the server will not be assigning a public key associated to the authentication data. Later, the general public key can be utilized within the verifiable_unblind step to ensure the signed_blinded_token is signed with the personal key similar to the verified public key.
# shopper - setup
primary_public_key = request_primary_public_key_from_server()
# shopper - authentication
public_key, pk_proof = get_public_key_from_server(attribute)
if !dleqproof_verify(public_key, pk_proof, primary_public_key, attribute):
    increase Exception("malicious server!")
token = random_string()
unblinded_token, blinding_factor = blind(token)
signed_blinded_token, proof = request_token_from_server(authentication_data, blinded_token)
signed_unblinded_token = verifiable_unblind(signed_blinded_token, blinding_factor, proof, public_key)

With all these steps, we’ve prevented a probably malicious server from utilizing these key rotations to segregate and establish customers. It is a good prototype system and able to use. However in a scalable system, there are extra challenges to beat, together with client-side token storage and server-side fee limiting. These options will not be included in ACS’s open supply repo.

Future plans for ACS

Wanting on the future, we consider the modular ACS is extensible and has the potential to be helpful to industries that make the most of nameless credential options. We’re planning to implement the standard.

A lightweight model with out libsodium dependency will probably be helpful to make use of instances the place binary dimension is proscribed. 

In case you’d prefer to contribute to the challenge, please go to the ACS GitHub.