If it's searchable, how encrypted is it really?
- Date
- By
- CipherStash Team
Less than an opaque blob. A searchable column stores a search term next to the ciphertext, and the term reveals something. Equality terms reveal which values match and how often. Ordering terms reveal order. Free-text terms reveal token overlap. Search is optional per column. A column with no search term reveals nothing beyond the ciphertext, and for many fields that is the right setting.
Searchable encryption trades some secrecy for queries. Only pay that price on columns that need queries.
What each term reveals
When you enable a search capability on a column, EQL stores an extra term next to the ciphertext. The term is what leaks.
| Capability | What the database can learn |
|---|---|
| Equality | Which values are equal, and so their frequency |
| Ordering and range | Equality, frequency, and the relative order of values |
| Free-text match | Probabilistic token overlap, repeated token sets, and approximate token-set size |
| None (storage only) | Nothing beyond the ciphertext |
Queries leak too. Someone with access to the database over time sees which terms are searched and which rows come back. That is search-pattern and access-pattern leakage, and any scheme where the database does the matching has it.
Where it hurts
Small or predictable domains. A frequency histogram over an equality-indexed country column, joined with public statistics, identifies the popular values. The extreme case is a boolean. A two-value column has too little cardinality for any searchable index to be safe, so EQL refuses to add one. The boolean type is store-and-decrypt only.
A blind index you built yourself, an HMAC over the value, leaks the same equality and frequency information. With EQL the behaviour is documented per term and the keys are managed.
What you control
Search is opt-in per column. The bare EQL type stores and decrypts and nothing else. Enable equality only where the application filters on the field, ordering only where it sorts or ranges, and match only where it searches text. Storage-only is a complete configuration, and for fields you write and read back but never query, it is the one to pick.
We are working on settings for small domains that reduce what an equality term reveals. Nothing has shipped, so plan on the table above.