简体   繁体   中英

How to make a file only readable after a certain date?

I am trying to send someone a file (a .mov video to be precise) but I only want them to be able to open the file after a certain date.

Here are my requirements:

  1. I know the client uses a version OSX which has bash (and maybe python)
  2. I can't assume other person will have any other programs
  3. I can't use system time since its easy to change, I will need to use a time server

Here is my plan:

  1. Encrypt the file using OpenSSL in terminal with a password
  2. Write a script to check date from a time server (python or bash) and decrypt the file if the pre-determined date has bean reached.
  3. Use SHC to convert to script to binary in order make the code and password unreadable
  4. Send both files together instructing the user to run the binary script

(SHC is a program that converts any script to binary from: https://github.com/neurobin/shc )

I have no idea how to check a time server using bash or python (or even if this is possible)

This is physically impossible unless you use a server that you control to give them the decryption key at the right time. If you give them the key before that, you can't prevent them from extracting the key from said script.

The easiest way to do this to send them the file with a decryption script ahead of time. When they want to watch the movie, they can run the script. The decryption script then makes a request from your server. If and only if the time is past your specified point, the server responds with the decryption key.

Alternatively, send them a download link that is only active after the specified time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM