pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Moreno Andreo <moreno.andreo@evolu-s.it>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: Key encryption and relational integrity
Date: Tue, 26 Mar 2019 17:08:34 +0100
Message-ID: <514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it> (raw)
In-Reply-To: <082fdd45-a12b-161b-8386-70ee8528361e@aklaver.com>
References: <094bf875-5b49-8d3c-1fa3-97c07246b890@evolu-s.it>
	<082fdd45-a12b-161b-8386-70ee8528361e@aklaver.com>

Il 26/03/2019 15:24, Adrian Klaver ha scritto:
> On 3/26/19 7:19 AM, Moreno Andreo wrote:
>> Hello folks :-)
>>
>> Is there any workaround to implement key encryption without breaking 
>> relational integrity?
>
> This is going to need more information. 
OK, I'll try to be as clearer as I can
> For starters 'key' has separate meanings for encryption and RI. I 
> could make some guesses about what you want, but to avoid false 
> assumptions a simple example would be helpful.
In a master-detail relation, I need to encrypt one of master table PK or 
detail table FK, in order to achieve pseudonimization, required by GDPR 
in Europe when managing particular data
Imagine I have
Table users
id   surname    last name
1    John            Doe
2    Jane            Doe
3    Foo             Bar

Table medications
id    user_id    med
1     1                Medication
2     1                Ear check
...
...
medications.user_id is FK on users.id
we should achieve

Table medications
id    user_id        med
1    sgkighs98    Medication
2    sghighs98    Ear check

or the opposite (users.id encryption and medications.user_id kept plain)

At a first glance, it IS breaking relational integrity, so is there a 
way to manage this encryption internally so RI is kept safe?

Thanks

Moreno.-






view thread (23+ messages)  latest in thread

Message-ID: <514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it>
Permalink:  ../514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it/
Also on:    postgresql.org/message-id/514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: moreno.andreo@evolu-s.it, adrian.klaver@aklaver.com
  Subject: Re: Key encryption and relational integrity
  In-Reply-To: <514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it>
  References: <094bf875-5b49-8d3c-1fa3-97c07246b890@evolu-s.it> <082fdd45-a12b-161b-8386-70ee8528361e@aklaver.com> <514fb642-bba4-7a14-b412-d953f1b8b7e7@evolu-s.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox