The Edge of Developed Practice in Searching Encrypted Data

Kenn White (MongoDB)

USENIX Enigma Conference 2023 · Day 1 · Grand Ballroom

Overview

In "The Edge of Developed Practice in Searching Encrypted Data," Kenn White of MongoDB delivers a compelling and critically important talk on the challenges and breakthroughs in achieving practical, end-to-end encrypted search within operational database systems. White dismantles common misconceptions surrounding database encryption, highlighting that traditional methods like disk encryption or even transparent database encryption often leave sensitive data vulnerable to privileged insiders or server-side compromises. The core problem addressed is the "trust dilemma": how to enable complex, expressive queries on encrypted data without ever exposing the cleartext or encryption keys to the database server itself.

Watch on YouTube · Slides

Visual summary for The Edge of Developed Practice in Searching Encrypted Data by Kenn White
Visual summary for The Edge of Developed Practice in Searching Encrypted Data by Kenn White

Key moments

  1. 0:50 Misconceptions about database encryption and "data at rest"
  2. 4:15 Defining true end-to-end encrypted search for cryptographers
  3. 10:00 Challenges of distributed cloud databases for encryption
  4. 12:30 The need for expressive encrypted search capabilities
  5. 19:30 Breakthrough: Emulating blinded state for queryable encryption
  6. 21:00 High-level flow of queryable encryption architecture
  7. 24:00 Practical trade-offs, performance, and public preview status
  8. 28:40 Future outlook: structure encryption and raising attacker bar

The Edge of Developed Practice in Searching Encrypted Data

Speakers: Kenn White, (MongoDB)

Conference: USENIX Enigma

YouTube: https://www.youtube.com/watch?v=n9XsJJ4WsxQ

Overview

In "The Edge of Developed Practice in Searching Encrypted Data," Kenn White of MongoDB delivers a compelling and critically important talk on the challenges and breakthroughs in achieving practical, end-to-end encrypted search within operational database systems. White dismantles common misconceptions surrounding database encryption, highlighting that traditional methods like disk encryption or even transparent database encryption often leave sensitive data vulnerable to privileged insiders or server-side compromises. The core problem addressed is the "trust dilemma": how to enable complex, expressive queries on encrypted data without ever exposing the cleartext or encryption keys to the database server itself.

White emphasizes that while academic research has explored various forms of encrypted search, many proposed solutions are impractical for real-world, distributed, high-concurrency database environments. His presentation details MongoDB's journey, in collaboration with Brown University's Encrypted Systems Lab, to develop Queryable Encryption – a novel approach that allows databases to perform searches on fully encrypted data while maintaining sub-linear performance and developer usability. This innovation significantly raises the bar for data confidentiality, offering a critical advancement for organizations handling sensitive information under strict regulatory compliance and heightened threat models.

The talk is crucial for anyone involved in data security, cloud architecture, or database development, as it navigates the complex landscape of cryptographic guarantees, performance trade-offs, and operational realities. White's insights provide a roadmap for moving beyond superficial encryption measures to truly robust, end-to-end data protection, effectively demonstrating how to achieve a level of confidentiality previously considered unattainable in high-volume, dynamic database systems.

Background

▶ Watch: Misconceptions about database encryption and "data at rest" (0:50)

The concept of "database encryption" is often fraught with misconceptions, leading to a false sense of security. White meticulously dissects these misunderstandings, starting with the common distinction between data in transit and data at rest. While encrypting data in transit (e.g., TLS) and at rest (e.g., volume encryption, snapshots, backups) are essential controls, they fall short for active database workloads. A database that is "up and running" is constantly processing data, meaning sensitive information often resides in cleartext within memory, caches, or process spaces, making it vulnerable to active attacks, even if the underlying disk is encrypted. For instance, a stolen laptop might be protected by volume encryption, but a live database server is a different threat landscape.

Transparent encryption, a feature offered by many databases for over a decade, is another area of frequent misunderstanding. While convenient for developers as it requires no code changes, its transparency stems from the server holding the encryption keys and processing data in cleartext. This means privileged server-side users (DBAs, system administrators) or compromised database processes can access sensitive information. Similarly, secure hardware enclaves (like Intel SGX, AMD SEV, Amazon Nitro) offer strong protection against certain threats, but White questions their efficacy for entire database instances, particularly in outsourced cloud environments, where the fundamental question of who has access to the enclave's contents remains. The core issue is a "shared lexicon" problem, where cryptographers, developers, and CIOs often mean different things when discussing "encrypted search" or "encrypted databases."

The critical distinction, from a cryptographer's perspective, is end-to-end data privacy, where queries are performed against a database server that does not have access to the keys or the cleartext. This necessitates a rigorous security model that addresses the "trust dilemma" with authorized operators like DBAs and system administrators. Do they need to see Social Security numbers or payroll routing details by virtue of their operational role? Often, the answer is no, but most systems don't provide this granular separation of duties. Existing academic literature on encrypted search, while theoretically sound, largely focuses on static documents (e.g., keyword search on PDFs) or assumes single-user, single-instance scenarios with significant performance overhead (super-linear query times) or complex application-side state management, making them unsuitable for the demands of distributed, high-concurrency cloud databases. The challenge, therefore, is to bridge the gap between cryptographic rigor and the practical realities of scalable, performant, and developer-friendly database operations.

Key Findings

▶ Watch: Challenges of distributed cloud databases for encryption (10:00)

The central finding and contribution of this talk, representing a significant leap in practical data security, is the development and implementation of Queryable Encryption. This innovative approach allows for expressive, end-to-end encrypted search capabilities within a distributed database system, crucially ensuring that the database server never holds the cleartext or the encryption keys. This directly addresses the "trust dilemma" and the vulnerabilities inherent in traditional encryption methods.

The breakthrough, as described by White, stemmed from a pivotal collaboration with Sunny Kamara and his team at Brown University's Encrypted Systems Lab. While early academic work on encrypted search often required developers to manage complex, distributed caches on the application side to maintain state, Kamara's team found a way to emulate this state in a blinded way directly within the database. This eliminates the burden on application developers to manage cryptographic state, making the solution significantly more practical and scalable.

Key elements of this finding include:

  • End-to-End Confidentiality: Data remains encrypted from the client application to its storage in the database, and queries are performed without decrypting sensitive fields on the server.
  • Client-Side Driver Intelligence: The application-side driver intelligently handles encryption, key management (through a key provider), and the generation of encrypted search tokens, abstracting cryptographic complexity from the developer.
  • Functional Search Indexes: A new type of index is built using Structure Encryption, enabling complex queries (e.g., range searches, prefix searches, full-text search) on encrypted data.
  • Sub-Linear Performance: Unlike many academic proofs-of-concept that suffer from super-linear query times, Queryable Encryption is designed for sub-linear response times, making it viable for large datasets (tens of millions of documents queryable in milliseconds).
  • Robustness for Distributed Systems: The design accounts for the inherent flakiness, partitions, and failures common in distributed cloud databases, ensuring high availability and consistency without compromising security.

This work represents a critical advancement in moving cryptographic theory into practical, operational systems, providing a concrete solution for organizations seeking to achieve unprecedented levels of data confidentiality while maintaining essential database functionality.

Technical Deep Dive

▶ Watch: Breakthrough: Emulating blinded state for queryable encryption (19:30)

The technical core of MongoDB's Queryable Encryption lies in a sophisticated interplay between client-side cryptographic operations and specialized server-side indexes, all designed to maintain end-to-end confidentiality. The fundamental principle is that the database server never sees the plaintext data nor holds the keys required to decrypt it.

