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.
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.
Let divide the problem into two cases;
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.
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.