[SOLVED] Encrypted .dat file password

Post here if you are a new Porteus member and you're looking for some help.
dsm
Ronin
Ronin
Posts: 3
Joined: 15 Aug 2015, 12:50
Distribution: 3.1
Location: Australia

[SOLVED] Encrypted .dat file password

Post#1 by dsm » 15 Aug 2015, 12: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 15 Aug 2015, 23:55, edited 1 time in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Encrypted .dat file password

Post#2 by fanthom » 15 Aug 2015, 13: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.

KnallKopf
Samurai
Samurai
Posts: 134
Joined: 18 Sep 2012, 20:56
Distribution: Porteus 64bit KDE4
Location: Absurdistan

Re: Encrypted .dat file password

Post#3 by KnallKopf » 15 Aug 2015, 20: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 ?

dsm
Ronin
Ronin
Posts: 3
Joined: 15 Aug 2015, 12:50
Distribution: 3.1
Location: Australia

Re: Encrypted .dat file password

Post#4 by dsm » 15 Aug 2015, 22: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 ... in-879598/ and here http://www.linuxquestions.org/questions ... ot-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."

KnallKopf
Samurai
Samurai
Posts: 134
Joined: 18 Sep 2012, 20:56
Distribution: Porteus 64bit KDE4
Location: Absurdistan

Re: Encrypted .dat file password

Post#5 by KnallKopf » 15 Aug 2015, 23: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

dsm
Ronin
Ronin
Posts: 3
Joined: 15 Aug 2015, 12:50
Distribution: 3.1
Location: Australia

Re: Encrypted .dat file password

Post#6 by dsm » 15 Aug 2015, 23: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.

jrs
White ninja
White ninja
Posts: 14
Joined: 13 Mar 2017, 17:45
Distribution: Desktop V4
Location: Norway

Re: [SOLVED] Encrypted .dat file password

Post#7 by jrs » 13 Mar 2017, 19: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

jssouza
Legendary
Legendary
Posts: 1165
Joined: 09 Jul 2015, 14:17
Distribution: Porteus x86 arm

Re: [SOLVED] Encrypted .dat file password

Post#8 by jssouza » 14 Mar 2017, 14: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!

jrs
White ninja
White ninja
Posts: 14
Joined: 13 Mar 2017, 17:45
Distribution: Desktop V4
Location: Norway

Re: [SOLVED] Encrypted .dat file password

Post#9 by jrs » 15 Mar 2017, 13: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

jssouza
Legendary
Legendary
Posts: 1165
Joined: 09 Jul 2015, 14:17
Distribution: Porteus x86 arm

Re: [SOLVED] Encrypted .dat file password

Post#10 by jssouza » 16 Mar 2017, 09: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.

jrs
White ninja
White ninja
Posts: 14
Joined: 13 Mar 2017, 17:45
Distribution: Desktop V4
Location: Norway

Re: [SOLVED] Encrypted .dat file password

Post#11 by jrs » 17 Mar 2017, 08: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: 14
Joined: 13 Mar 2017, 17:45
Distribution: Desktop V4
Location: Norway

Re: [SOLVED] Encrypted .dat file password

Post#12 by jrs » 17 Mar 2017, 09: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

Post Reply