Skip to contentSkip to conversation

luks testing and source deb pkg

DISCUSSION James M. Leddy 4 participants 10 messages Nov 2, 2011 – Nov 3, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I've successfully tested the luks code in ubuntu using a modified grub2 package. You can test yourself if you're already using crypted root and separate /boot by rsying the /boot dev to the root filesyste, removing the /etc/fstab entry, and running:

# GRUB_CRYPTODISK_ENABLE=y grub-install --debug --modules=configfile --modules=gcry_sha1 --modules=gcry_sha256 --modules=fshelp --modules=biosdisk --modules=part_msdos --modules=linux --modules=ext2 --modules=help --modules=minicmd --modules=crypto --modules=cryptodisk --modules=gcry_rijndael --modules=luks /dev/sda # GRUB_CRYPTODISK_ENABLE=y update-grub

The merged source is available here:

https://code.launchpad.net/~jm-leddy/+junk/grub-luks

just do a :

   $ bzr branch lp:~jm-leddy/+junk/grub-luks
   $ cd grub-luks
$ bzr builddeb
#1 lore raw

Hi,

I'm currently also trying to use to the luks code from trunk by using a modified Debian package and the latest source from the Bazaar repository.

However after entering the password, the grub menu doesn't show up and it states that the password is incorrect. I used 12345 which is obviously very hard to misspell repeatedly. I then tried to insert the master password from the LUKS partition directly into the source code and luckily succeeded with that! I'll post the snippet and my modifications to the package tomorrow if someone is interested. Since there is practically no information about this in the internet, I'll probably write a tutorial on how to do a full system encryption "TrueCrypt style" (i.e. with an encrypted /boot partition).

So my question is, James, how did you create your encrypted partition and what file system did you use?

I always use "cryptsetup luksFormat /dev/sda1" (on Debian Sid) which uses aes-cbc-essiv as a default value AFAIK and ext3.

Could you also append your tared "debian" folder which generates the grub package(s)?

Regards,

Lukas

Quoted 30 lines · James M. Leddy

Hi,

I've successfully tested the luks code in ubuntu using a modified grub2 package. You can test yourself if you're already using crypted root and separate /boot by rsying the /boot dev to the root filesyste, removing the /etc/fstab entry, and running:

# GRUB_CRYPTODISK_ENABLE=y grub-install --debug --modules=configfile --modules=gcry_sha1 --modules=gcry_sha256 --modules=fshelp --modules=biosdisk --modules=part_msdos --modules=linux --modules=ext2 --modules=help --modules=minicmd --modules=crypto --modules=cryptodisk --modules=gcry_rijndael --modules=luks /dev/sda
# GRUB_CRYPTODISK_ENABLE=y update-grub

The merged source is available here:

https://code.launchpad.net/~jm-leddy/+junk/grub-luks

just do a :

  $ bzr branch lp:~jm-leddy/+junk/grub-luks
  $ cd grub-luks
$ bzr builddeb

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 6 lines · Lukas Anzinger

Hi,

I'm currently also trying to use to the luks code from trunk by using a modified Debian package and the latest source from the Bazaar repository.

Quoted 10 lines

However after entering the password, the grub menu doesn't show up and it states that the password is incorrect. I used 12345 which is obviously very hard to misspell repeatedly. I then tried to insert the master password from the LUKS partition directly into the source code and luckily succeeded with that! I'll post the snippet and my modifications to the package tomorrow if someone is interested. Since there is practically no information about this in the internet, I'll probably write a tutorial on how to do a full system encryption "TrueCrypt style" (i.e. with an encrypted /boot partition).

Could you make a small 1MiB example image, compress and send it to me?

Quoted 48 lines

So my question is, James, how did you create your encrypted partition and what file system did you use?

I always use "cryptsetup luksFormat /dev/sda1" (on Debian Sid) which uses aes-cbc-essiv as a default value AFAIK and ext3.

Could you also append your tared "debian" folder which generates the grub package(s)?

Regards,

Lukas

Quoted 21 lines · James M. Leddy

Hi,

I've successfully tested the luks code in ubuntu using a modified grub2 package. You can test yourself if you're already using crypted root and separate /boot by rsying the /boot dev to the root filesyste, removing the /etc/fstab entry, and running:

# GRUB_CRYPTODISK_ENABLE=y grub-install --debug --modules=configfile --modules=gcry_sha1 --modules=gcry_sha256 --modules=fshelp --modules=biosdisk --modules=part_msdos --modules=linux --modules=ext2 --modules=help --modules=minicmd --modules=crypto --modules=cryptodisk --modules=gcry_rijndael --modules=luks /dev/sda
# GRUB_CRYPTODISK_ENABLE=y update-grub

The merged source is available here:

https://code.launchpad.net/~jm-leddy/+junk/grub-luks

just do a :

Quoted 9 lines
  $ bzr branch lp:~jm-leddy/+junk/grub-luks
  $ cd grub-luks
$ bzr builddeb

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#3 lore raw
In reply to Lukas Anzinger
Quoted 5 lines · Lukas Anzinger

Hi,

I'm currently also trying to use to the luks code from trunk by using a modified Debian package and the latest source from the Bazaar repository.

Please let me know where I can find this tree so that I can test myself. Additionally, if you know if it should "just work" to just install the Debian version to Ubuntu, please let me know. I'm a recent convert from Fedora so a lot of this is new to me.

Quoted 10 lines

However after entering the password, the grub menu doesn't show up and it states that the password is incorrect. I used 12345 which is obviously very hard to misspell repeatedly. I then tried to insert the master password from the LUKS partition directly into the source code and luckily succeeded with that! I'll post the snippet and my modifications to the package tomorrow if someone is interested. Since there is practically no information about this in the internet, I'll probably write a tutorial on how to do a full system encryption "TrueCrypt style" (i.e. with an encrypted /boot partition).

Expect one from me as well @ jmleddy.wordpress.com

Quoted 6 lines

So my question is, James, how did you create your encrypted partition and what file system did you use?

I always use "cryptsetup luksFormat /dev/sda1" (on Debian Sid) which uses aes-cbc-essiv as a default value AFAIK and ext3.

That's exactly what I did, except with ext4. The file system shouldn't matter in evaluating the password. From dmsetup table:

aes-cbc-essiv:sha256

Quoted 2 lines

Could you also append your tared "debian" folder which generates the grub package(s)?

Sure thing when I have a little more time.

Quoted 41 lines

Regards,

Lukas

Quoted 21 lines · James M. Leddy

Hi,

I've successfully tested the luks code in ubuntu using a modified grub2 package. You can test yourself if you're already using crypted root and separate /boot by rsying the /boot dev to the root filesyste, removing the /etc/fstab entry, and running:

# GRUB_CRYPTODISK_ENABLE=y grub-install --debug --modules=configfile --modules=gcry_sha1 --modules=gcry_sha256 --modules=fshelp --modules=biosdisk --modules=part_msdos --modules=linux --modules=ext2 --modules=help --modules=minicmd --modules=crypto --modules=cryptodisk --modules=gcry_rijndael --modules=luks /dev/sda
# GRUB_CRYPTODISK_ENABLE=y update-grub

The merged source is available here:

https://code.launchpad.net/~jm-leddy/+junk/grub-luks

just do a :

Quoted 9 lines
   $ bzr branch lp:~jm-leddy/+junk/grub-luks
   $ cd grub-luks
$ bzr builddeb

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#4 lore raw

I attached the contents of my debian folder which I used to build proper packages out of revision 3520 from trunk. It's only tested on x86 and the efi parts have been *removed* from the Debian package. This is due to a bug in the grub build system (?) which I reported here (http://lists.gnu.org/archive/html/grub-devel/2011-10/msg00048.html).
I didn't investigate any further since I don't need it. I removed some patches that have already been applied to upstream (i.e. trunk) and some patches that would need further work.

Before you can create the packages, you have to sync the translations to the "po" directory of grub. Just read the README in the "po" directory. After installation you have to add "GRUB_CRYPTODISK_ENABLE=y" to /etc/default/grub.

# grub-install --debug
# update-grub

Make sure that the contents of your fstab file is correct and everything is encrypted!

Quoted 4 lines · James M. Leddy

Please let me know where I can find this tree so that I can test myself. Additionally, if you know if it should "just work" to just install the Debian version to Ubuntu, please let me know. I'm a recent convert from Fedora so a lot of this is new to me.

You could try, however, I would never do it on a production system but rather in an VM.

2011/11/2 Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>:

Quoted 1 line

Could you make a small 1MiB example image, compress and send it to me?

Do you mean the core.img created from the latest revision without any modifications?

Quoted 1 line · James M. Leddy
$ bzr branch lp:~jm-leddy/+junk/grub-luks

Seems to me that you used the luks branch from grub. luks has already been integrated into trunk there is no need to do that.

Regards,

Lukas

#5 lore raw
Quoted 2 lines · Lukas Anzinger

Do you mean the core.img created from the latest revision without any modifications?

No, I mean to send to me a LUKS image with which GRUB2 doesn't work.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#6 lore raw
In reply to Lukas Anzinger
Quoted 3 lines · Lukas Anzinger

However after entering the password, the grub menu doesn't show up and it states that the password is incorrect. I used 12345 which is obviously very hard to misspell repeatedly.

It seems that the function grub_getpassword() has problems with numbers coming from the numpad. I added some debugging printfs to the luks code and found out that the passphrase variable always contained an empty string.

I then investigated the problem further and found out that it also happens if I place the password 12345 in the grub.cfg:

##
set superuser="foo"
password foo 12345
##

I can only edit a boot entry if I enter 12345 *NOT* via the num pad.

This seems to be a bug in grub_password_get() or one of the functions it calls, like grub_getkey().

Regards,

Lukas

#7 lore raw

Works for me now, if I disable num lock and enable it afterwards. Strange problem, VirtualBox could als be at fault, though.

Quoted 2 lines · Lukas Anzinger

On Wed, Nov 2, 2011 at 18:59, Lukas Anzinger <[email protected]> wrote:
I can only edit a boot entry if I enter 12345 *NOT* via the num pad.

#8 lore raw
In reply to Lukas Anzinger
Quoted 12 lines · Lukas Anzinger
Quoted 3 lines · Lukas Anzinger

However after entering the password, the grub menu doesn't show up and it states that the password is incorrect. I used 12345 which is obviously very hard to misspell repeatedly.

It seems that the function grub_getpassword() has problems with numbers coming from the numpad. I added some debugging printfs to the luks code and found out that the passphrase variable always contained an empty string.

I then investigated the problem further and found out that it also happens if I place the password 12345 in the grub.cfg:

Quoted 7 lines

##
set superuser="foo"
password foo 12345
##

I can only edit a boot entry if I enter 12345 *NOT* via the num pad.

Stupid question: numlock?

Quoted 12 lines

This seems to be a bug in grub_password_get() or one of the functions it calls, like grub_getkey().

Regards,

Lukas

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#9 lore raw

2011/11/3 Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>:

Quoted 1 line

Stupid question: numlock?

Not stupid but I checked it. :-) The led shines and it only works if I press "num" twice ... but as I said, maybe it's just my keyboard or VirtualBox...