# Encrypting /home folder using LUKS - CM4

**URL:** <https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289>\
**Category:** uConsole\
**Created:** [October 16, 2023, 1:43am UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289 "2023-10-16T01:43:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![warszawa](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/warszawa/32/6676_2.png) [@warszawa](https://forum.clockworkpi.com/u/warszawa)\
**Post date:** [October 16, 2023, 1:43am UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/1 "2023-10-16T01:43:33Z")

</div>

Some of us are probably planning on traveling with the uConsole. If it gets lost though, anybody can pull your sd card out and go through all your files and read your business.

Encrypting your /home directory seems like a good idea - I used this easy howto guide to get there.  
[https://www.makeuseof.com/how-to-protect-your-raspberry-pi-data-from-loss-or-theft/](https://www.makeuseof.com/how-to-protect-your-raspberry-pi-data-from-loss-or-theft/)

Just a public service announcement - if any longtime linux experts have some other suggestions about how to do this I’d like to hear some tips.

---

<div class="post-metadata">

**Author:** ![Yochi](https://avatars.discourse-cdn.com/v4/letter/y/87869e/32.png) [@Yochi](https://forum.clockworkpi.com/u/Yochi)\
**Post date:** [July 11, 2024, 7:38pm UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/2 "2024-07-11T19:38:02Z")

</div>

I did this, leaving 13GB in root partition unencrypted. Now I have almost 8GB used in the root leaving me with only 5gb of free space. (64GB Card)  
Question: what’s a good amount for the root partition to be safe?

---

<div class="post-metadata">

**Author:** ![perillamint](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/perillamint/32/9925_2.png) [@perillamint](https://forum.clockworkpi.com/u/perillamint)\
**Post date:** [July 15, 2024, 3:43am UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/3 "2024-07-15T03:43:32Z")

</div>

I went through the alternative path – let the initrd loads the required driver and just go FDE.

Due to lacks of support AES acceleration on RP CM4 Broadcom SoC, I’d strongly suggest using alternative algorithm like xchacha12,aes-adiantum or xchacha20,aes-adiantum, which provide better performance compared to AES and provide reasonable security for it.

---

<div class="post-metadata">

**Author:** ![X-Stranger](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/x-stranger/32/9409_2.png) [@X-Stranger](https://forum.clockworkpi.com/u/X-Stranger)\
**Post date:** [July 15, 2024, 1:35pm UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/4 "2024-07-15T13:35:47Z")

</div>

I have used fscrypt for home folder protection following [Encrypting 🔐 a Home 🏡 in Raspberry Pi](https://www.rohanjain.in/fscrypt/) guide (with some small changes). From my PoV this could be easier and does not require to have separate partition for home folder / luks.

Actually Ubuntu uses something similar to thing path.

---

<div class="post-metadata">

**Author:** ![Yochi](https://avatars.discourse-cdn.com/v4/letter/y/87869e/32.png) [@Yochi](https://forum.clockworkpi.com/u/Yochi)\
**Post date:** [July 15, 2024, 2:23pm UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/7 "2024-07-15T14:23:46Z")

</div>

Rooky question, why can’t you just encrypt the home directory as is with fscrypt, why make a new one and move files to it?

---

<div class="post-metadata">

**Author:** ![X-Stranger](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/x-stranger/32/9409_2.png) [@X-Stranger](https://forum.clockworkpi.com/u/X-Stranger)\
**Post date:** [July 15, 2024, 2:38pm UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/8 "2024-07-15T14:38:48Z")

</div>

@Yochi, because it works like this. You do not encrypt files, you setup folder to have encrypted content.

You setup new empty user home folder to be encrypted, then just move files from your origin home folder to it and rename new to old. Steps should be done from root user. It is easier than it seems, the guide can help.

---

<div class="post-metadata">

**Author:** ![xpurple](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/xpurple/32/8911_2.png) [@xpurple](https://forum.clockworkpi.com/u/xpurple)\
**Post date:** [September 15, 2024, 8:50am UTC](https://forum.clockworkpi.com/t/encrypting-home-folder-using-luks-cm4/11289/9 "2024-09-15T08:50:29Z")

</div>

Fscrypt does not hide file sizes. This could be a problem depending on your theat model.
