# Cryptsetup not decrypting (I am still here)

## Dorsai!

Hi,

I set up a crypt device on Ubuntu using dm-crypt and cryptsetup-luks.

I used the key aes-lrw-benbi and it worked fine 2 days ago under Ubuntu.

Now that I changed to Gentoo I want to use that device, but it doesn't work.

Here is what i get using the stable cryptsetup-1.0.5-r1

```

dorsai@Dorsai ~ $ sudo cryptsetup luksOpen /dev/sda1 sda1

Enter LUKS passphrase:

Failed to setup dm-crypt key mapping.

Check kernel for support for the aes-lrw-benbi cipher spec and verify that /dev/sda1 contains at least 383 sectors.

Failed to read from key storage

Command failed: No key available with this passphrase.

```

I compliled lrw, aes x86_64, the "device mapper" and the "crypt target support" into the kernel and it seems to load.

```

dorsai@Dorsai / $ cat /proc/crypto

name         : lrw(aes)

driver       : lrw(aes-asm)

module       : crypto_blkcipher

priority     : 200

refcnt       : 1

type         : givcipher

async        : yes

blocksize    : 16

min keysize  : 32

max keysize  : 48

ivsize       : 16

geniv        : chainiv

name         : lrw(aes)

driver       : lrw(aes-asm)

module       : lrw

priority     : 200

refcnt       : 1

type         : blkcipher

blocksize    : 16

min keysize  : 32

max keysize  : 48

ivsize       : 16

geniv        : <default>

name         : aes

driver       : aes-asm

module       : aes_x86_64

priority     : 200

refcnt       : 1

type         : cipher

blocksize    : 16

min keysize  : 16

max keysize  : 32

name         : aes

driver       : aes-generic

module       : aes_generic

priority     : 100

refcnt       : 1

type         : cipher

blocksize    : 16

min keysize  : 16

max keysize  : 32

...

```

after it aborts with the error, I find a sda1 device in /dev/mapper/ but it cannot be mounted.

```
dorsai@Dorsai / $ sudo mount /dev/mapper/sda1 /mnt

Password:

mount: unknown filesystem type 'crypt_LUKS'

```

I am at the end of my knowledge.

Can anyone help me with this?

Edit: I tried it with a different disk which is using XTS and it works.

May it be that cryptsetup doesn't work together with the crypt lrw cypher in the 2.6.25 kernel?Last edited by Dorsai! on Tue Jul 29, 2008 9:46 pm; edited 2 times in total

----------

## Dorsai!

Has anyone got at least  an idea?

----------

## Dorsai!

I tried it under a Xubuntu Live CD and it works perfectly.

I also tried it with a Vanilla Kernel, all Opions in the Kernel and as Modules. Nothing worked.

Whats the difference here between Ubuntu and Gentoo?

I used nearly the same kernel in both, loaded all modules in both and installed the same Userspace Programs in both.

Why can't it just work.

Please, please help me, I really really like the concept of this Distribution, but I need my Data Storage, and as I'm on this problem now for over 3 days without a word of you, I am slowly loosing hope, in this distribution and community.

----------

## JC99

 *Dorsai! wrote:*   

> I tried it under a Xubuntu Live CD and it works perfectly.
> 
> I also tried it with a Vanilla Kernel, all Opions in the Kernel and as Modules. Nothing worked.
> 
> Whats the difference here between Ubuntu and Gentoo?
> ...

 

Have you checked the wiki, there seems to be several articles on the issue.

 *Quote:*   

>  I am slowly loosing hope, in this distribution and community.

 

I feel your frusttration, I currently have a problem with my wireless setup that hasn't been answered but I don't think it's because the community is bad, just that no one knows the answer.

----------

## Dorsai!

the wiki artikles are not about my problem, but about normal usage of dm-crypt cryptsetup.

There are several people on the net which have the same error message as I got, but in most of the cases they just forgot to compile one or another module.

I compiled all modules (I'm sure about that one)

I got the userland tools. (maybe missing some secrete ubuntu preinstalled librarys or sth.?)

I got everything and set it up as I saw it was set up in Ubuntu, but it still wont work.

So my guess would be, that the numerous components involved in this application can't talk with each other.

Somehow cryptsetup doesn't "see" the cypher in the Kernel/module.

I suppose it's either some weird bug that only I encounter and will never get fixed so I have to switch back to Ubuntu, or it is something really really simple, which makes me banging my head against the wall for not having seen it earlier.

----------

## GNUtoo

personally i couldn't open my luks volume with ubuntu...i had to copy gentoo's cryptsetup in order to be able to use my volume from ubuntu...

ubuntu's cryptsetup is old...very old...and mabe they are incompatible because of that...

----------

## JC99

 *Dorsai! wrote:*   

> I compiled all modules (I'm sure about that one)

 

You could try compiling everything into the kernel as opposed to compiling things as modules. Just a suggestion, don't know if it would fix your problem.Last edited by JC99 on Thu Jul 31, 2008 7:27 am; edited 1 time in total

----------

## Dorsai!

Cryptsetup under Ubuntu is newer than the stable in Gentoo.

I just found the problem:

the dmsetup is mapping all my partitions at boot to /dev/mapper so cryptsetup couldn't map sda1. Why it's giving out such a missguiding error message, i don't know.

I spent days finding an error with cryptsetup or the kernel, but after all it was quite simple.

The question now is: why is dmsetup doing this?

----------

