4

Is there a way to completely encrypt the SD card for the Raspberry Pi? Meaning that only with a password the SD card is accessible and bootable.

I am looking for a solution similar to TrueCrypt or VeraCrypt that allow encrypting the complete boot partitions, unfortunately for Windows only. On boot time, these solutions will ask for the password and only then boot from the encrypted partition.

Knowing that the Raspberry has a very specific boot sequence, I would be graceful for any thoughts or hints.

Thanks!

1 Answer 1

5

I haven't tested this, but there's a reasonable looking walkthrough here. It's too long to repost in its entirety, but they provide an overview of the process:

  • We download the required Kali Raspberry Pi RPi image and dd it to an SD card.
  • We chroot to the RPi image and install/update several files in preparation for our crypted boot.
  • We create an initramfs file which includes Dropbear and freshly generated SSH keys.
  • We rsync the modified rootfs to a temporary backup location and then delete the rootfs partition from the SD.
  • We then recreate an encrypted partition to which we restore the root partition data. That’s it!

If all goes well, the RPi will boot and then LUKS will kick in and ask for a password to decrypt the root drive, while simultaneously opening a Dropbear SSH session through which you can SSH in and provide the boot decryption password.

2
  • Thank you, I will test this and comment if it worked. Cheers, Andy
    – NDB
    Mar 11, 2016 at 9:59
  • Hi, @NDB, did this ever work for you?
    – bitsmack
    May 14, 2022 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.