You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All data returned from CipherStash Proxy for encrypted fields will be in this json format:
374
+
The json stored in the database looks similar to this:
375
+
376
+
```json
377
+
{
378
+
"k": "ct", // The kind of EQL payload. The Proxy will insert a json payload of a ciphertext or "ct".
379
+
"c": "encrypted test@test.com", // The source ciphertext of the plaintext email.
380
+
"e": {
381
+
"t": "users", // Table
382
+
"c": "email_encrypted"// Encrypted column
383
+
},
384
+
"m": [42], // The ciphertext used for free text queries i.e match index
385
+
"u": "unique ciphertext", // The ciphertext used for unique queries. i.e unique index
386
+
"o": ["a", "b", "c"], // The ciphertext used for order or comparison queries. i.e ore index
387
+
"v": 1
388
+
}
389
+
```
390
+
391
+
The Proxy decrypts the json above and returns a plaintext json payload that looks like this:
356
392
357
393
```json
358
394
{
@@ -367,6 +403,10 @@ All data returned from CipherStash Proxy for encrypted fields will be in this js
367
403
}
368
404
```
369
405
406
+
> When working with EQL in an application you would likely be using an ORM.
407
+
408
+
> We are currently building out [packages and examples](../../README.md#helper-packages) to make it easier to work with EQL json payloads.
409
+
370
410
#### Advanced querying
371
411
372
412
EQL provides specialized functions to be able to interact with encrypted data and to support operations like equality checks, comparison queries, and unique constraints.
@@ -376,6 +416,7 @@ EQL provides specialized functions to be able to interact with encrypted data an
376
416
Prerequsites:
377
417
378
418
- A [match index](#adding-indexes) is needed on the encrypted column to support this operation.
419
+
- Connected to the database via the Proxy.
379
420
380
421
EQL function to use: `cs_match_v1(val JSONB)`
381
422
@@ -394,20 +435,26 @@ EQL query payload for a match query:
394
435
}
395
436
```
396
437
397
-
A plaintext text search query like this:
438
+
A plaintext query, to search for any records that have an email like `grace`, looks like this:
398
439
399
440
```sql
400
441
SELECT*FROM users WHERE email LIKE'%grace%';
401
442
```
402
443
403
-
Would look like this using EQL:
444
+
The EQL equivalent of this query is:
404
445
405
446
```sql
406
447
SELECT*FROM users WHERE cs_match_v1(email_encrypted) @> cs_match_v1(
0 commit comments