Is there a way to encrypt a file with expiry date?

I want to share a file which can be decrypted using a key until certain date. After that date, the recipient should not be able to decrypt the file.

  • 5
    $\begingroup$ Once decrypted, I can make a copy of it right? $\endgroup$ – kelalaka Sep 27 '18 at 18:58
  • $\begingroup$ How much control do I have over the system clock? $\endgroup$ – Eugene Styer Sep 27 '18 at 19:55
  • 3
    $\begingroup$ Not without a trusted third party (though you can use secret sharing to split the responsibility between multiple semi-trusted parties) $\endgroup$ – CodesInChaos Sep 27 '18 at 20:00
  • $\begingroup$ @EugeneStyer A public blockchain (Bitcoin) kinda makes the clock rate predictable. Blockchains are popular here. $\endgroup$ – Paul Uszak Sep 28 '18 at 2:14
  • 3
    $\begingroup$ Encrypt the data symmetrically, put the key on a flash drive into a safe with a radioactive element for which the amount has been chosen such that the memory corruption is expected to happen at the desired time? $\endgroup$ – SEJPM Sep 29 '18 at 17:17

Let divide the problem into two cases;

  1. The file encrypted and stored on the cloud for access.

    For this case, to decrypt the file people will need the key. So, if the expiry date is not passed you will transmit the key. They will download and decrypted. From this point, they will not need your key and encrypted file. Nothing can prevent them to take a copy of it. They can use screen capture softwares etc., if this is prohibited in hardware, they can take photos. If no want accessed the file you can delete the file from the cloud. Actually, you will never be sure that a copy was taken. So, in the future when your encryption scheme is broken the file will be accessible.

  2. The file encrypted and not stored on accessible storage for the third party.

    You can safely delete the file and the keys.

As point of view, there can be some solutions depend on the environment that this system applied. If the user is in a very strict environment where the cameras or similar devices are prohibited and the computers are highly secured as no input-output ports etc. However, all these are nothing to do with Cryptography.


Please consider that the encryption key and decryption key is generated at the same time, it is usually the same key for symmetric encryption.

So the key(s) generation process happens before the encryption process, so you can’t guarantee that your encrypted data will not be decrypted before the expiration date.


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.