encsearch
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
encsearch | 0.1.1 | SEC | PostgreSQL | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 7035 | encsearch | No | Yes | Yes | Yes | No | No | - |
Early release 0.1.1 changes PGXN status to stable without code changes from 0.1.0; PG17 tested, other Cargo PG14-18 targets untested. Session preload must precede key settings; blind indexes leak equality and token frequency.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 1817161514 | encsearch | - |
| RPM | PIGSTY | 0.1.1 | 1817161514 | encsearch_$v | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.1.1 el8.x86_64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el8.x86_64.rpm
| N/A | N/A | N/A |
| el8.aarch64 | N/A | PIGSTY 0.1.1 el8.aarch64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el8.aarch64.rpm
| N/A | N/A | N/A |
| el9.x86_64 | N/A | PIGSTY 0.1.1 el9.x86_64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el9.x86_64.rpm
| N/A | N/A | N/A |
| el9.aarch64 | N/A | PIGSTY 0.1.1 el9.aarch64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el9.aarch64.rpm
| N/A | N/A | N/A |
| el10.x86_64 | N/A | PIGSTY 0.1.1 el10.x86_64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el10.x86_64.rpm
| N/A | N/A | N/A |
| el10.aarch64 | N/A | PIGSTY 0.1.1 el10.aarch64.pg17 : encsearch_17 encsearch_17-0.1.1-1PGSTY.el10.aarch64.rpm
| 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 |
Build
You can build the RPM packages for encsearch using pig build:
Install
You can install encsearch directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
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.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)