3

I'm trying to find a way to password protect an Excel file (.xlsm) beyond the built-in password encryption options.

Ideally:

  1. Enter the password
  2. File works for a week(/other period of time)
  3. After a week, file requires password again

The file is used consistently, so I don't think that encrypting a .zip or similar would solve my problem.

There are VBA options to do this, but they can be easily circumvented by restricting macro security or similar.

5 Answers 5

4

It's impossible to protect some file for some time. Intrinsically, the file doesn't have any property that will allow it to know whether it's January, 1st, 2010 or 30-Feb-2050 (if February will have 30 days in 2050).

What "could" know the time is the program opening it. In your case, Excel. But a program itself doesn't know about time either. It would need to know the specific time from some source, verify it the time was reached or not, and act accordingly.

That leads to some problems:

1 - It must be impossible to change the program, or that time restriction would be circumvented. Doing some research about tamper-resistant software will show you that it's hard to do it: DVD protection, Blu-ray protection, and many other kinds of data protection, have failed. Perhaps digital tokens, used to store private-keys, are the only ones that haven't being defeated yet, but I'm not sure.

2 - Your program must get the time from a reliable source. How you assure that your source is reliable or not is another problem. Atomic clock? Adjusted by who ?

3 - The communication between your program and the clock must also be secure.

4 - Once open, you have to assure that it will be impossible to "save" the file content to any other archive. And that includes taking pictures or memorizing the information and typing it again in another excel worksheet.

5
  • Would it be possible to encrypt a file and also put a privacy screen over the information so people could not take pictures as you mentioned?
    – MotS
    Commented Jul 1, 2014 at 17:54
  • it would be much harder than that. If someone is able to see a file, he is also able to take a photo or film it. Commented Jul 1, 2014 at 17:55
  • 1
    @MOTS If the file is really important, that would attract attention from people who really want it, consider it impossible. If you want to protect against a 5 year old boy who wants it, perhaps you can... :) It really depends on the resources of your enemy. Commented Jul 1, 2014 at 17:57
  • Like @woliveirajr said, if the people accessing the document aren't computer savvy, then restricting access to read-only in either sharepoint or google docs' spreadsheet, and no-download option if one is available. That way there is no password to manage, and access is determined by you manually. Commented Jul 1, 2014 at 18:35
  • "3 - The communication between your program and the clock must also be secure." -- not necessarily a requirement. What is required is that the application can verify that time came from a trusted source and hasn't been modified.
    – u2702
    Commented Jul 8, 2014 at 16:22
4

A file is just a collection of bytes. It cannot do something to itself on its own.

You need an access restricting application, or use what is available.

Because it is an excel document, any weird solution you come up with can be circumvented just by saving it locally unprotected or copy pasting.

But if you still want to at least try, even if it isn't perfect, try using access controls through sharepoint. You can hand out temporary access or manually turn it off for someone/everyone after a certain period of time.

1
  • 1
    +1 for the Sharepoint suggestion. This is probably the most efficient method, and most easily-manageable. The only downside is that it may not apply to the OP's particular situation. Commented Jul 1, 2014 at 17:45
2

This is exactly what Microsoft's IRM (Information Rights Management) product is designed to address.

However, as pointed out by others, the file on its own cannot achieve what you are trying to do, so you will need some infrastructure, which MSFT calls the Rights Management Server (with the delightful irony of being Rich Stallman's initials). And this will allow the document to test whether or not a particular system/user can access the content in the file.

0

Please note that Microsoft Office IRM is not intended to secure a document. It's intended to manage rights, but does not use strong encryption and should not be exclusively used for sensitive documents (it's like a lock on a filing cabinet - you could pick it easily, but it's there to let you know you shouldn't). There is no feature currently in office that does what you need.

Source: I am a developer for Office.

P.S. There are some issues with implementing this securely, but it's not impossible.

0

I have made a free Android App. You can lock any file for a specific time. It checks time from the internet so you can't unlock the file until the specified time.

4
  • This is not a place for ads.
    – schroeder
    Commented Dec 29, 2023 at 21:27
  • There are no ads on this application, and its code is also open-sourced. I am answering, so if anyone has a specific requirement, he should use this application. Thanks for suggestions. Commented Dec 29, 2023 at 21:29
  • 1
    This answer is an ad ...
    – schroeder
    Commented Dec 29, 2023 at 21:29
  • 1
    We try not to answer "here use my project" as an answer. They become ads. Instead, explain the approach you used and how you implemented it alongside alternatives.
    – schroeder
    Commented Dec 29, 2023 at 21:30

Not the answer you're looking for? Browse other questions tagged .