Public-Key Encryption with Keyword Search (PEKS), first formalized by Giovanni Di Crescenzo, Giuseppe Persiano, and Rafail Ostrovsky in Public Key Encryption with keyword Search, was designed to solve a fundamental conflict: how can a cloud server filter encrypted data for a user without actually knowing what it is looking for?
While PEKS provides semantic security for the documents themselves, it suffers from a critical structural vulnerability known as the Keyword Guessing Attack (KGA). This attack allows a semi-honest or malicious server to reveal the underlying search terms of a user, effectively breaking the privacy of the search query.
The Public Key Paradox
The vulnerability stems from the very nature of public-key cryptography. In a standard PEKS system, anyone with the recipient's public key can generate a searchable ciphertext for any keyword. This includes the cloud server.
When a user sends a "trapdoor" (a search token) to the server to find documents containing the word "urgent," the server receives a cryptographic string it cannot immediately decrypt. However, the server can perform an offline dictionary attack. Because keywords like "urgent," "invoice," or "medical" are often drawn from a limited, predictable dictionary, the server can:
- Pick a candidate keyword from a dictionary.
- Encrypt that keyword using the user’s public key.
- Test if the resulting ciphertext matches the user's trapdoor.
If they match, the server has successfully "guessed" the search term. As Jiayin Cai and colleagues note in Efficient and Expressive Public Key Authenticated Encryption with Keyword Search in Multi-user Scenarios, this is particularly devastating for low-entropy data where the space of possible keywords is small.
Authenticating the Sender
One of the most effective ways to neutralize KGA is to ensure that the server cannot generate valid searchable ciphertexts on its own. This is achieved through Sender Authentication.
In schemes like those proposed by Qiong Huang in Public Key Authenticated Encryption With Designated Equality Test, the encryption process is modified to require the sender's private key. By binding the keyword ciphertext to the sender’s identity, the system ensures that only authorized data sources can produce inputs for the search function.
Yibo Cao and Shiyuan Xu extend this logic to the quantum-resistant era in Lattice-based Broadcast Authenticated Searchable Encryption for Cloud Storage. By integrating the sender's secret key into the lattice-based encryption, they prevent a semi-honest cloud provider from iteratively testing candidate keywords against intercepted trapdoors. If the server tries to encrypt a guess, the resulting ciphertext will fail the internal matching test because the server lacks the sender's cryptographic credentials.
Defeating Brute Force with Intentional Ambiguity
Another approach to thwarting guessing attacks is to break the one-to-one relationship between keywords and trapdoors. Hai Jin and Peng Xu introduced this concept as Public-Key Encryption with Fuzzy Keyword Search (PEFKS) in Public-Key Encryption with Fuzzy Keyword Search: A Provably Secure Scheme under Keyword Guessing Attack.
Instead of a unique trapdoor for every word, the system maps multiple distinct keywords to a single "fuzzy" trapdoor. This introduces intentional collisions. When a server tests a guess and finds a match, it cannot be certain which keyword in the set the user actually intended to search for. This mechanism preserves the server's ability to filter results while denying it the certainty required for a successful dictionary attack.
Registration and Salting
A third strategy involves moving away from a purely public-key model toward a hybrid approach. Raphaël C-W Phan and Wei Chuen Yau argue in Security models for delegated keyword searching within encrypted contents that a pre-encryption registration phase can solve the KGA problem.
By establishing a shared secret or a unique "salt" between the sender and receiver, the keyword can be processed through a keyed hash before encryption. This salt acts as a secret ingredient that is unknown to the server. Even with the recipient's public key, the server cannot generate a valid test ciphertext because it does not know the salt used to "flavor" the keyword. This effectively turns an offline public-key attack into a much harder problem that requires the server to compromise the registration phase.
Parallel Challenges in Data Deduplication
The struggle against keyword guessing is not limited to search; it also appears in cloud storage deduplication. To save space, servers want to store only one copy of a file. This usually requires deterministic encryption, where the same file always results in the same ciphertext.
As Jian Liu and N. Asokan demonstrate in Secure Deduplication of Encrypted Data without Additional Independent Servers, this creates a "content guessing attack" identical to KGA. If a file's content is predictable (like a standard legal template), an attacker can guess the content, encrypt it, and see if it exists on the server. Researchers have addressed this by repurposing Password Authenticated Key Exchange (PAKE) protocols, ensuring that users must prove they already possess a file before they can interact with its encrypted representation on the server.