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
We now have encrypted data in our `email_encrypted` field that we can query.
@@ -266,7 +277,7 @@ An EQL payload will look like this:
266
277
"p": "test@test.com", // The plaintext data
267
278
"i": {
268
279
"t": "users", // The table
269
-
"c": "encrypted_email"// The encrypted column
280
+
"c": "email_encrypted"// The encrypted column
270
281
},
271
282
"v": 1,
272
283
"q": null// Used in queries only.
@@ -281,10 +292,10 @@ A query to insert an email into the plaintext `email` field in the `users` table
281
292
INSERT INTO users (email) VALUES ('test@test.com');
282
293
```
283
294
284
-
The equivalent of this query to insert a plaintext email and encrypt it into the `encrypted_email` column using EQL:
295
+
The equivalent of this query to insert a plaintext email and encrypt it into the `email_encrypted` column using EQL:
285
296
286
297
```sql
287
-
INSERT INTO users (encrypted_email) VALUES ('{"v":1,"k":"pt","p":"test@test.com","i":{"t":"users","c":"encrypted_email"}}');
298
+
INSERT INTO users (email_encrypted) VALUES ('{"v":1,"k":"pt","p":"test@test.com","i":{"t":"users","c":"email_encrypted"}}');
288
299
```
289
300
290
301
**What is happening?**
@@ -336,7 +347,7 @@ SELECT email FROM users;
336
347
The EQL equivalent of this query is:
337
348
338
349
```sql
339
-
SELECTencrypted_email->>'p'FROM users;
350
+
SELECTemail_encryptedFROM users;
340
351
```
341
352
342
353
**What is happening?**
@@ -349,15 +360,13 @@ All data returned from CipherStash Proxy for encrypted fields will be in this js
349
360
"p": "test@test.com", // The returned plaintext data
350
361
"i": {
351
362
"t": "users",
352
-
"c": "encrypted_email"
363
+
"c": "email_encrypted"
353
364
},
354
365
"v": 1,
355
366
"q": null
356
367
}
357
368
```
358
369
359
-
We can use the `->>` jsonb operator to extract the `"p"` value.
360
-
361
370
#### Advanced querying
362
371
363
372
EQL provides specialized functions to be able to interact with encrypted data and to support operations like equality checks, comparison queries, and unique constraints.
0 commit comments