Skip to contentSkip to conversation

Announce loop-AES-v1.4d file/swap crypto package

DISCUSSION Jari Ruusu 2 participants 5 messages Sep 3, 2001 – Sep 4, 2001

lore
Share & tools
lore

Jari Ruusu

author
#0 lore raw

[linux-kernel also CC'd due to recent encrypted swap discussion]

In short: If file and swap crypto is all you need, this package is a hassle free replacement for international crypto patch and HVR's crypto-api.

This package provides loadable Linux kernel module (loop.o) that has AES cipher built-in. The AES cipher can be used to encrypt local file systems and disk partitions. For more information about compiling and using the driver, see the README file in the package.

Features:
- GPL license.
- No source modifications to kernel. No patch hassles when you are upgrading your kernel.
- Works with all recent 2.4, 2.2 and 2.0 kernels, including distro vendor kernels. Encrypted disk images are compatible across all supported kernels.
- AES cipher is used in CBC mode. Supports 128, 192 and 256 bit keys.
- Passwords hashed with SHA-256, SHA-384 or SHA-512.
- 512 byte based IV. IV is immune to variations in transfer size and does not depend on file system block size.
- Device backed (partition backed) loop is capable of encrypting swap on 2.4 kernels.

Changes since previous release:
- Little speed optimization in aes-glue.c
- External encryption module locking bug is fixed (kernel 2.4 only). This bug did not affect loop-AES operation at all. This fix is from Ingo Rohloff.
- On 2.4 kernels, device backed loop maintains private pre-allocated pool of RAM pages that are used when kernel is totally out of free RAM. This change also fixes stock loop.c sin of sleeping in make_request_fn().

Kernel 2.4 users who want to encrypt swap partitions should upgrade to this version. No need to upgrade if you use older 2.2 or 2.0 kernels.

bzip2 compressed tarball is here:

    http://loop-aes.sourceforge.net/loop-AES-v1.4d.tar.bz2
    md5sum 404f82796bacc479deb266f13ec260b8

PGP signature file, my public key, and fingerprint here:

    http://loop-aes.sourceforge.net/loop-AES-v1.4d.tar.bz2.sign
    http://loop-aes.sourceforge.net/PGP-public-key.asc
    1024/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

Regards,
Jari Ruusu <[email protected]>

#1 lore raw
Quoted 2 lines · Jari Ruusu

In short: If file and swap crypto is all you need, this package is a hassle free replacement for international crypto patch and HVR's crypto-api.

Some comments about the packaging (which I made once before).

1) It claims to allow you to specify the kernel sources dir, but it then runs 'depmod' without a nominated version which is only valid if you are building for the running kernel. I now have it doing

        depmod -ae $(KERNELRELEASE)

2) 'make' will also install the module. It would be nice to have an explicit 'make install' instead.

3) The module is installed as loop.o, same as the standard kernel module. I prefer to use different names for added modules.

Also, it ends up in
/lib/modules/VERSION/block/loop.o
which is fine for 2.2, but 2.4 uses
/lib/modules/VERSION/kernel/drivers/block/loop.o
so you now have two loop.o - do you know which one will be loaded?

I changed it to install as loop-aes.o:

        cp -p loop.o $(ML)/kernel/drivers/block/loop-aes.o

and I can now select a module in the modules config.

--
Eyal Lebedinsky ([email protected]) <http://samba.anu.edu.au/eyal/>

author
#2 lore raw
In reply to Jari Ruusu
Quoted 8 lines · Eyal Lebedinsky
Quoted 2 lines · Jari Ruusu

In short: If file and swap crypto is all you need, this package is a hassle free replacement for international crypto patch and HVR's crypto-api.

1) It claims to allow you to specify the kernel sources dir, but it then runs 'depmod' without a nominated version which is only valid if you are building for the running kernel. I now have it doing

        depmod -ae $(KERNELRELEASE)

I will fix that in next release. However, most systems (if not all) run depmod from bootup initialization scripts. Depmod from the Makefile is only needed when you intend to use the driver immediately without rebooting.

Quoted 2 lines

2) 'make' will also install the module. It would be nice to have an explicit 'make install' instead.

Getting kernel Makefile to jump back to loop-AES directory for "make install" is easy for 2.4 kernels, but not so easy for 2.2 and 2.0 kernels. It makes sense to have identical build instructions for all supported kernels.

Quoted 2 lines

3) The module is installed as loop.o, same as the standard kernel module. I prefer to use different names for added modules.

It is a replacement for kernel's loop.o driver. Actually, it _is_ kernel's loop.c patched and compiled outside of kernel tree. My patch just fixes known bugs in stock loop.c and pre-registers AES transfer.

Quoted 5 lines

Also, it ends up in
/lib/modules/VERSION/block/loop.o
which is fine for 2.2, but 2.4 uses
/lib/modules/VERSION/kernel/drivers/block/loop.o
so you now have two loop.o - do you know which one will be loaded?

Loop-AES build instructions _require_ you to disable the loop driver in the kernel. If you have two loop.o drivers, you skipped some build instructions. Also, it can't be placed in /lib/modules/VERSION/kernel/drivers/block/loop.o because kernel's "make modules_install" will remove all non-configured drivers from there. If it was placed there, it would disappear next time you recompile and reinstall other kernel modules.

Quoted 3 lines

I changed it to install as loop-aes.o:

        cp -p loop.o $(ML)/kernel/drivers/block/loop-aes.o

and I can now select a module in the modules config.

If the module name is loop.o then kmod will automatically load it to kernel when needed (assuming that CONFIG_KMOD=y). That way, there is no need to modprobe or insmod it. Just use it, and it will be there when you need it.

Regards,
Jari Ruusu <[email protected]>

#3 lore raw
In reply to Jari Ruusu
Quoted 6 lines · Jari Ruusu
Quoted 4 lines · Eyal Lebedinsky
Quoted 2 lines · Jari Ruusu

In short: If file and swap crypto is all you need, this package is a hassle free replacement for international crypto patch and HVR's crypto-api.

Quoted 8 lines
Quoted 4 lines

1) It claims to allow you to specify the kernel sources dir, but it then runs 'depmod' without a nominated version which is only valid if you are building for the running kernel. I now have it doing

        depmod -ae $(KERNELRELEASE)

I will fix that in next release. However, most systems (if not all) run depmod from bootup initialization scripts. Depmod from the Makefile is only needed when you intend to use the driver immediately without rebooting.

Problem is that one gets tons of errors due to the use of the wrong kernel.
The exact way for doing it right is actually:

	depmod -ae $(KERNELRELEASE) -F $(LS)/System.map
Quoted 2 lines

Loop-AES build instructions _require_ you to disable the loop driver in the kernel. If you have two loop.o drivers, you skipped some build instructions.

It is not in the kernel, it is in my /lib/modules as it was built originally.
I want to keep it there while I play with the new module, and not lose the
original. Naturally, just my preference, not everybodies.

--
Eyal Lebedinsky ([email protected]) <http://samba.anu.edu.au/eyal/>

author
#4 lore raw
In reply to Jari Ruusu
Quoted 4 lines · Eyal Lebedinsky

Problem is that one gets tons of errors due to the use of the wrong kernel.
The exact way for doing it right is actually:

        depmod -ae $(KERNELRELEASE) -F $(LS)/System.map

Yep, but one must define KERNELRELEASE for 2.0 kernels. As I said, I will fix this for next release.

Quoted 8 lines
Quoted 2 lines

Loop-AES build instructions _require_ you to disable the loop driver in the kernel. If you have two loop.o drivers, you skipped some build instructions.

It is not in the kernel, it is in my /lib/modules as it was built originally.
I want to keep it there while I play with the new module, and not lose the
original. Naturally, just my preference, not everybodies.

I meant that loop must be completely disabled, as it says in the README:

CONFIG_BLK_DEV_LOOP=n

Regards,
Jari Ruusu <[email protected]>