How can I lock a file / store a password for a period of time?

Solution 1:

1 Create a good password:

Create a good and strong password

Long password with complex characters a-z A-Z 0-9 !@#$... more than 20 is good

You can also use this online tool to generate them online password generator


2 Encrypt your file:

You can encrypt your file using Windows encryption or even a WinRAR or other things)

Download WinRAR


3 Save the key for the future:

You can use sites like futureme.org or others to email your key(password) to you or anyone else you like to have access the key

I suggest to use multiple sites and times to ensure that you won't lose access to your file

Solution 2:

A. You could set up an remote email account and throw away the key.

Put a crazy password on gmail (or any email service that you expect to still be in business when the time comes). Get it to send you a cryptographic key or to send you the password at a time that is programmed in the future.

Then you throw away the gmail password. No 2 factor authentication, no way of getting back in. The problem is that you have to rely on gmail.

Future mail: gmail calendar, lettermelater... http://www.tothepc.com/archives/ways-to-send-future-email-gmail-outlook-tools/


If it's under your control, you can "hack" the time.

The problem with a windows or local solution is that you can change the time or fake an ntp server. Anything that reboots either has to be told the time or can be updated with new time info.

So somebody else would have to run the clock. Having and external service to send you a message at a certain time is the answer I believe. The important thing is being sure that that external service is reliable and redundant when the time comes so that you don't lose the info forever.

Redundant could mean having two or more files with the data, with two different passwords, on 2 different hard drives, with two different remote email services from 2 different companies.... Basically doing your setup twice in 2 completely independent ways with no single point of failure.


Encryption

Encryption has to do with security, not time.

Your question refers to a password. You can use a cryptographic key simply to increase the complexity and make so that it is not accessible via simple brute-force. That's beyond the subject and a bit complicated but it might interest you. pitt.edu/~poole/PGP.htmago

  • You could encrypt your data with PGP encryption and send yourself the encryption key later. If security is a concern, using an encryption key rather than a long password would be preferable.

  • If you are using a password, then having 10 characters or more that are random and include symbols and caps would be a minimum, in my estimation. The more random characters in your password (the longer it is), the better as it makes it exponentially more difficult to brute-force.


Additional reference

Beyond that, the stackexchange page referenced by Sam3000 is worth mentioning.

Solution 3:

The free FileLocker might be a solution :

The FileLocker is a Windows NT/2000/XP/2003/Vista/7 32Bit command line tool to lock a file. The lock is a read/write/delete lock. The lock will be released once you kill the program or after a specified time / keypress.

FileLocker will lock the file for the duration of its execution. The locking will end when the program terminates, either when the specified time is up, or if the program is killed.

Usage:

FileLocker [/T LockTime] [/I] [/K] [/Q] file [file...]

/T LockTime     Time in milliseconds to lock the file
/I  Infinite locking until process is killed (default)
/K  Lock file until key is pressed
/Q  Be quiet.

Both the binary and the source of FileLocker are available on the website.

Solution 4:

The other answers focus on file protection through a password. The challenge is removing this protection after a set amount of time (much trickier). A possible solution:

  1. Create a program that encrypts a file (use whatever you want but I think using the cryptography python package is easiest)
  2. Use this website to generate a secure password (if you do not have another option) and encrypt your file.
  3. Store the password in a file in a USB and send it to your self (snail mail). Wipe any local data on your computer if you saved the password previously in the file.
  4. Decrypt file.

While this is not fastest solution it could be the most secure. Unlike sending your self an email (or other methods) a local copy of your password is not kept on your system or a sever. In addition trust in a third party is not necessarily needed. If you are paranoid you can encrypt the whole USB volume and keep the second password stored. Anyone trying to intercept the USB will not be able to discover your password.

Solution 5:

Overview


I have created 2 batch files that automate this using Task Scheduler and aescrypt. The two batch files are called WUHelper.bat and WUTask.bat which fools the average user into thinking that they are involved in Windows Update.
WUHelper.bat
This generates a randomized 20 character password and uses it to encrypt a specified file with aescrypt and creates a task called Adobe Update which, once again, fools the average user into thinking it is an important Adobe task. It then deletes the original file. This task runs WUTask.bat after a given amount of time (hours).
WUTask.bat
This decrypts the given file and shows the password used to encrypt it, in case anything goes wrong. It then deletes the encrypted copy of the file and the Adobe Update task.

Usage


WUHelper.bat
Step 1) Run the batch file
Step 2) When prompted, enter the filename including file extension (must be in same folder) and the number of hours
Step 3) Press a key to exit
WUTask.bat
You do not need to touch this batch file.

Code


Code for WUHelper.bat

@Echo off
Setlocal EnableDelayedExpansion
Set _RNDLength=8
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
set /p flnm="Enter Filename: "
set /p hrs="Enter Hours: "
schtasks /create /tn "Adobe Update" /tr "%~dp0\WUTask.bat !_RndAlphaNum! %flnm%" /sc hourly /mo %hrs%
start "" "%~dp0\aescrypt.exe" -e -p !_RndAlphaNum! %flnm%
ping 192.0.2.2 -n 1 -w 5000 > nul
del %flnm%
timeout /t 30

Code for WUTask.bat

@echo off
cd /d %~dp0
schtasks /delete /tn "Adobe Update" /f
set arg1=%1
set "arg2=%2.aes"
echo %arg1%
start "" aescrypt.exe -d -p %arg1% %arg2%
ping 192.0.2.2 -n 1 -w 5000 > nul
del %arg2%

Note: This is not extremely secure. If someone looked through these batch files and understood the basics of schtasks and aescrypt, they would know how to decrypt the file before the given time. You can hinder progress by setting these batch files to Hidden. And please, before using these batch files, try them out on a test file to make sure they work in your setup.