DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset
@ 2011-04-13 10:04 Admin bonnefoy.eu
  2011-04-13 13:21 ` Arno Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Admin bonnefoy.eu @ 2011-04-13 10:04 UTC (permalink / raw)
  To: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

Hello,

I had offset with cryptoloop using twofish. But i'm unable to mount it with
cryptosetup.
I used to mount this like that:

losetup -e twofish -o 2560 /dev/loop0 /dev/sdb1 => enter passphrase
mount -t ext3 /dev/loop0 /home/

I tried with your command :
cryptsetup create -c twofish -o 2560 testAB /dev/sdb1
and then :
mount /dev/mapper/testAB test/

i tried with --skip option as well without success

But it's not working (wong FS type).

As I change my kernel to 2.6.32 recently, cryptoloop is not available any
more natively. I recompiled the module and I'm still able to mount file
system as before.

Do you see something wrong?

Thanks for help

Antoine

[-- Attachment #2: Type: text/html, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset
  2011-04-13 10:04 [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset Admin bonnefoy.eu
@ 2011-04-13 13:21 ` Arno Wagner
  2011-04-13 13:57   ` Milan Broz
  0 siblings, 1 reply; 5+ messages in thread
From: Arno Wagner @ 2011-04-13 13:21 UTC (permalink / raw)
  To: dm-crypt

Hi,

one thing that I immediately see is that losetup
specifies the offset in bytes, while cryptsetup uses
sectors (of 512 bytes).

Maybe try 

  cryptsetup create -c twofish -o 5 testAB /dev/sdb1

Gr"usse,
Arno



On Wed, Apr 13, 2011 at 12:04:07PM +0200, Admin bonnefoy.eu wrote:
> Hello,
> 
> I had offset with cryptoloop using twofish. But i'm unable to mount it with
> cryptosetup.
> I used to mount this like that:
> 
> losetup -e twofish -o 2560 /dev/loop0 /dev/sdb1 => enter passphrase
> mount -t ext3 /dev/loop0 /home/
> 
> I tried with your command :
> cryptsetup create -c twofish -o 2560 testAB /dev/sdb1
> and then :
> mount /dev/mapper/testAB test/
> 
> i tried with --skip option as well without success
> 
> But it's not working (wong FS type).
> 
> As I change my kernel to 2.6.32 recently, cryptoloop is not available any
> more natively. I recompiled the module and I'm still able to mount file
> system as before.
> 
> Do you see something wrong?
> 
> Thanks for help
> 
> Antoine

> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt


-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset
  2011-04-13 13:21 ` Arno Wagner
@ 2011-04-13 13:57   ` Milan Broz
  0 siblings, 0 replies; 5+ messages in thread
From: Milan Broz @ 2011-04-13 13:57 UTC (permalink / raw)
  To: dm-crypt

On 04/13/2011 03:21 PM, Arno Wagner wrote:
> Hi,
> 
> one thing that I immediately see is that losetup
> specifies the offset in bytes, while cryptsetup uses
> sectors (of 512 bytes).
> 
> Maybe try 
> 
>   cryptsetup create -c twofish -o 5 testAB /dev/sdb1

yes, and there are many more options - because the losetup
exists in many versions, you need to check what exactly
it uses - then just setup parameters accordingly.

- note offset bytes vs sectors (see above)
- sometimes you need to set not only offset but also IV offset (to the same value)
- note encryption mode (probably you need "-c twofish-cbc-plain")
- key size (for 128 bits use "-s 128")
- hash algorithm for passphrase (perhaps ripemd160, maybe sha256)

Example (I am using loop-aes patched losetup here, so it may be quite different for you):

losetup-aes -e aes128 -o 2560 /dev/loop0 /dev/sdb

is equivalent to 

cryptsetup create -o 5 --skip 5 -c aes-cbc-plain -s 128 -h sha256 <name> /dev/sdb

but as I said, it depends which losetup you are using, it is quite mess sometimes:-)
(and it cannot be autodetected easily...)

Milan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset
@ 2011-04-14 14:00 Admin bonnefoy.eu
  2011-04-14 16:48 ` Arno Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Admin bonnefoy.eu @ 2011-04-14 14:00 UTC (permalink / raw)
  To: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Hello Milan, Arno

Thanks a lot  for your inputs, it's working fine now!

With Debian 5.x, with losetup, I used previously  for kernel < 2.6.32:
losetup -e twofish -o 2560 /dev/loop0 /dev/sdb1
mount -t ext3 /dev/loop0 /home/

I'm now using cryptsetup 1.1.3 in Debian 6.0 with this command:
cryptsetup create -c twofish -o 5 --skip 5  testAB /dev/sdb1
mount /dev/mapper/testAB /home


Thanks again

regards

Antoine

[-- Attachment #2: Type: text/html, Size: 496 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset
  2011-04-14 14:00 Admin bonnefoy.eu
@ 2011-04-14 16:48 ` Arno Wagner
  0 siblings, 0 replies; 5+ messages in thread
From: Arno Wagner @ 2011-04-14 16:48 UTC (permalink / raw)
  To: dm-crypt

P.S.: I am in the proccess to add a section about interoperability
to the FAQ, so feedback like this does not get lost.

Arno


On Thu, Apr 14, 2011 at 04:00:59PM +0200, Admin bonnefoy.eu wrote:
> Hello Milan, Arno
> 
> Thanks a lot  for your inputs, it's working fine now!
> 
> With Debian 5.x, with losetup, I used previously  for kernel < 2.6.32:
> losetup -e twofish -o 2560 /dev/loop0 /dev/sdb1
> mount -t ext3 /dev/loop0 /home/
> 
> I'm now using cryptsetup 1.1.3 in Debian 6.0 with this command:
> cryptsetup create -c twofish -o 5 --skip 5  testAB /dev/sdb1
> mount /dev/mapper/testAB /home
> 
> 
> Thanks again
> 
> regards
> 
> Antoine

> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt


-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-14 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 10:04 [dm-crypt] Replacing cryptoloop with dm-crypt in Debian with twofish and offset Admin bonnefoy.eu
2011-04-13 13:21 ` Arno Wagner
2011-04-13 13:57   ` Milan Broz
  -- strict thread matches above, loose matches on Subject: below --
2011-04-14 14:00 Admin bonnefoy.eu
2011-04-14 16:48 ` Arno Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox