Edit: I mostly used my university's guidelines on how to meet DPA standards and their own. I extrapolated a bit because encryption on a VM hosted by my uni that is already probably encrypted makes little sense wrt. adversaries.

The data we manipulate is very sensitive and the website will stay around for a while and be reused across projects, so I believe I must include attacks to the Web server and encrypt PII against it.

I realise this has nothing to do with the DPA but just my interpretation of "keep personal data secure, in proportion to their sensitivity".

The problem

I need to set up a Web server on which research participants upload tarballs (the size and contents of which depend on projects) containing Personally Identifiable Information and sensitive data. I must comply with the DPA and other guidelines which recommend encryption but do not clarify encryption against which threats. I hence assume that I must protect my participant' data against a breach into the server.

This is what I roughly planned on doing:

  1. The data is encrypted by my Web server upon arrival using a newly-made symmetric key.
  2. The symmetric key is encrypted by the server using the public key of the researcher who will process the data, and that symmetric key is stored with the data.
  3. We researchers connect to the server, set up a decrypted image of the encrypted files.
  4. We work on that image, potentially adding or modifying files (i.e., creating summaries of data, transcripts, metrics, and so on, which can also contain some PII until we sat down and anonymized them properly).
  5. Whenever we leave the server, no data must be left unencrypted.

I originally asked if I can automatically create encrypted volumes and then reopen them from elsewhere, which has been pointed out to be a singularly bad idea by smrt28. What I planned to do:

  1. The server creates an encrypted volume per user, puts the raw data from the user in the root folder of that volume, and shuts the volume properly when done.
  2. I SSHFS to the folder containing all those volume files.
  3. I use a local script to open unencrypted mount points for all those volumes.
  4. I happily modify the users' data and create new files.
  5. I shut down the mount points and all is fine, the new data has been added to the servers already encrypted.

The original question: how can I make dm-crypt use asymmetric keys so that the server can only create a new encrypted volume and I can encrypt/decrypt? Is that even possible with volumes? If lvm can't do that, any alternatives?

The solution I'll adopt

I will just get this Web server to write the data to a write-only mount of another server's partition. The other server will be hosted by my university and accessible only from our authenticated university VPN. That partition will be encrypted and backed up by the university as they see fit.

We researchers will just connect to the VPN, mount the partition and do our things, which is essentially the same as in the original setup.

  • How much do you «modify the users' data and create new files»? Are they mainly read-only (eg. you only edit it once -perhaps automatically- to add a couple of fields) or are many modifications expected arbitrarily?
    – Ángel
    Commented Sep 17, 2014 at 23:27
  • We get raw data, we make summaries of it (running some metrics on each user's data), and we also extract some for further interviews with our participants. Finally we use it as input for ML features. All the data that will be created will also be stored in the same place until anonymised. The only point I wanted to make is that the final storage space should not be read-only but read-write. It should be write-only to the server through which data is sent though. Commented Sep 17, 2014 at 23:30
  • Your interpretation of the DPA (I presume you mean the UK one) is very different to mine! I don't see any requirements for the controls you mention. And the ICO only recommends encryption for mobile devices. ico.org.uk/news/current_topics/Our_approach_to_encryption
    – paj28
    Commented Sep 19, 2014 at 11:47
  • @paj28 I haven't gone through the whole thing and have relied on my uni's summaries so I'm being conservative. As far as I understand PII should be stored on an encrypted device in any case which is sensible. I don't think I would need to encrypt it beyond having my server image encrypted to meet requirements but that's moronic: there's no protection against the #1 adversary in such a scenario, and indeed I don't need to read the data from the server. Commented Sep 19, 2014 at 13:59
  • What particularly concerns me is that researchers in my group will be mounting the folders containing this data onto their devices (which are mobile), and so I'd need a way to guarantee that this does not stay open longer than necessary. I'm starting to think I'm approaching the problem from the wrong end though... Commented Sep 19, 2014 at 14:00

2 Answers 2


I'm not sure if I can understand your question correctly.

Mounting a directory with dm-crypted volume files by SSHFS and mounting those files to your local... Hmm... It sounds crazy to me and you are asking for a data corruption. Imagine what happen to the volume if you try to edit from 2 different network locations? Imagine what happened if your network breaks in the middle of "editing"?

You haven't written how many users you expect. You din't even mentioned, how large those tarballs are. If the files were small then I would suggest to keep them gpg-ed, and if you want to edit them, just download them, edit, upload.

I'm also not not sure, why you need to keep those data on the server. As you mentioned, all the data are encrypted and you are the only person who has the key. It seems to me the server is just an upload server and the only service it servers is the upload service. So, gpg every incoming tarball and sync it with your local where you can keep it on a single encrypted volume and edit them freely? Why you need the data on the server?

  • You have a bunch of useful points, thanks! I want to keep the data on a server because I and other researchers processing the data are not allowed to do so from our own personal machines (esp. laptops), and the server being hosted by my uni is backed up. However I came to realise I would be better off with two servers, one for hosting the site and one for hosting the data. Thanks again! Commented Sep 22, 2014 at 10:33
  • Just keep in mind that, simplicity is sometimes more secure then security. :-)
    – smrt28
    Commented Sep 22, 2014 at 10:43
  • Indeed! It just saddens me that even our official guidelines say the data "must be encrypted" with no consideration for risks. Commented Sep 22, 2014 at 10:45

You should provide a link to the actual requirements and recommendations.

Based on what was written i'd assume you'd require a public key per user to be used to encrypt. Or would you be permitted to share one public key among for example a group of users.

The problem, and benefit, of using LVM if a volume is encrypted a password must be entered at each mount/boot. If one would only mount a users volume on login ( using PAM ? ) one could have a prompt for the user to enter the volume password and thus achieve the required procedure.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .