LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-28-2005, 12:51 PM   #1
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Rep: Reputation: 31
slackware encryption dm-crypt


I configured my 2.6.12.3 kernel for dm-crypt... everything works then I compile the user-space tool cryptsetup-luks from
http://luks.endorphin.org/dm-crypt
but on make it spits

Code:
keyencryption.c:31:26: libdevmapper.h: No such file or directory
keyencryption.c:35:26: libdevmapper.h: No such file or directory
keyencryption.c: In function `LUKS_endec_template':
keyencryption.c:100: warning: initialization makes pointer from integer 
withouta cast
make[2]: *** [libluks_la-keyencryption.lo] Error 1
make[2]: Leaving directory `/home/x/cryptsetup-luks-1.0.1/luks'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/x/cryptsetup-luks-1.0.1'
make: *** [all] Error 2
I tried using the cryptsetup-1.0.1-i686-pc-linux-gnu-static.bz2 - Precompiled binary version 1.0.1: my kernel is working correctly so I issue the commands written on the luks page

http://luks.endorphin.org/dm-crypt

# cryptsetup luksFormat /dev/loop0

WARNING!
========
This will overwrite data on /dev/loop0 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
failed to setup dm-crypt mapping.
failed to write to key storage.
Command failed.


What's wrong???

Last edited by rino.caldelli; 07-31-2005 at 04:28 PM.
 
Old 07-29-2005, 09:43 AM   #2
dragoncity99
Member
 
Registered: Dec 2004
Location: Malaysia
Distribution: Redhat/Fedora Core, Slackware, Ubuntu, Knoppix, Gentoo, SUSE, Ubuntu
Posts: 40

Rep: Reputation: 15
Have u enabled the option:

types = ["device-mapper", 16] in /etc/lvm/lvm.conf ?

Note, this can only be done in LVM though ok.


http://deb.riseup.net/storage/encryption/dmcrypt/
 
Old 07-29-2005, 05:33 PM   #3
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by dragoncity99
Have u enabled the option:

types = ["device-mapper", 16] in /etc/lvm/lvm.conf ?

Note, this can only be done in LVM though ok.


http://deb.riseup.net/storage/encryption/dmcrypt/
I don't have /etc/lvm/lvm.conf ! I use slackware 10.1 and I don't know what lvm is but shouldn't have anything to do with encryption... right?
 
Old 07-29-2005, 06:26 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
From http://www.saout.de/misc/dm-crypt/:
Quote:
But I don't want to use LVM!
You don't need LVM. Device-mapper is an all-purpose kernel feature, not tied to LVM in any way.
You should however, setup the kernel as said on the link posted by dragoncity99 to get device mapper working correctly. Then instead of using cryptsetup as stated on that page, use crypsetup-luks.
 
Old 07-30-2005, 01:18 AM   #5
slackwh0re
LQ Newbie
 
Registered: Oct 2003
Posts: 16

Rep: Reputation: 0
extracted from my slackware setup guide at http://www.partydome.us/?slackware:

Required packages:
hashalot
cryptsetup.sh
device-mapper-1.01.00-i486-1.tgz (from /testing)

1) Compile hashalot, move to /usr/local/bin
2) Move cryptsetup.sh to /usr/local/bin
3) Run 'modprobe dm-crypt' to load the required kernel modules
4) Run 'cryptsetup -c cipher -s keysize create crypto /dev/hda5' to create the crypto
5) Run 'mkdir /crypto' to create the crypto mount point
6) Run 'mount /dev/mapper/crypto /crypto' to access your encrypted file system

links to the packages:
http://www.paranoiacs.org/~sluskyb/h...lot-0.3.tar.gz
http://www.saout.de/misc/dm-crypt/cryptsetup.sh

this is how i got dm-crypt setup under slackware 10.1. sorry but i dont know enough about encryption under linux to help you with the method you are trying. but i can tell you that the instructions above are how i got it working on my system, so you shouldnt encounter any problems.

Last edited by slackwh0re; 07-30-2005 at 01:19 AM.
 
Old 07-30-2005, 10:18 AM   #6
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
there are packages on http://slackware.php.co.ba.

you need "device-mapper" and "cryptsetup".

I tested it today with 10.1 and everything is running perfectly OK.

M.
 
Old 07-31-2005, 09:21 AM   #7
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by slackwh0re
extracted from my slackware setup guide at http://www.partydome.us/?slackware:

Required packages:
hashalot
cryptsetup.sh
device-mapper-1.01.00-i486-1.tgz (from /testing)

1) Compile hashalot, move to /usr/local/bin
2) Move cryptsetup.sh to /usr/local/bin
3) Run 'modprobe dm-crypt' to load the required kernel modules
4) Run 'cryptsetup -c cipher -s keysize create crypto /dev/hda5' to create the crypto
5) Run 'mkdir /crypto' to create the crypto mount point
6) Run 'mount /dev/mapper/crypto /crypto' to access your encrypted file system

links to the packages:
http://www.paranoiacs.org/~sluskyb/h...lot-0.3.tar.gz
http://www.saout.de/misc/dm-crypt/cryptsetup.sh

this is how i got dm-crypt setup under slackware 10.1. sorry but i dont know enough about encryption under linux to help you with the method you are trying. but i can tell you that the instructions above are how i got it working on my system, so you shouldnt encounter any problems.
I did what you told me and got a ....

root@x:/usr/local/bin# cryptsetup.sh -c aes -s 12 create crypto /dev/hda2
Error: dmsetup not found in search path.

what does that mean??? It should be a devicemapper error... you haven't told me where you downloaded device mapper from and how you installed it...

thank you

Last edited by rino.caldelli; 07-31-2005 at 09:27 AM.
 
Old 07-31-2005, 09:33 AM   #8
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
Waiting slackwhore to answer I did this.. I downloaded devicemapper from the link http://slackware.php.co.ba./ that malo_umoran posted and got it working... now here's what I get
Code:
root@x:/home/x# cd /usr/local/bin/
root@x:/usr/local/bin# cryptsetup.sh -c aes -s 12 
create crypto /dev/hda2
Enter passphrase:
Error: Could not create device, see syslog for details.
/dev/hda2 is a mounted vfat partition... what's the problem????

Last edited by rino.caldelli; 07-31-2005 at 04:27 PM.
 
Old 07-31-2005, 10:18 AM   #9
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
Quote:
Originally posted by rinonapo
Waiting slackwhore to answer I did this.. I downloaded devicemapper from the link http://slackware.php.co.ba./ that malo_umoran posted and got it working... now here's what I get

root@x:/home/x# cd /usr/local/bin/
root@x:/usr/local/bin# cryptsetup.sh -c aes -s 12 create crypto /dev/hda2
Enter passphrase:
Error: Could not create device, see syslog for details.

/dev/hda2 is a mounted vfat partition... what's the problem????

don't use "cryptsetup.sh" but just "cryptsetup" from package "cryptsetup-0.1-i686-2mm". I made these packages myself and tested it with kernel 2.6.12.3.

I am using it all the time without any problems ...


example:
# echo PASSWORD | cryptsetup create crypto /dev/hda2
# mount -t ext2 /dev/mapper/crypto /mnt/crypto

important: if you don't give any paramters about encryption, default is "-c aes -s 256"

M.
 
Old 07-31-2005, 12:59 PM   #10
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
malo_umoran I did what you said and got
Code:
root@x:/home/x# echo PASSWORD | cryptsetup create crypto /dev/hda2
cryptsetup: error while loading shared libraries: libgcrypt.so.11: 
cannot open shared object file: No such file or directory
root@x:/home/x#
By the way: I wanted to thank everyone for contributing to this post which is getting very interesting.. thank you so much!

Last edited by rino.caldelli; 07-31-2005 at 04:26 PM.
 
Old 07-31-2005, 01:17 PM   #11
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
you of course need libgcrypt. I forgot to mention that, because it was not my package. there are a few of these on linuxpackages.net, just choose your Slack:

http://www.linuxpackages.net/search_...libgcrypt&ver=

and "PASSWORD" in

Code:
echo PASSWORD | cryptsetup create crypto /dev/hda2
is acctualy your password. I wrote it like that to show, how can be used in scripts. you can of course still use

Code:
cryptsetup create crypto /dev/hda2
and after that you will be asked for password.

M.

Last edited by malo_umoran; 07-31-2005 at 01:20 PM.
 
Old 07-31-2005, 04:24 PM   #12
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
I'm getting quite frustrated at linux encryption, I've just installed libgcrypt and I get a new error
Code:
root@x:/home/x# cryptsetup create crypto /dev/hda2
cryptsetup: error while loading shared libraries: libgpg-error.so.0: 
cannot open shared object file: No such file or directory
Why is it all so complicated?? I compiled the 2.6 kernel, enabled all modules, installed devicemapper, installed cryptsetup, installed hashalot, now I installed libgcrypt and still I can't encrypt a hard drive!!!!!

Last edited by rino.caldelli; 07-31-2005 at 04:26 PM.
 
Old 07-31-2005, 09:08 PM   #13
dragoncity99
Member
 
Registered: Dec 2004
Location: Malaysia
Distribution: Redhat/Fedora Core, Slackware, Ubuntu, Knoppix, Gentoo, SUSE, Ubuntu
Posts: 40

Rep: Reputation: 15
I had the same problem before this, and using the same Slack 10.1, this is because actually u need this two files:

1. libgcrypt-1.2.1-i486-1h3x.tgz

2. libgpg-error-1.0-i486-1arf.tgz --> U MISSED OUT THIS ONE
 
Old 08-01-2005, 01:47 AM   #14
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
Thank you dragoncity... now I have all programs and libraries and kernel modules, but now i get a more laconic

Code:
root@x:/usr/local/bin# cryptsetup create cryptos /dev/hda2
Command failed: Invalid argument
the sintax is right and /dev/hda2 exists and is a used vfat partition!

By the way out of curiosity I tried using crypto.sh which I had in /usr/local/bin
Code:
root@x:/usr/local/bin# cryptsetup.sh create crypto /dev/hda2
Error: No device mapper support in kernel.
root@x:/usr/local/bin# modprobe device_mapper
FATAL: Module device_mapper not found.
the device mapper in my kernel is activated under block devices!!!

Last edited by rino.caldelli; 08-01-2005 at 01:53 AM.
 
Old 08-01-2005, 02:36 AM   #15
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
strange ... I never had any problems.

do you have both activated:
Code:
<*>   Device mapper support
<*>     Crypt target support
and all the encryptions you need?

M.


p.s.: you don't need "hashalot" for dm-crypt. cryptsetup.sh as an older version needed it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No Crypt AMMullan Linux - Software 4 08-08-2007 03:48 AM
dm-crypt rino.caldelli Linux - Security 1 07-28-2005 12:46 PM
cryptoapi losetup encryption in slackware rino.caldelli Slackware 1 07-26-2005 04:15 AM
Mandrake 9.0 Wireless Works without encryption.. does not with encryption topcat Linux - Wireless Networking 3 05-04-2003 08:47 PM
crypt IBP Linux - Software 3 03-03-2003 05:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration