LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Encrypted filesystems and util-linux (https://www.linuxquestions.org/questions/linux-general-1/encrypted-filesystems-and-util-linux-130572/)

thebell 01-01-2004 11:48 AM

Encrypted filesystems and util-linux
 
Ok, so I have an encrypted ext2 filesystem inside a disk file (~/.crypto). Up until now, it's been working perfectly with the following line in fstab:
/home/stephen/.crypto /mnt/crypt ext2 defaults,noauto,loop,encryption=aes,user 0 0

I typed mount /mnt/crypt, and it asked for a keysize and password.

Now, however, I get the following message:
You must specify a key size (in bits) for use with CryptoAPI encryption.

The only thing I can think of that's changed is that I upgraded util-linux (to 2.12-r4). My kernel hasn't changed; it's still 2.4.20-gentoo-r9.

The file Documentation/cryptoapi/cryptoloop.txt in the kernel source tree suggests adding the option -k 128 to the losetup command line, but then losetup complains about invalid option -- k.

Can anyone suggest what's changed here? Has upgrading util-linux changed something important?

kc8tbe 01-01-2004 08:31 PM

I'm not sure if util-linux changed anything important. Did you end up changing any configs while installing util-linux?

If the "-k" option isn't accepted, look for the program mount calls upon to mount the encrypted loopback filesytem. Look up man and info entries for that program for something equivalent to the "-k" option, such as a way to specify key size on the command line. For all we know, the correct syntax could be "--k".

When faced with gentoo-specific problems like this, I usually meet with better success at http://forums.gentoo.org where more people know what they're talking about in terms of Gentoo.

Meisi 05-31-2004 10:16 AM

@thebell

Do you found a solution?

I have "Linux redhat 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 athlon i386 GNU/Linux" / Fedora Core2. I installed the newest util-linux Version 2.12a, with no success.

I think i need a "international" kernel patch, but there is no avaible for 2.6.5.

My old rh8 linux, with "-k" support:

Code:

# uname -a
Linux Samba 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 athlon i386 GNU/Linux
# losetup
usage:
  losetup loop_device                                      # give info
  losetup -d loop_device                                  # delete
  losetup [ options ] loop_device file                    # setup
    where options include
    --offset <num>, -o <num>
        start at offset <num> into file.
    --pass-fd <num>, -p <num>
        read passphrase from file descriptor <num>
        instead of the terminal.
    --encryption <cipher>, -e <cipher>
        encrypt with <cipher>.
        Check /proc/crypto/cipher for available ciphers.
    --keybits <num>, -k <num>
        specify number of bits in the hashed key given
        to the cipher.  Some ciphers support several key
        sizes and might be more efficient with a smaller
        key size.  Key sizes < 128 are generally not
        recommended
    --phash <hash>, -P <hash>
        specify <hash> to use for hashing the passphrase
        (supported: rmd160old, sha256, sha384, sha512)

new fedora c2:

Code:


#uname -a
Linux redhat 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 athlon i386 GNU/Linux
#losetup
  losetup loop_device                                      # give info
  losetup -d loop_device                                  # delete
  losetup [ -e encryption ] [ -o offset ] loop_device file # setup



All times are GMT -5. The time now is 01:50 PM.