LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > arniekat
User Name
Password

Notices


Rate this Entry

Slackware-13.1-Hacks-EncFS/Cryptkeeper

Posted 02-09-2011 at 11:38 PM by arniekat

EncFS is a Command-Line application that creates/manages encrypted folders. Cryptkeeper is a GUI that leaves an icon in your system tray so you can create/mount/unmount encrypted folders using EncFS.

You need to compile and install in the following order from SlackBuilds:

rlog-1.4
encfs-1.7.4
orbit2-2.14.19
gconf-2.28.1
cryptkeeper-0.9.5

You will need to create the fuse group and add your non-root users to the fuse group since encfs needs fuse to mount the encrypted directories. If you do not do this, encfs will allow you to create the encrypted folder, however, when you try to mount it, you will get this error message:

fusermount: failed to access mountpoint /home/user1/Private: Permission denied
fuse failed. Common problems:
- fuse kernel module not installed (modprobe fuse)
- invalid options -- see usage message

Here is the way to fix this.

# groupadd fuse
# gpasswd -a user1 fuse
Adding user user1 to group fuse

Now, make /dev/fuse owned by root:fuse since the original owner is root:root

# chown root:fuse /dev/fuse

To create the encrypted folder, using the Command Line with a username "user1", an encryption algorithm Blowfish, with a key size of 256-Bits:
The encrypted files will be in the hidden folder /home/user1/.Private with scrambled file names.
When you mount the folder to the mount point /home/user1/Private, the files will be in decrypted form.
$ encfs /path/to/encrypted_directory /path/to/mount_point

$ encfs /home/user1/.Private /home/user1/Private
The directory "/home/user1/.Private/" does not exist. Should it be created? (y,n) y
The directory "/home/user1/Private/" 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.
?> x

Manual configuration mode selected.
The following cipher algorithms are available:
1. AES : 16 byte block cipher
-- Supports key lengths of 128 to 256 bits
-- Supports block sizes of 64 to 4096 bytes
2. Blowfish : 8 byte block cipher
-- Supports key lengths of 128 to 256 bits
-- Supports block sizes of 64 to 4096 bytes

Enter the number corresponding to your choice: 2

Selected algorithm "Blowfish"

Please select a key size in bits. The cipher you have chosen
supports sizes from 128 to 256 bits in increments of 32 bits.
For example:
128, 160, 192, 224, 256
Selected key size: 256

Using key size of 256 bits

Select a block size in bytes. The cipher you have chosen
supports sizes from 64 to 4096 bytes in increments of 8.
Or just hit enter for the default (1024 bytes)

filesystem block size: Enter

Using filesystem block size of 1024 bytes

The following filename encoding algorithms are available:
1. Block : Block encoding, hides file name size somewhat
2. Null : No encryption of filenames
3. Stream : Stream encoding, keeps filenames as short as possible

Enter the number corresponding to your choice: 1

Selected algorithm "Block""

Enable filename initialization vector chaining?
This makes filename encoding dependent on the complete path,
rather then encoding each path element individually.
The default here is Yes.
Any response that does not begin with 'n' will mean Yes: Enter

Enable per-file initialization vectors?
This adds about 8 bytes per file to the storage requirements.
It should not affect performance except possibly with applications
which rely on block-aligned file io for performance.
The default here is Yes.
Any response that does not begin with 'n' will mean Yes: Enter

Enable filename to IV header chaining?
This makes file data encoding dependent on the complete file path.
If a file is renamed, it will not decode sucessfully unless it
was renamed by encfs with the proper key.
If this option is enabled, then hard links will not be supported
in the filesystem.
The default here is No.
Any response that does not begin with 'y' will mean No: Enter

Enable block authentication code headers
on every block in a file? This adds about 12 bytes per block
to the storage requirements for a file, and significantly affects
performance but it also means [almost] any modifications or errors
within a block will be caught and will cause a read error.
The default here is No.
Any response that does not begin with 'y' will mean No: Enter

Add random bytes to each block header?
This adds a performance penalty, but ensures that blocks
have different authentication codes. Note that you can
have the same benefits by enabling per-file initialization
vectors, which does not come with as great of performance
penalty.
Select a number of bytes, from 0 (no random bytes) to 8: Enter

Enable file-hole pass-through?
This avoids writing encrypted blocks when file holes are created.
The default here is Yes.
Any response that does not begin with 'n' will mean Yes: Enter

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

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: <EncFS_Password>
Verify Encfs Password: <EncFS_Password>

Now, as the regular user, you can mount the filesystem by:

$ encfs /path/to/encrypted_directory /path/to/mount_point
$ Password: <Enter_Password>

To unmount the encrypted filesystem,

$ fusermount -u /path/to/mount_point

Cryptkeeper GUI

When you start the CryptKeeper application, you will see a keychain in the System Tray area of your desktop. When you Left-Click on the keychain, you can either create a New Encrypted Folder or you can Import EncFS Folder. Since I created this folder on the command-line, I will import it. A dialog box appears.

You can click the upper left-hand corner of the dialog box to enter the path to the encrypted folder, in this case /home/user1/.Private OR
you can click in the folder navigation window to give it focus, hit CTRL+H to make the hidden folders visible, then select the /home/user1/.Private folder using your mouse. When you have selected the folder, click Forward.

Now you will need to choose the name and location of the mount point, in this case /home/user1/Private
Select the folder and click Forward.

You will now see a confirmation message that your EncFS folder was imported into Cryptkeeper. Click OK.

Left-click the keychain in the System Tray and select your Encrypted Folder. Enter your password. When confirmed, your File Manager will open to the decrypted contents.

Right-click the keychain in the System Tray and select Preferences. You can type your preferred File Manager in the dialog box plus change a few other things regarding how Cryptkeeper behaves.

To unmount the folder, Left-click the keychain in the System Tray and select your Encrypted Folder. It will now unmount.
Posted in Uncategorized
Views 2398 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration