

Well, I can send data (one way) to or from disk at 20-30 MB/s, and encrypt with aes-256 at around 100 MB/s. [80GB 7200rpm 2MB cache Seagate Barracuda IV (ATA-100) disk, and a 2.0GHz Athlon XP 2400 with 266FSB proc.]lytenyn wrote:(not to mention performance - which is rather seldomly discussed)
Not to mention the kernel help (at least for 2.6.4) warns that cryptoloop isn't safe for journaling filesystems.The problem with cryptoloop etc is that I need to manually patch my kernel etc ..
Nope. Back in the Day(TM), there were people working on (t)cfs, a (transparent) crypto filesystem, but I think they've been dead since 2.4.0 hit the servers. The tcfs homepage for instance doesn't have any real news since 2001, and offers downloads for 2.0 and 2.2.So my question is: Do you know an easier method?
Code: Select all
Device Drivers --->
Block devices --->
<*> Loopback device support
<*> Cryptoloop SupportCode: Select all
Cryptographic options --->
<*> AES cipher algorithmsCode: Select all
dd if=/dev/urandom of=~/cryptofile bs=1024k count=100Code: Select all
cat /dev/urandom > /dev/hda4Code: Select all
losetup -e aes-256 /dev/loop0 /dev/hda4
... or ...
losetup -e aes-256 /dev/loop0 ~/cryptofileCode: Select all
mke2fs /dev/loop0Code: Select all
mkdir /mnt/crypto
mount -t ext2 /dev/loop0 /mnt/cryptoCode: Select all
umount /mnt/crypto
losetup -d /dev/loop0
Code: Select all
losetup -e aes-256 /dev/loop0 /dev/hda4
... or ...
losetup -e aes-256 /dev/loop0 ~/cryptofile
Code: Select all
umount /mnt/crypto
losetup -d /dev/loop0
Code: Select all
losetup -e aes-256 /dev/loop0 ~/cryptofile
mount -t ext2 /dev/loop0 /mnt/crypto
Thanks Roguelazer, typos are now fixed.Roguelazer wrote:You had a couple of errors there.
Firstly:
The losetup is different in the new version. It should read as this:Code: Select all
losetup -e aes-256 /dev/loop0 /dev/hda4 ... or ... losetup -e aes-256 /dev/loop0 ~/cryptofile
Secondly:
Unmounting should read as this:Code: Select all
umount /mnt/crypto losetup -d /dev/loop0
Sorry, I assumed someone doing this would know not to create the file system again or that they didn't need to create the mount point in /mnt again either.Roguelazer wrote:Fourthly, reconnecting steps are this:Note the change from the initial connect to the new one.Code: Select all
losetup -e aes-256 /dev/loop0 ~/cryptofile mount -t ext2 /dev/loop0 /mnt/crypto

Please rename it to .bz2 since its not a gz file. Took me a minute to figure that one out.Roguelazer wrote:I even went a step farther.
http://www.roguelazer.com/files/cryptocontrol.tar.gz
A set of three scripts that automate creating, mounting and unmounting an encrypted file. Yay for me!


Code: Select all
mount -o loop blah blah blah


Dm-crypt is supposed to support cryptoloop devices/files. But some versions of cryptoloop/losetup were quite broken. I used cryptoloop too and I didn't succeed in converting all my data, yet. More infos: Cryptoloop Migration GuideQuantumstate wrote:Any idea whether any of these'll read loop-created volumes? I need to recover the data.

Code: Select all
losetup /dev/loop1 /dev/cdroms/cdrom0
cat keyfile | cryptsetup -h plain create cryptdvd /dev/loop1
mount /dev/mapper/cryptdvd /mnt/cryptdvd/
Where is cryptoloop deprecated? I'm using kernel 2.6.7 and cryptoloop is part of it (not dm-crypt) and nowhere does it say that it's deprecated.saccory wrote:FYI cryptoloop is kind of DEPRECIATED in favour of dm-crypt. See http://www.saout.de/misc/dm-crypt/ for details.
And btw. dm-crypt works great here
IMPORTANT: Cryptoloop has been marked deprecated in the latest 2.6 kernel. This means that it will no longer be maintained actively. The successor to Cryptoloop will be dm-crypt. Dm-crypt is available in the main kernel since 2.6.4. Cryptoloop will still be available in the main kernel for a long time, but dm-crypt will be the method of choice for disk encryption in the future. Dm-crypt is based on the device mapper and offers pretty much the same functionality as Cryptoloop. It is still very new and there are no easy-to-use userspace tools available yet. Dm-crypt is considered to be much cleaner code than Cryptoloop, but there are some important differences. For example, creating an ecrypted filesystem within a file will still require to go through a loop device, but this support is still in development.

Also, "dm-crypt is vastly superior to cryptoloop for a number of reasons:IvanHoe wrote:Where is cryptoloop deprecated? I'm using kernel 2.6.7 and cryptoloop is part of it (not dm-crypt) and nowhere does it say that it's deprecated.

Code: Select all
#/etc/fstab
/dev/loop0 /home/pbx06/secmount user,noauto 0 0
Code: Select all
#!/bin/sh
/sbin/losetup -e aes-256 /dev/loop0 ~/sec.file
mount -t ext2 /dev/loop0 ~/sec
Code: Select all
memlock: Operation not permitted
Couldn't lock into memory, exiting.
mount: only root can do that
Keyfile is the file where I keep my keyQuantumstate wrote:Using your commands above however, on
cat keyfile | cryptsetup -h plain create cryptdvd /dev/loop1
it's unable to find 'keyfile'.
That is right. Cryptsetup does only create/remove mappings. Which also means, that if you want to create a new encryption container you have to run a mkfs on your /dev/mapper/xxx mapping.Quantumstate wrote: Also, losetup does not ask for a password, I presume because we are not specifying -e aes-256? And it seems that 'create' does not erase the disk, but just sets up the device chain?