When a Python, Go, C#, or Java developer issues a query for sensitive data (e.g., db.billing.find({'ssn': '...' })), the process unfolds as follows:

  1. Client-Side Driver Interception: The database driver, running on the application side, intercepts the query. It identifies fields marked for Queryable Encryption (e.g., ssn).
  2. Key Provider Interaction: If not cached, the driver communicates with a Key Provider (which can be a KMS, cloud provider, or hardware security module like AWS KMS, Azure Key Vault, Google Cloud KMS, or a local KMIP server). This provider securely delivers the necessary field encryption keys to the client driver.
  3. Randomized Encryption: Individual data fields are encrypted using randomized authenticated encryption (specifically, a standard contemporary authenticated encryption algorithm like AES-256-GCM). This ensures that identical plaintext values (e.g., the same Social Security number) are encrypted to different ciphertexts each time they are stored, preventing leakage through frequency analysis.
  4. Functional Search Index Generation: This is the innovation. In addition to the standard encrypted document, the client driver generates encrypted search tokens. These tokens are used to build functional search indexes on the server. The technique employed is called Structure Encryption, which allows for the creation of encrypted multi-maps – essentially encrypted dictionaries or integrated indexes. These indexes enable various query types (equality, range, prefix, full-text) without revealing the underlying data to the server.
  5. Client Statelessness, Database Blinded State: A critical design requirement is that the client application remains stateless regarding cryptographic operations. The database, however, maintains a "blinded state" within these specialized indexes. This distributed scheme is designed to be robust to failures and highly concurrent, addressing the challenges of distributed cloud databases where network flakiness and node failures are common.
  6. Formal Security Definition (OST1): The security of this approach is being formally defined under a model referred to as OST1, which details the guarantees around "gets" and "puts" operations, ensuring minimal leakage.
  7. Key Management: For protecting the field keys themselves, envelope encryption is used. This means field keys are encrypted with a master key, which is then managed by an external, trusted key provider. The database server never accesses the raw key material directly, only encrypted forms of the field keys. This design is agnostic to the specific key management solution, supporting various cloud KMS providers or on-premise hardware security modules (HSMs).

From a DBA's perspective, without the end-to-end keys, encrypted fields appear as opaque, starred values (***), even with "God-level" cluster admin privileges. This stark visual difference underscores the strong isolation provided by Queryable Encryption. Performance metrics, though preliminary, show promising results: query times for 10-25 million document datasets are in the order of milliseconds, achieving sub-linear response times**. Storage overhead is estimated at 2-4x due to the additional index structures. While writes are currently more complex and slower, efforts are underway to optimize them through parallelization, indicating suitability for read-heavy workloads (e.g., 90/10 read/write ratios). The technology is released under an Apache License and is available in public preview, emphasizing its open and collaborative development.

Demo / Proof of Concept

▶ Watch: High-level flow of queryable encryption architecture (21:00)

While the talk did not feature a live, interactive demonstration in the traditional sense, Kenn White provided a powerful visual proof of concept that succinctly illustrates the core promise of Queryable Encryption. He presented a screenshot of a DBA's view of a database containing sensitive information.

In this simulated scenario, a user with "Global cluster admin privilege" – effectively "God" access within the database system – was shown to be unable to view the cleartext of encrypted fields. Instead, these fields (such as a Social Security number or a credit card number in a billing collection) appeared as opaque, starred values (e.g., *****).

White explicitly stated, "Those fields with stars are individually encrypted. This is what you see if you've got access to the end-to-end keys and the DBA again won't see that unless they've also been given the end Keys which kind of defeats the purpose." This visual directly demonstrates that Queryable Encryption successfully isolates sensitive data from even the most privileged database administrators and system operators, unless they are explicitly authorized and possess the client-side, end-to-end encryption keys.

This "DBA view" screenshot effectively served as a clear, concise demonstration of the system's security guarantees. It visually reinforces the critical distinction between traditional database encryption (where cleartext is exposed to the server) and Queryable Encryption (where cleartext is never exposed to the server, even for administrative purposes). The technology is currently in a public preview phase, with ongoing user studies and development aimed at achieving beta-level stability, but the core functionality and security model are already validated through this proof-of-concept.

Defensive Implications

▶ Watch: Future outlook: structure encryption and raising attacker bar (28:40)

The introduction of Queryable Encryption carries profound defensive implications, fundamentally altering the threat model for data stored in operational databases. Defenders can leverage this technology to achieve a level of data confidentiality previously unattainable in distributed, high-performance environments.

Firstly, mitigating insider threats becomes significantly more feasible. Traditional database encryption methods leave sensitive data exposed to privileged users like DBAs, system administrators, and cloud operators. With Queryable Encryption, even these "God-level" users, or any compromised server-side component, cannot access cleartext data or the keys to decrypt it. This dramatically reduces the attack surface from internal actors, a major concern for organizations handling highly sensitive data (e.g., healthcare, financial, national pension systems).

Secondly, it provides stronger protection against data breaches. Should a database server or an entire cloud environment be compromised, the encrypted data remains unreadable to the attacker. Since the encryption keys are never present on the server, the exfiltrated data would be useless without the client-side keys, which are managed separately via secure key providers. This shifts the focus of data protection from securing the perimeter and the server to securing the client applications and the key management infrastructure, a more robust defensive posture.

Thirdly, Queryable Encryption aids significantly in regulatory compliance. Many regulations (e.g., GDPR, HIPAA, PCI DSS) mandate strong data protection. By providing provable end-to-end encryption with formal security definitions (like OST1), organizations can demonstrate a higher standard of confidentiality. The ability to perform complex queries on encrypted data without server-side exposure can help meet "need-to-know" principles more effectively, as access to data can be restricted at the application level based on client-side key possession.

Finally, defenders gain increased confidence in cloud deployments. The "Pinky Promise as a service" concern regarding cloud provider access to data is largely addressed. With Queryable Encryption, even if the cloud provider's infrastructure is compromised, the sensitive data remains cryptographically protected. This enables organizations to leverage the scalability and flexibility of cloud databases while maintaining stringent security requirements, reducing vendor lock-in concerns related to data confidentiality. The technology also reduces the burden on developers to implement complex security features, allowing them to focus on core application logic while relying on opinionated and safer defaults provided by the database driver.

Key Takeaways

  • End-to-End Confidentiality is Achievable: Traditional database encryption (at rest, in transit, transparent encryption, enclaves) often leaves sensitive data vulnerable to privileged server-side access. Queryable Encryption ensures data remains encrypted from the client application to the database, with the server never seeing cleartext or keys.
  • Practicality for Distributed Systems: Unlike many academic solutions, Queryable Encryption is designed for real-world, high-concurrency, distributed cloud databases. It addresses challenges like replication, sharding, and network flakiness, making it viable for petabyte-scale systems and critical national infrastructure.
  • Functional Search Indexes are Key: The innovation lies in Structure Encryption and encrypted multi-maps, which create functional search indexes on the server. These allow for expressive queries (equality, range, prefix, full-text) on encrypted data with sub-linear performance, achieving query times in milliseconds for millions of documents.
  • Mitigates Insider Threats and Data Breaches: By preventing privileged server-side users (DBAs, sysadmins) and compromised database components from accessing cleartext, Queryable Encryption significantly reduces the attack surface from internal threats and renders exfiltrated encrypted data useless without the client-side keys.
  • Developer Usability and Standardization: The client-side driver abstracts cryptographic complexity, allowing developers to write standard queries. The use of widely approved cryptographic primitives and agnostic key management (supporting various KMS providers) promotes adoption and simplifies implementation.
  • Ongoing Evolution, Not a Silver Bullet: While a significant advancement, Queryable Encryption is a rapidly evolving field. It raises the bar for attackers and enhances data security but is not a "magic solution." Continuous research in leakage analysis and security model refinement is crucial.

About the Speaker(s)

Kenn White is a distinguished professional with deep expertise in database security and cryptography, currently associated with MongoDB. His talk at USENIX Enigma highlights his role at the forefront of developing practical, end-to-end encryption solutions for distributed database systems. White's background includes working with a wide range of use cases, from institutional customers managing national pension systems to startups, giving him a comprehensive understanding of the real-world challenges in data protection.

He is a vocal advocate for rigorous security models and precise definitions in cryptography, often challenging common misconceptions about encryption. White played a pivotal role in initiating the collaboration with Brown University's Encrypted Systems Lab, leading to the breakthrough development of Queryable Encryption. His work focuses on bridging the gap between academic cryptographic theory and the operational realities of massive, globally distributed databases, ensuring solutions are not only secure but also efficient, scalable, and developer-friendly. He leads a team of PhD cryptographers, underscoring MongoDB's commitment to advancing the state of the art in data confidentiality.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

Kenn White takes Seny Kamara's academic work on structured encryption and actually makes it survive a distributed MongoDB cluster. It's a massive engineering lift that finally gives developers searchable encryption without making them manage cryptographic state, even if the 'demo' was just a screenshot.

Heather Calloway (CISO) — SOLID

For years, we've accepted the risk of cloud providers and DBAs holding encryption keys because the business demanded searchable databases. This research demonstrates that end-to-end encrypted search is now operationally viable at scale, shifting the baseline for how we protect regulated data in third-party environments.

→ Top-rated talks at USENIX Enigma Conference 2023

All talks from USENIX Enigma Conference 2023