1

The case is that I need to share data encrypted with customers allow them to only decrypt it.

The idea is by the low we are not allowed to keep a copy of this shared data while the customer have to do.

So we need that any time or in case of dispute we return to original encrypted data saved and customer side with guarantee its integrity.

We will add a file sign, but again we need the original data shared too.

  • 1
    You can encrypt any data. You can re-encrypt any data you have. You can re-encrypt encrypted data. It's all just data to the encryption software. You seem to be looking for some way to confirm integrity, so might be able to keep a hash of the original data, which could be recalculated at a later point to show whether the customer has modified the data? – Matthew Jun 11 '18 at 8:22
  • 1
    @Matthew - can you leave that as an answer so we can upvote accordingly:-) Maybe expand the role of hashing... – Rory Alsop Jun 11 '18 at 8:56
2

The answer to the literal question of whether one can prevent re-encryption would be no.

Presumably your goal is to prevent the customer from tampering with the data, i.e. altering it and misrepresenting it as the original. You also want to avoid actually keeping a decryptable copy of the data.

Since you need only to encrypt and the customer only to decrypt, the straightforward solution is public key cryptography and authentication. The customer would send you their public key, which you would use to encrypt the data. You would also sign the data with your private signing key, and share your public verification key to prove that you've signed it.

The customer can then decrypt the data with their private key, which you don't have. But while they can encrypt another piece of data, they can't sign it, as they don't have your private signing keys.

With this solution, you can actually delete both your plaintext and your ciphertext. Your public verification key will suffice to conclusively prove whether any given message has or hasn't been signed by you.

1

You can encrypt any data. You can re-encrypt any data you have. You can re-encrypt encrypted data. It's all just data to the encryption software. You seem to be looking for some way to confirm integrity, so might be able to keep a hash of the original data, which could be recalculated at a later point to show whether the customer has modified the data.

In this case, you would store the hash (or better yet, multiple hashes) of the data, which cannot be turned back into the original data. The customer would store the original data, in whatever way they want to. If you need to verify that it has not been modified, the customer or an appropriate third party auditor can calculate the hash of the data, and check that it matches the one(s) you've stored. Using multiple hashes of different types ensures that even if a method of finding a string which hashes to a given value is found for a given algorithm (a preimage attack), the other hashes will be modified too, showing that something isn't right.

Note that in this case, you can tell that something isn't right, but not what precisely has been changed.

0

You have to delete the original document and it is shared with the customer as encrypted file which they must keep?

As Matthew already explained in the comments (and the answer), nothing prevents anybody from encrypting or decrypting (at least try) anything they want (also I don't see how this affects your situation in general).

Your application sounds like you could use hashing. You could do the following:

  • create a cryptographic hash of your original document (for example using SHA256 or SHA512, but NOT a weak hash function!)
  • encrypt (and sign?) the document and sent it to the customer to ensure confidentiality (and authenticity)
  • delete the document on your side as your law demands

This way, you deleted the original data, your customer gets the encrypted copy, can do whatever they want (probably store it in a safe place) and you can verify any customer claims made based on such a document.

Scenario: A customer claims some service/money/whatever based on a document they got from you. As you no longer have the original, verifying this is not possible at first. However you store the hash of the original document, so you can ask the customer for the original file (make sure to inform them that they NEED this original file for any claims, as printed documents cannot be hashed), hash it and check the hash using your stored one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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