1

I wanted to lock any directory with a password, is it possible to set up pin or password for any directory or file without using third party tools like cryptkeeper.

1 Answers1

0

You can use ccrypt to encrypt files, use it as follows:

# prompts for the password, encrypts the file and adds “.cpt”
ccrypt /path/to/file

# prompts for the password, recursively (`-r`) encrypts every file
# in the directory and its subdirectories and adds “.cpt” to every file
ccrypt -r /path/to/dir

# prompts for the password, decrypts (`-d`) the file and removes the “.cpt” ending
ccrypt -d /path/to/file

To encrypt a whole directory as one single encrypted file it needs to be packed first, e. g. using tar:

tar cf - /path/to/dir | ccrypt > /path/to/file.tar.cpt # without compression
tar czf - /path/to/dir | ccrypt > /path/to/file.tgz.cpt # with compression

See the manpage for more!

To simplify this you can write a script with these commands and add it to your file manager to get e. g. “Encrypt” and “Decrypt” options in the dropdown menu.


Of course there are other ways to achieve what you want, here some links:

dessert
  • 40,956