Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm very new to cryptography and encryption so I apologize if the answer to this is well known, but I can't find anything in my research.

The crux of the problem is the need to store data on an offline device which cannot be trusted. Is it possible to encrypt the data in such a way that it cannot be read by the device that encrypts it, but can be read by a server that the device later uploads the data to?

The device can communicate with the server before going offline and capturing data so an exchange of keys can take place before any data is encrypted if that helps.

share|improve this question
"device which cannot be trusted", "cannot be read by the device that encrypts it", how do you know it isn't making a copy of everything it encrypts? – Richie Frame Mar 28 '14 at 5:28
Sorry, that language wasn't clear. The "cannot be trusted" refers to possibility of physical theft of the device and the ability to inspect any data stored on it. To be more specific, I'm talking about an offline web app used on iPads to capture data at events. Assuming that the app code is served over SSL, and the iPad itself is not compromised I think it can be trusted up until it falls into the hands of someone with malicious intent, at which point the only issue is the data already stored. – Dan Coates Mar 28 '14 at 5:35
If a random key is used for each "message" and asymmetrically encrypted as per D.W.'s answer, you will be fine. The same way PGP encrypted email works – Richie Frame Mar 28 '14 at 5:58
up vote 4 down vote accepted

Yes. Use public-key encryption: encrypt the data using the server's public key. You should be able to fill in the details from there.

share|improve this answer
Thanks, I've read a bit about public key encryption, but it somehow hadn't clicked that it does much exactly what I was asking. – Dan Coates Mar 28 '14 at 6:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.