[SOLVED] Encrypted .dat file password

Post here if you are a new Porteus member and you're looking for some help.

[SOLVED] Encrypted .dat file password

Postby dsm » 15 Aug 2015, 13:59

Hi,

I'm new to porteus and I recently installed to usb and booted onto my MacBook.

It boots fine and I created a .dat file for persistence. This also worked fine.

When I encrypted the .dat file though things went bad. When it boots it asks me for a password to decrypt the file but my keyboard doesn't seem to work at that point.

From googling around it seems that the keyboard driver is not loaded for initrd and hence I can't type the password. I checked which module the keyboard is using (usbhid) and I edited linuxrc in initrd to inject it via modprobe. That doesn't seem to work though and I'm out of ideas. It gives error about modules.dep.

Any help much appreciated.

Thanks,
Dean.
Last edited by dsm on 16 Aug 2015, 00:55, edited 1 time in total.
dsm
Ronin
Ronin
 
Posts: 3
Joined: 15 Aug 2015, 13:50
Location: Australia
Distribution: 3.1

Re: Encrypted .dat file password

Postby fanthom » 15 Aug 2015, 14:27

Hello Deaan,

usbhid driver is compiled into Porteus kernel so problem must be elsewhere.
Please boot in Always Fresh mode -> run 'psinfo' command -> upload generated report to pastebin.com -> link here.

Thank you
Please add [Solved] to your thread title if the solution was found.
User avatar
fanthom
Site Admin
Site Admin
 
Posts: 4505
Joined: 28 Dec 2010, 03:42
Location: Poland, currently - Cork, IE
Distribution: Porteus Kiosk

Re: Encrypted .dat file password

Postby KnallKopf » 15 Aug 2015, 21:33

Are you sure that your keyboard does not work ?
Under which keylayout have you encrypted ?
The password input show your nothing.
And at startup keyboardlayout are US.
Can it happen that you enter a wrong password, because the keyboardlayout where encrypted are not US ?
KnallKopf
Samurai
Samurai
 
Posts: 134
Joined: 18 Sep 2012, 21:56
Location: Absurdistan
Distribution: Porteus 64bit KDE4

Re: Encrypted .dat file password

Postby dsm » 15 Aug 2015, 23:08

Hi,

I booted in always fresh and ran psinfo - output here http://pastebin.com/ZZgCuP9G

My issue is similar to those discussed here http://www.linuxquestions.org/questions/slackware-14/usb-keyboard-won%27t-respond-on-luks-login-879598/ and here http://www.linuxquestions.org/questions/slackware-14/usb-keyboard-not-recognized-at-boot-907465/. It also gets a mention in a slackware encrypted volumes readme (see bottom of post) - could be completely unrelated though, I'm not really sure.

lsusb shows the keyboard is using the usbhid driver. Also, when I boot in normal mode and it can't find a .dat file (for example), it says to boot into always fresh by hitting the enter key but I can't even do that - seems that the keyboard is completely disabled during initrd ...

I haven't made any amendments to keymaps or anything like that, it's all as per the default settings (US keyboard).

Many thanks for your help.

"USB keyboards and LUKS
----------------------

If you have set up an encrypted root partition, you will need to have
access to your keyboard in order to type the passphrase. This may require
you to add the 'uhci-hcd' and 'usbhid' modules to your initrd image if you
have a USB keyboard. Also note that if you are using a non-US keyboard,
you can use the '-l' parameter to the 'mkinitrd' command in order to add
support for this keyboard to your initrd."
dsm
Ronin
Ronin
 
Posts: 3
Joined: 15 Aug 2015, 13:50
Location: Australia
Distribution: 3.1

Re: Encrypted .dat file password

Postby KnallKopf » 16 Aug 2015, 00:09

I think it miss the hid_apple kernelmodule in initrd.
go to a directory were you have write rights and do as root:
Code: Select all
# prepare replace /mnt/loop/boot/syslinux/initrd.xz to your path of initrd
cp /mnt/loop/boot/syslinux/initrd.xz . ; mv initrd.xz oldinitrd.xz

# decontain initrd
rm -r ./initrd 2>/dev/null ; mkdir initrd ; cd initrd ; xz -d < ../oldinitrd.xz | cpio -i

