My linux world » Encryption Survival Guide

Encryption Survival Guide



yum -y install encfs

Example of use

Create encrypted directory

echo "Frist, create directory"
mkdir ~/myDecryptDirectory
echo "Then create your encrypt directory. We tell that ~/myEncryptDirectory is mount in ~/myDecryptDirectory."
encfs ~/myEncryptDirectory ~/myDecryptDirectory

Answer at the questions like this:

The directory "/mEncryptDirectory/" does not exist. Should it be created? (y,n) y
Creating new encrypted volume.
Please choose from one of the following options:
 enter "x" for expert configuration mode,
 enter "p" for pre-configured paranoia mode,
 anything else, or an empty line will select standard mode.
?> p

Paranoia configuration selected.

Configuration finished.  The filesystem to be created has
the following properties:
Filesystem cipher: "ssl/aes", version 3:0:2
Filename encoding: "nameio/block", version 3:0:1
Key Size: 256 bits
Block Size: 1024 bytes, including 8 byte MAC header
Each file contains 8 byte header with unique IV data.
Filenames encoded using IV chaining mode.
File data IV is chained to filename IV.
File holes passed through to ciphertext.

-------------------------- WARNING --------------------------
The external initialization-vector chaining option has been
enabled.  This option disables the use of hard links on the
filesystem. Without hard links, some programs may not work.
The programs 'mutt' and 'procmail' are known to fail.  For
more information, please see the encfs mailing list.
If you would like to choose another configuration setting,
please press CTRL-C now to abort and start over.

Now you will need to enter a password for your filesystem.
You will need to remember this password, as there is absolutely
no recovery mechanism.  However, the password can be changed
later using encfsctl.

New Encfs Password: 
Verify Encfs Password: 

Use encrypted directory

Now if you create a file in myDecryptDirectory, it will automatically encrypted in myEncryptDirectory.
Let’s give a try !

echo "create a file in myDecryptDirectory"
echo "hello world" > ~/myDecryptDirectory/hello-world.txt
echo "now display content from the file fresh created"
cat ~/myDecryptDirectory/hello-world.txt
$>  hello world
echo "let's see what's happened in ~/myEncryptDirectory"
ls ~/myEncryptDirectory
$> KOkS8bmWBJMptU-xu1oU5HX2
echo "ok the file name is encrypted. let's check the file content"
cat ~/myEncryptDirectory/KOkS8bmWBJMptU-xu1oU5HX2
$> z@ÉýÇfªX-ÎþzçаtÃGý

Mount / UnMount

To mount the directory : (same command to create a new encrypted directory)

encfs ~/myEncryptDirectory ~/myDecryptDirectory

To unmount the directory:

fusermount -u ~/myDecryptDirectory

Read More

Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.