From 14d17ba339ecf949a01afee829fd6bd170b81bd0 Mon Sep 17 00:00:00 2001 From: Dan Draper Date: Mon, 14 Oct 2024 21:51:28 +1100 Subject: [PATCH 1/3] Fixed some formatting nits --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 604bfa63..8b214f52 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ For a document like this: Hashes would be produced from the following list of entries: -```json +```js [ [Obj, Key("account"), Obj, Key("email"), String("alice@example.com")], [Obj, Key("account"), Obj, Key("name"), Obj, Key("first_name"), String("Alice")], @@ -367,13 +367,13 @@ Hashes would be produced from the following list of entries: Using the first entry to illustrate how an entry is converted to hashes: -```json +```js [Obj, Key("account"), Obj, Key("email"), String("alice@example.com")] ``` The hashes would be generated for all prefixes of the full path to the leaf node. -```json +```js [ [Obj], [Obj, Key("account")], From a5ff936977504c57b67de9ff2567f36ad10b74ab Mon Sep 17 00:00:00 2001 From: Dan Draper Date: Mon, 14 Oct 2024 22:01:03 +1100 Subject: [PATCH 2/3] Small copy corrections --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b214f52..3f822f6f 100644 --- a/README.md +++ b/README.md @@ -318,9 +318,11 @@ In general, therefore, you should try to ensure that the string you search for i An ste_vec index on a encrypted JSONB column enables the use of PostgreSQL's `@>` and `<@` [containment operators](https://www.postgresql.org/docs/16/functions-json.html#FUNCTIONS-JSONB-OP-TABLE). -An ste_vec index requires one piece of configuration: the `prefix` (a string) which is functionally similar to a salt for the hashing process. +An ste_vec index requires one piece of configuration: the `context` (a string) which is passed as an info string to a MAC (Message Authenticated Code). +This ensures that all of the encrypted values are unique to that context. +It is generally recommended to use the table and column name as a the context (e.g. `users/name`). -Within a dataset, encrypted columns indexed using an ste_vec that use different prefixes can never compare as equal. +Within a dataset, encrypted columns indexed using an `ste_vec` that use different contexts cannot be compared. Containment queries that manage to mix index terms from multiple columns will never return a positive result. This is by design. From 8e41820e41d54620df9af356547a475ece233713 Mon Sep 17 00:00:00 2001 From: Dan Draper Date: Mon, 14 Oct 2024 22:01:59 +1100 Subject: [PATCH 3/3] Another format tweak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f822f6f..5ff833c5 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,7 @@ The expression `cs_ste_vec_v1(encrypted_account) @> cs_ste_vec_v1($query)` would When reduced to a prefix list, it would look like this: -```json +```js [ [Obj], [Obj, Key("account")],