encsearch
encsearch : Experimental encrypted text search using AEAD ciphers and keyed blind indexes
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7035 | encsearch | encsearch | 0.1.1 |
SEC | PostgreSQL | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 |
18 17 16 15 14 | encsearch |
- |
| RPM | PIGSTY | 0.1.1 |
18 17 16 15 14 | encsearch_$v |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| el8.aarch64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| el9.x86_64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| el9.aarch64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| el10.x86_64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| el10.aarch64 | N/A | PIGSTY 0.1.1 | N/A | N/A | N/A |
| d12.x86_64 | N/A | N/A | N/A | N/A | N/A |
| d12.aarch64 | N/A | N/A | N/A | N/A | N/A |
| d13.x86_64 | N/A | N/A | N/A | N/A | N/A |
| d13.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u22.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u22.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u24.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u24.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u26.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u26.aarch64 | N/A | N/A | N/A | N/A | N/A |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
encsearch_17 |
0.1.1 |
el8.x86_64 | pigsty | 517.1 KiB | encsearch_17-0.1.1-1PGSTY.el8.x86_64.rpm |
encsearch_17 |
0.1.1 |
el8.aarch64 | pigsty | 414.3 KiB | encsearch_17-0.1.1-1PGSTY.el8.aarch64.rpm |
encsearch_17 |
0.1.1 |
el9.x86_64 | pigsty | 519.3 KiB | encsearch_17-0.1.1-1PGSTY.el9.x86_64.rpm |
encsearch_17 |
0.1.1 |
el9.aarch64 | pigsty | 445.6 KiB | encsearch_17-0.1.1-1PGSTY.el9.aarch64.rpm |
encsearch_17 |
0.1.1 |
el10.x86_64 | pigsty | 473.0 KiB | encsearch_17-0.1.1-1PGSTY.el10.x86_64.rpm |
encsearch_17 |
0.1.1 |
el10.aarch64 | pigsty | 430.4 KiB | encsearch_17-0.1.1-1PGSTY.el10.aarch64.rpm |
Source
github.com/lokeshmulpuru/encsearch
encsearch-0.1.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
encsearch stores encrypted text alongside keyed search tokens in an int8[] column. Its experimental 0.1.0 release supports exact, word and pattern searches through a GIN index. Upstream has tested PostgreSQL 17; the other Cargo feature targets are untested.
Core Workflow
Operational Boundaries
An administrator installs this untrusted extension. Configure session_preload_libraries before opening client sessions and before setting encsearch.key; otherwise an early key setting remains an unregistered setting visible to other roles. Supply a securely retained key of at least 32 characters to the session or explicit-key function overloads before running the data example. enc_gen_key() generates a 64-character key. Losing the key loses access to the plaintext.
enc_encrypt and enc_decrypt handle text and ciphertext. enc_index creates stored tokens; enc_like, enc_ilike and enc_eq filter candidates and check decrypted values. enc_has_words tests token containment without decrypting; enc_q_like, enc_q_exact and enc_q_words expose raw query tokens. enc_algorithm and enc_algorithms inspect available ciphers.
encsearch.algorithm defaults to aes-256-gcm; deterministic aes-256-siv reveals duplicate plaintext. Keep encsearch.token_hash identical when building and querying tokens: hmac-sha256 is the default and blake3 is the alternative. Changing the token hash requires regenerating tokens; changing keys requires decrypting with the old key and rebuilding ciphertext and tokens with the new key.
Blind indexes reveal shared values, words and character chunks and their frequency. Keys reach the database server and may appear in statement or parameter logs. This is an experimental privacy/performance tradeoff, not protection against a server that has the key.