1

I would like to store and encrypt a password that I can access only during specific time intervals, such as after 9 pm. (The reason being that I force myself to stick to behavioural commitments, enforced by password-protected anti-procrastination software.)

An online solution is available at lockbox.pluckeye.net, but I would like to store the password locally or in a Dropbox, in case the service is discontinued.

I would appreciate any methods/software tips!

1 Answer 1

-1

What you describe involves a chicken & egg problem. Using encryption, how would you encrypt your password such that it can only be decrypted with information that is not available in the present? If you don't know that information until a time in the future, you can't encrypt your password now.

The simplest option it probably just to give that password to someone you trust and make them promise they will not give it back to you until the time that you specify. Better yet, have them create the password so that you don't have access to it to begin with. If you don't completely trust the other person, you could type the first half of the passphrase and have them type the second half. If neither of you reveals his/her portion of the password to the other, neither of you would be able to access the service without the other's help.

Other solutions I can think of would involve setting up a service like this of your own and then locking yourself out of it. You could set up a server that will tell you the password only when queried at pre-defined times. Then turn administrative access over to another person or lock yourself out so that you are unable to break in and obtain your password anytime you want it.

If you just want a simple script that would accomplish this on the fly, try something like the following script. Just realize that if the script is somehow terminated, your password is lost forever if you don't have a copy somewhere else that is inconvenient to access like a safe deposit box or entrusted with a friend.

#!/bin/bash

echo "Nothing will be displayed as you type"
read -sp "Password to store: " pwd && echo
while :
do
    read -p "What time should I reveal the password: " time
    date -d "$time" && break
    echo "Invalid time format. Try again"
done
echo "Please destroy all records of your password now. Except for one copy that you will not have convenient access to."

unlockTime=$(date -d "$time" +%s)
now=$(date +%s)

timeout=$((unlockTime - now))
sleep $timeout && echo "Your password: $pwd" || echo "Shame on you for killing sleep. No password for you!"

This script will prompt you for the password and a time at which to reveal it. Then it will keep the password concealed "safely" in RAM (don't let the script die) until the time you specified. If you are brazen enough to kill the sleep command, this script will terminate without revealing the password! Simply copy the script text above into a plaintext file saved with a .sh extension, make it executable, and run it from a terminal window.

You must log in to answer this question.

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