####################################################################### # Crypotographic Filesystems in Linux ( debian, woody unstable 2.4.19 ) ####################################################################### # By -> Christopher M Downs # 12-20-02 # FOR THE IMPATIENT LIKE ME ! # ok so you wanna protect your data right ? I would hope so, so do I :) # Im gonna show you how encrypt a filesystem in Linux using Debian. # Primary ref page is at: http://www.kerneli.org #Lets make a dir to work from and get the pacthes we need: #cdowns@Evicerated:~$ cd /usr/src/ ; sudo /bin/mkdir Crypto #cdowns@Evicerated:/usr/src$ ls -l #total 31836 #drwxr-sr-x 3 root src 4096 Dec 20 12:55 Crypto #-rw-r--r-- 1 root src 322239 Oct 18 09:54 grsecurity-1.9.7d-2.4.19.patch #lrwxrwxrwx 1 root src 12 Dec 20 13:12 linux -> linux-2.4.19 #drwxr-xr-x 15 573 573 4096 Dec 20 13:19 linux-2.4.19 #-rw-r--r-- 1 root src 32219641 Dec 1 06:02 linux-2.4.19.tar.gz #drwxr-xr-x 7 root root 4096 Dec 18 14:32 rpm #cdowns@Evicerated:/usr/src$ # Lets continue: # NOTE -> cdowns@Evicerated:/usr/src/Crypto$ sudo /bin/uname -a Linux Evicerated 2.4.19 #1 Fri Dec 20 13:15:40 EST 2002 i686 unknown unknown GNU/Linux cdowns@Evicerated:/usr/src/Crypto$ # NOTE -> make sure you are downloading the matching running kernel version for patch-int-2.4.19.0.gz ! #cdowns@Evicerated:/usr/src$ cd Crypto/ #Evicerated:~# wget http://www.us.kernel.org/pub/linux/utils/util-linux/util-linux-2.11r.tar.gz #Evicerated:~# wget http://www.us.kernel.org/pub/linux/kernel/crypto/v2.4/testing/patch-int-2.4.19.0.gz #Evicerated:~# wget http://easynews.dl.sourceforge.net/sourceforge/cryptoapi/util-linux-2.11r.patch.bz2 # NOTE: to check /sbin/losetup if it needs to be patched just either man losetup and or look for and entry that only says # "Supported Encryption Types XOR DES *" # If you see this then you need and international patched losetup to allow other Encrytpion types to be used. #SUPER NOTE: when patching util-linux you could blow up your machine and not be able to boot up again so dont screw it up. # ok so now you need to rebuild your kernel with Cryptoapi modules. # cdowns@Evicerated:/usr/src/Crypto$ sudo /bin/gzip patch-int-2.4.19.0.gz ; cd ../linux ; sudo /usr/bin/patch -p1 CryptoAPI support x x # Cipher Algorithms x x # --- 128 bit blocksize x x # AES (aka Rijndael) cipher x x # Twofish cipher x x # MARS cipher x x # RC6 cipher x x # Serpent cipher # Crypto Devices x x # Loop Crypto support x x # [ ] Atomic Loop Crypto x x # [*] Loop IV hack # One more thing is to make sure you have loop.o compiled in as a module. # goto Block devices # Loopback device support # Now you are ready to compile. # Exit and Save, this will start automatic modules compilation. # once this is done do: # sudo /sbin/modprobe cryptoloop # sudo /sbin/modprobe cryptoapi # Depending on the cipher you want next # sudo /sbin/modprobe cipher-twofish # now chech to make sure everything is loaded correctly. # cdowns@Evicerated:/usr/src/Crypto$ sudo /sbin/lsmod #Module Size Used by Not tainted #cipher-twofish 40340 0 (unused) #cryptoloop 1740 0 (unused) #cryptoapi 3380 5 [cipher-twofish cryptoloop] #loop 7960 0 [cryptoloop] #tulip 37248 1 #cdowns@Evicerated:/usr/src/Crypto$ # So if you see modules loaded correctly now move on to recompiling and patching linux-util # NOTE -> make sure the version and patch version match. # sudo /bin/tar zvxf util-linux-2.11r.tar.gz # sudo /bin/bzip2 -d util-linux-2.11r.patch.bz # cd util-linux-2.11r ; sudo /usr/bin/patch -p1