# adding the module
mkdir -p ./lib/modules/3.17.4-porteus/kernel/drivers/hid
cp /lib/modules/3.17.4-porteus/kernel/drivers/hid/hid-apple.ko ./lib/modules/3.17.4-porteus/kernel/drivers/hid

depmod -b . 3.17.4-porteus

# contain the initrd
rm -r ../initrd.xz 2>/dev/null ; find | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > ../initrd.xz ; cd ..

And try to boot with your new initrd.xz
KnallKopf
Samurai
Samurai
 
Posts: 134
Joined: 18 Sep 2012, 21:56
Location: Absurdistan
Distribution: Porteus 64bit KDE4

Re: Encrypted .dat file password

Postby dsm » 16 Aug 2015, 00:55

Thanks so much - it worked!

It didn't work the first time but then I realized that I had to amend linuxrc to include hid-apple via modprobe and all is good.

Thanks again.
dsm
Ronin
Ronin
 
Posts: 3
Joined: 15 Aug 2015, 13:50
Location: Australia
Distribution: 3.1

Re: [SOLVED] Encrypted .dat file password

Postby jrs » 13 Mar 2017, 20:39

Is anybody still reading this_
I have the exact same problem on a Macbook Air, but the solution doesnt work for me.
I changed the 3.17.4-Porteus to 4.9.0-Porteus since I have a newer version.
It stopped at the "depmod -b . 4.9.0-porteus" with some error related to location or file. My system went unstable after that and I reinstalled so I do not want to try it again.
Sorry that i cant give you the exact error.

I am wondering if there are any more recent solutions to this problem? Has anything changed?

Thanx
jrs
White ninja
White ninja
 
Posts: 4
Joined: 13 Mar 2017, 18:45
Location: Norway
Distribution: Desktop V3.2.2

Re: [SOLVED] Encrypted .dat file password

Postby jssouza » 14 Mar 2017, 15:52

Hi jrs,

The initrd already has access to all the kernel modules, since it mounts the 000-kernel.xzm in the early stages of boot. So you need not do all the steps mentioned in the previous post. However, you still have to add a line in the linuxrc file to load the hid-apple kernel module.

Steps to follow:
1. Unpack initrd.xz
2. Search in linuxrc for the line that says:
# Setup changes:

3. Add this as the next line
Code: Select all
modprobe hid-apple

4. Repack initrd and boot using this new initrd.xz

Tested this on a Macbook Pro, and after this change, the Mac's keyboard worked to enter the password.

Good luck!
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: [SOLVED] Encrypted .dat file password

Postby jrs » 15 Mar 2017, 14:22

Great Success!
Thank you jssouza!

For other newbies who need to do this: Unpack/repack of initrd does not work with the GUI. Use the commands in the above post.

It worked, but the encrypted savefile is empty. The contents of the original savefile was not copied over to the encrypted file. Odd!

Jon
jrs
White ninja
White ninja
 
Posts: 4
Joined: 13 Mar 2017, 18:45
Location: Norway
Distribution: Desktop V3.2.2

Re: [SOLVED] Encrypted .dat file password

Postby jssouza » 16 Mar 2017, 10:09

jrs wrote:It worked, but the encrypted savefile is empty. The contents of the original savefile was not copied over to the encrypted file. Odd!Jon

Not sure if you mean the "Resize" or the "Encrypt" options of the save file manager? It seems to be working fine here on a test savefile container. The new file had the old contents.
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: [SOLVED] Encrypted .dat file password

Postby jrs » 17 Mar 2017, 09:46

I mean the "Encrypt" option. Thank you for testing it. I will do a new test myself.
Jon
jrs
White ninja
White ninja
 
Posts: 4
Joined: 13 Mar 2017, 18:45
Location: Norway
Distribution: Desktop V3.2.2

Re: [SOLVED] Encrypted .dat file password

Postby jrs » 17 Mar 2017, 10:07

Ok, it seems like you have to boot in "Always fresh" mode to convert savefiles. I did not work when I encrypted the file from a logged in user, but worked in fresh mode.

Jon
jrs
White ninja
White ninja
 
Posts: 4
Joined: 13 Mar 2017, 18:45
Location: Norway
Distribution: Desktop V3.2.2


Return to Newbie questions



Who is online

Users browsing this forum: Bing [Bot] and 4 guests