How Meta built large-scale cryptographic monitoring
Meta logs every operation in FBCrypto, its managed cryptographic library, without sampling by aggregating identical events into per-event counts in an in-process buffer and flushing them periodically to Scribe, with data landing in Scuba and Hive. The buffer is a folly::ConcurrentHashMap shared across threads. Randomized first-flush delays smooth write spikes, and derived-key operations are rolled up under the parent key name to cut volume while still giving a pessimistic count for detecting key overuse. The resulting dataset drives key rotation, inventories of weak and quantum-vulnerable algorithms for migration, migration-safety alarms based on success rates, and fleet-wide library version tracking. Remaining challenges include Scribe and Scuba capacity and flushing safely at shutdown.
Related posts
- How Meta enables de-identified authentication at scale
Meta Engineering mediumAdeptMeta's Anonymous Credential Service (ACS) authenticates clients without user IDs by splitting authentication into token issuance over an authenticated channel and unlinkable token redemption over an anonymous channel, built on VOPRFs and blind signatures with an HMAC over business data keyed by a shared secret. ACS is a multitenant C++ Thrift service on Twine that isolates use cases with per-use-case keys and rotates them routinely. It serves hundreds of thousands of requests per second for WhatsApp's de-identified telemetry. Scaling lessons include configurable credential reuse limits backed by a ZippyDB counter to cut capacity costs, dithering plus a global rate limiter to absorb synchronized nightly client spikes, and self-service onboarding with Android/iOS SDKs so teams need no cryptography expertise.
- Protecting user data through source code analysis at scale
Meta Engineering mediumAdeptMeta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships. Rules define sources (user-controlled parameters such as a result count or target ID) and sinks (data returned to the user), and a possible flow between them is raised as an issue for triage. In a mock followers endpoint, an uncapped count lets scrapers pull entire follower lists in one request and slip past rate limiting. The fix clamps count to a maximum, forcing scrapers into many more requests that rate limits then catch. Static analysis cannot catch scrapers that mimic legitimate usage, so it is one part of a broader defense.
- How Meta is improving password security and preserving privacy
Meta Engineering mediumAdeptMeta's Private Data Lookup (PDL) checks new passwords against breached-password datasets using Private Set Intersection, so the server learns neither the attempted password nor whether it matched. The client sends a per-request blinded hash H(p)^a, the server double-blinds it with a long-term key b and returns blinded hashes of leaked passwords, and the client unblinds and matches locally. To make this practical, leaked passwords are pre-blinded offline, the dataset is sharded by a short hash-prefix index, and returned values are truncated to cut bandwidth. The check flags a password appearing anywhere in a breach, not just a matching username/password pair, and is deployed in Enterprise Center's account creation and reset flows.
- Post-Quantum Cryptography Migration at Meta: Framework, Lessons, and Takeaways
Meta Engineering mediumAdeptMeta proposes PQC Migration Levels (PQ-Unaware, Aware, Ready, Hardened, Enabled) as a way to track how quickly each use case could respond to a quantum threat. Its migration framework runs through six steps: prioritization, cryptographic inventory, resolving external dependencies, building PQC components, guardrails, and integration. Applications are ranked by quantum risk. Public-key encryption and key exchange are high priority because of store-now-decrypt-later attacks, signatures are medium (split by how easily they can be patched), and symmetric crypto exposed only to Grover's attack is low. Meta recommends sticking to NIST standards: ML-KEM768 and ML-DSA65 by default, with ML-KEM512 and ML-DSA44 allowed where performance demands it, and HQC as a backup built on different math.
- PrivacyLib: Privacy Controls at the Data Access Boundary
Meta Engineering mediumAdeptPrivacyLib is a common library embedded in the clients of hundreds of Meta data and processing systems that enforces and observes privacy requirements at the point of data access. Each system integrates once by mapping its native APIs to five common operations (read, write, RPC, request entry, inline execution). New requirements then ship as enforcing modules such as Policy Zones or observing modules such as Privacy Probes and Agent Observability, taking days per system instead of months. To sustain billions of checks per second, requirements are compiled at build time, checks are answered from per-request and per-host caches, telemetry is deduplicated with Bloom filters, and signed tokens let ServiceRouter verify raw RPCs that passed client-side checks. A walkthrough shows Logger blocking writes of messaging metadata to tables that lack the right annotation.