unixabg / cryptmypi

Project to assist users in building an encrypted raspberry pi
GNU General Public License v3.0
63 stars 20 forks source link

cryptmypi 4.x

Assists in the full setup of [encrypted] Raspberry Pis. Able to maintain multiple setup configurations, for multiple usages, offers a multitude of modular configurations hooks providing out-of-the-box optional features for initramfs (while the system in encrypted) and the actual system (after boot).

Note: Only tested on:

How it works

A configuration profile defines 2 stages:

  1. A base OS image is extracted.
  2. The build is written to an SD card.

Optional configuration hooks can be set in any of the stages:

Capabilities

  1. FULL DISK ENCRYPTION: Although the project can be used to set up an unencrypted RPi box, it is currently capable to set up a fully encrypted Kali, Pi OS, or Ubuntu Linux.
  1. OPERATIONAL: System optional hooks can assist in many common configurations.

Scenarios

Example configurations are provided in the project examples directory.

Each example outlines a possible configurations scenario, from building a standard kali to building an encrypted drop box RPi for remote control.

Installation

Clone this git repo.

Usage

Simply:

$ ./cryptmypi.sh configuration_profile_directory

configuration_profile_directory should be an existing configuration directory. Use one of the provided examples or create your own.

Explore stage2

You can decrypt, mount and chroot an SD card by using the explore pre-configuration:

$ ./cryptmypi.sh examples/explore configuration_profile_directory

There is an actual explore directory that contains a customized configuration profile. This profile overwrites the default stage1 and stage2 hooks so that no formatting, partitioning, etc. is done. It reads another configuration profile and mounts a block device accordingly.

Additionally, you can use this "hack" configuration for more than chrooting to bash. You may update existing systems by copying the examples/explore directory and changing stage2_optional_hooks to execute optional hooks or other commands.