m(→‎Install the FUSE module: use last known working archive version instead of 2.7.2)

(42 intermediate revisions by 8 users not shown)

Line 2:

Line 2:

This article based on work done by Ramuk and Andre on Linkstationwiki.org

This article based on work done by Ramuk and Andre on Linkstationwiki.org

</small></font>''<br>

</small></font>''<br>

−

[[Image:Warded_locked.png|frame|'''<font color =red>PowerPC Only</font>''' : This method only works for the powerpc-hdhlan and powerpc-hdhglan LinkStations.]]

+

[[Image:Warded_locked.png|frame|'''<font color =red>PowerPC and ARM9 (KuroBox Pro)</font>''' : This method only works for the powerpc-hdhlan and powerpc-hdhglan LinkStations, and the KuroBox Pro]]

== Abstract ==

== Abstract ==

−

This article is for people that want to add an encrypted filespace to their Link Station. We will use the powerpc-hdhglan Link Station for our example.

+

This article is for people that want to add an encrypted filespace to their Link Station<ref>{{Forumpost|41|818|The Linkstation Community Forum / Linkstation HG (ppc) / Encrypted Partitions, and Installing modules (FUSE)}}</ref>. We will use the powerpc-hdhglan Link Station for our example.

−

[http://arg0.net/wiki/encfs EncFS] is used to do this. This probably will work on any PPC link station. It may work on a MIPS Link station

+

[[w:EncFS|EncFS]]<ref>The EncFS Wiki: [http://arg0.net/wiki/encfs http://arg0.net/wiki/encfs]</ref> is used to do this. This probably will work on any PPC link station. It may work on a MIPS Link station

−

but you'll have to compile the FUSE module yourself somehow.

+

but you'll have to compile the [[w:FUSE_%28linux%29|FUSE]]<ref>The FUSE Wikipedia Page: [[w:FUSE_%28linux%29|FUSE:Wikipedia]]</ref> module yourself somehow. It will also work on a manually Freelinked [[:Category:KuroboxPro|KuroBox Pro]] (ARM9)

−

[[Image:Bar.png|frame|'''Encryption Type''' : EncFS was chosen because of it's relative ease and speed of use. Loop-AES could be used as well, a good comparison is here: [http://www.linux.com/article.pl?sid=06/03/13/1656228 Encrypt filesystems with EncFS and Loop-AES] , A client side encryption system like [http://www.truecrypt.org/user-guide/ Truecrypt] could be used from a windows client. The TeraStation people have a [http://www.terastation.org/wiki/Encryption%2C_NTFS_Support%2C_and_Windows_Share_Management nice tutorial] on using TrueCrypt ]]

+

{{Postit|Encryption Type|EncFS was chosen because of it's relative ease and speed of use. Loop-AES could be used as well<ref>Comparison of various Encryption Schemes: [http://www.linux.com/article.pl?sid=06/03/13/1656228 Encrypt filesystems with EncFS and Loop-AES]

+

</ref>, A client side encryption system like Truecrypt<ref> Truecrypt - Free open-source disk encryption software for Windows XP/2000/2003 and Linux - [http://www.truecrypt.org http://www.truecrypt.org]</ref> could be used from a windows client. The TeraStation people have a nice tutorial on using TrueCrypt<ref>[[Encryption, NTFS Support, and Windows Share Management]]</ref>}}

== Prerequisites ==

== Prerequisites ==

This article assumes that you have installed [[FreeLink]] or [[OpenLink]].

This article assumes that you have installed [[FreeLink]] or [[OpenLink]].

−

You also will need to upgrade to a 2.6 Kernel. Use these instructions: [[Upgrade to the 2.6-kernel (ppc only)]]

+

You also will need to upgrade to a 2.6 Kernel on a PPC Box, use these instructions: [[Upgrade to the 2.6-kernel (ppc only)]]. Or on an ARM9 box you will need a custom kernel and modules.

−

== Method ==

+

+

== Method (ARM9 KuroBox Pro)==

+

+

===Install Armel Debian and FUSE module===

+

Install [[Armel Debian for the Kurobox Pro - Manual install]] or [http://forum.buffalo.nas-central.org/viewtopic.php?f=18&t=5736&p=72241&#p72241 Armel for a LSPro] and custom kernel and modules contained in those instructions

+

+

===Install EncFS===

+

apt-get install encfs

+

== Method (PPC)==

===Install the FUSE module===

===Install the FUSE module===

−

* I used the binaries from André's site:

+

* I used the binaries<ref>André's documentation on the FUSE binary: [http://hvkls.dyndns.org/downloads/documentation/README-fuse.html http://hvkls.dyndns.org/downloads/documentation/README-fuse.html]

* place it in a shared directory if you want to access it as a file share using Samba.

* place it in a shared directory if you want to access it as a file share using Samba.

−

encfs --public /mnt/locked /mnt/share/locked

+

encfs /mnt/locked /mnt/share/locked -- -o allow_other

<tt>/mnt/share</tt> here is a shared directory. <tt>/mnt/locked</tt> is where the encrypted bits will be stored and <tt>/mnt/share/locked</tt> is where the (de)crypted space will be mounted to. You will be prompted for the type of encryption that you want and for password creation. Look [http://arg0.net/wiki/encfs/intro2#examples here] for more details on using EncFS.

<tt>/mnt/share</tt> here is a shared directory. <tt>/mnt/locked</tt> is where the encrypted bits will be stored and <tt>/mnt/share/locked</tt> is where the (de)crypted space will be mounted to. You will be prompted for the type of encryption that you want and for password creation. Look [http://arg0.net/wiki/encfs/intro2#examples here] for more details on using EncFS.

+

===Access Permissions===

===Access Permissions===

* You will have to chmod the created directory so everyone can access it

* You will have to chmod the created directory so everyone can access it

Line 42:

Line 60:

===Remount===

===Remount===

* And remount it when you need it the same way you created it, this time you will just be prompted for the password you used when you created it.

* And remount it when you need it the same way you created it, this time you will just be prompted for the password you used when you created it.

−

encfs --public /mnt/locked /mnt/share/locked

+

encfs /mnt/locked /mnt/share/locked -- -o allow_other

== What's the point? ==

== What's the point? ==

−

{{Postit|Slow to Write|I've been using this solution for awhile now, it's slow to ENcode data but faster to DEcode data. So that saving (ENcoding) a file over 50MB to an encrypted share over samba can be somewhat buggy. So I save files to an unencrypted share and then copy them over from the command line to the encrypted filespace. Reading (DEcoding) the files works fine for me for files that are even 1-2GB in size [[User:Ramuk|Ramuk]] 22:44, 15 August 2006 (EDT)}}

+

{{Postit|Slow to Write|I've been using this solution for awhile now, it's slow to ENcode data but faster to DEcode data. So that saving (ENcoding) a file to an encrypted share over samba can be somewhat slow. Writing a new file to a samba share that is an EncFS volume happens for me at about 1.7 MB/s and to an unencrypted share at 5 MB/s. - [[User:Ramuk|Ramuk]] 10:58, 21 March 2008 (CDT) }}

+

What's the point of all this? Well you can create an encrypted file space that once mounted functions completely transparently as a shared directory. Once it is unmounted, either manually or automatically (when the system is shut down) the data will only exist in an encrypted form in the encrypted directory you specified. In this example in <tt>/mnt/locked</tt> , if your linkstation is stolen or lost, as soon as it is unplugged the data will no longer be accessible without the password. Even if someone cracks open the device and takes the hard drive out all they will be able to get is encrypted gibberish in that directory. ''However'' they would be able to figure out how MANY files you had in that directory and the SIZE of each file, as EncFS encypts each file individually, not the block device.

What's the point of all this? Well you can create an encrypted file space that once mounted functions completely transparently as a shared directory. Once it is unmounted, either manually or automatically (when the system is shut down) the data will only exist in an encrypted form in the encrypted directory you specified. In this example in <tt>/mnt/locked</tt> , if your linkstation is stolen or lost, as soon as it is unplugged the data will no longer be accessible without the password. Even if someone cracks open the device and takes the hard drive out all they will be able to get is encrypted gibberish in that directory. ''However'' they would be able to figure out how MANY files you had in that directory and the SIZE of each file, as EncFS encypts each file individually, not the block device.

Line 62:

Line 81:

# You can change these lines to reflect the locations on your system

# You can change these lines to reflect the locations on your system

# or add whatever user comments you want

# or add whatever user comments you want

−

+

modprobe fuse

+

usage(){

usage(){

echo "mountcrypt [m|mount|u|unmount]"

echo "mountcrypt [m|mount|u|unmount]"

Line 79:

Line 99:

case "$1" in

case "$1" in

"m" | "mount" )

"m" | "mount" )

−

/usr/bin/encfs --public /mnt/locked /mnt/share/locked

+

encfs /mnt/locked /mnt/share/locked -- -o allow_other

echo "Encrypted filesystem now mounted"

echo "Encrypted filesystem now mounted"

;;

;;

"u" | "unmount" )

"u" | "unmount" )

−

/usr/bin/fusermount -u /mnt/share/locked

+

fusermount -u /mnt/share/locked

echo "Encrypted filesystem has been unmounted"

echo "Encrypted filesystem has been unmounted"

;;

;;

Line 94:

Line 114:

== Bonnie++ I/O Speeds ==

== Bonnie++ I/O Speeds ==

−

Here is a speed comparision using [http://www.coker.com.au/bonnie++/readme.html Bonnie++] as a diagnostic tool

+

Here is a speed comparision using Bonnie++<ref>Bonnie++ disk benchmark: [http://www.coker.com.au/bonnie++/readme.html http://www.coker.com.au/bonnie++/]</ref> as a diagnostic tool. [http://forum.nas-central.org/index.php?action=userinfo&user=722 Fifilein] is trying to use AES/DMCrypt and his numbers are in the speed comparision too<ref>[http://forum.nas-central.org/index.php?action=vthread&forum=4&topic=1277 The Linkstation Community Forum / Everything else / JBOD with ENCFS, Key on USB Stick]</ref> all numbers are from an HG-LS.

Abstract

This article is for people that want to add an encrypted filespace to their Link Station[1]. We will use the powerpc-hdhglan Link Station for our example.
EncFS[2] is used to do this. This probably will work on any PPC link station. It may work on a MIPS Link station
but you'll have to compile the FUSE[3] module yourself somehow. It will also work on a manually Freelinked KuroBox Pro (ARM9)

Encryption Type

EncFS was chosen because of it's relative ease and speed of use. Loop-AES could be used as well[4], A client side encryption system like Truecrypt[5] could be used from a windows client. The TeraStation people have a nice tutorial on using TrueCrypt[6]

Post Install Usage

Create an encrypted partition

place it in a shared directory if you want to access it as a file share using Samba.

encfs /mnt/locked /mnt/share/locked -- -o allow_other

/mnt/share here is a shared directory. /mnt/locked is where the encrypted bits will be stored and /mnt/share/locked is where the (de)crypted space will be mounted to. You will be prompted for the type of encryption that you want and for password creation. Look here for more details on using EncFS.

Access Permissions

You will have to chmod the created directory so everyone can access it

chmod og+rwx /mnt/share/locked/

Just beware that it takes a long time for files to be encrypted when you copy or move them into this directory, however you can use this directory like any other shared space with Samba. After files are placed in there they can be accessed pretty fast.

Unmount

You can unmount the partition at any time in which case the encrypted directory will end up appearing blank.

fusermount -u /mnt/share/locked

Remount

And remount it when you need it the same way you created it, this time you will just be prompted for the password you used when you created it.

encfs /mnt/locked /mnt/share/locked -- -o allow_other

What's the point?

Slow to Write

I've been using this solution for awhile now, it's slow to ENcode data but faster to DEcode data. So that saving (ENcoding) a file to an encrypted share over samba can be somewhat slow. Writing a new file to a samba share that is an EncFS volume happens for me at about 1.7 MB/s and to an unencrypted share at 5 MB/s. - Ramuk 10:58, 21 March 2008 (CDT)

What's the point of all this? Well you can create an encrypted file space that once mounted functions completely transparently as a shared directory. Once it is unmounted, either manually or automatically (when the system is shut down) the data will only exist in an encrypted form in the encrypted directory you specified. In this example in /mnt/locked , if your linkstation is stolen or lost, as soon as it is unplugged the data will no longer be accessible without the password. Even if someone cracks open the device and takes the hard drive out all they will be able to get is encrypted gibberish in that directory. However they would be able to figure out how MANY files you had in that directory and the SIZE of each file, as EncFS encypts each file individually, not the block device.

Keyfile and Security

The keyfile is stored in the encrypted directory /mnt/locked/.encfs5 you could store it externally (on a USB Key Drive for example) and move it to the proper location if you wanted even more security.

Shell Scripts

#!/bin/bash
# mountcrypt.sh
# You can change these lines to reflect the locations on your system
# or add whatever user comments you want
modprobe fuse