Tested on:Raspbian Jessie; Kivy; RPi B+, RPi 2
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)

Protect your data: directory encryption on a Raspberry Pi with ecryptfs

EcryptFS is a widely used tool for disk encryption under Linux. It is perfect for protecting data on a Raspberry Pi. The method described here is very basic and does nothing more than preventing read access to a specific directory if that directory was not mounted with a passphrase.

EcryptFS installation
First, update the software repositories and install ecryptfs with

Create an encrypted directory
Think of a good PASSWORD, then perform these steps:

Answer both questions asked with yes. ~/secret is the directory used for encryption.

Check the encryption
With the directory still being mounted, create a test file with

enter “test” and display it with

which will show “test”.
After unmounting the directory with

trying to display the file content like above just shows characters in machine language. Use the same mount command used for creating the encrypted directory for remounting (decyphering) the content on the Raspberry Pi again.
Check out the HowToForge EcryptFS Tutorial for much more info, e.g. how to store the password on an USB stick.

HowToForge EcryptFS Tutorial: https://www.howtoforge.com/tutorial/how-to-encrypt-directories-and-partitions-with-ecryptfs-on-debian/

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.


  1. Reporting dead link for the bodhizazen advanced tutorial.


Time limit is exhausted. Please reload CAPTCHA.