Sign inSign up

theanurin/luksoid

By theanurin

Updated about 19 hours ago

Luksoid - is a Docker-based command line tool to help users to use LUKS-encrypted partition image wi

Image
1

10K+

theanurin/luksoid repository overview

Docker Image Version GitHub Workflow Status GitHub Repo Stars Docker Pulls Docker Stars

Luksoid

Luksoid - is a Docker-based command line tool to help users to use LUKS-encrypted partition image without Linux host.

Right now, the tool is able:

  • Create a LUKS-encrypted partition images
  • Mount a LUKS-encrypted partition image inside container
  • Add/Remove additinal passphrase to a LUKS-encrypted partition image

Image reason

  • quick review LUKS-encrypted partition backups
  • holds sensitive data as LUKS-encrypted partition

Spec

Environment variables

No any variables

Expose ports

No any ports

Volumes
  • /data - where the tool look for LUKS-encrypted partition images

Inside

Launch

Before use, make an alias

IMAGES_PATH=/path/to/img

alias luksoid='docker run --privileged=true --rm --interactive --tty --mount "type=bind,source=$IMAGES_PATH,target=/data" theanurin/luksoid'
Mount image
luksoid mount my-sensitive-luks.img
Checking for free loop device... Done.

Attaching the file '/data/my-sensitive-luks.img' to /dev/loop0... Done.

LUKS Opening. Now, you will be ask for a passphrase.
Enter passphrase for /data/my-sensitive-luks.img: 
LUKS Opening done.

Mounting a file system '' on LUKS-encrypted partition...
File system was mounted into '/mnt'.

Welcome!

Find your LUKS-encrypted partition in /mnt directory.

Feel free to read/write files in /mnt

[!] Do not forget exit gracefully by 'exit' command to prevent corruption of your image file 'my-sensitive-luks.img'.

bash-5.1# echo "My BTC wallet private key: xxxxxxxxxxxxxxxx" >> my-btc-wallet-keys.txt
bash-5.1# exit
exit

Umointing '/mnt'... Done.
LUKS Closing... Done.
Releasing /dev/loop0... Done.
Init An Image
luksoid init --sizemb=256 --fstype=vfat my-sensitive-luks.img
Initializing a zero-based file '/data/my-sensitive-luks.img' for 256 MBytes... Done.

Checking for free loop device... Done.

Attaching the file '/data/my-sensitive-luks.img' to /dev/loop1... Done.

LUKS Formatting. Now, you will be ask for a passphrase. ALL DATA IN THE FILE '/data/my-sensitive-luks.img' WILL BE DISCARDED!!!
Enter passphrase for /data/my-sensitive-luks.img:
LUKS Formatting done.

LUKS Opening. Now, you will be ask for the passphrase again. We have to open your LUKS image to double-check the passphrase and make filesystem 'vfat' on it.
Enter passphrase for /data/my-sensitive-luks.img:
LUKS Opening done.

Writing zeros to the LUKS-encrypted partition. This ensures that outside world will see this as random data i.e. it protect against disclosure of usage patterns... Done.

Creating a file system 'vfat' on LUKS-encrypted partition...
Device '/dev/mapper/uncrypted-loop1':
heads:255, sectors/track:63, bytes/sector:512
media descriptor:f8
total sectors:491520, clusters:483952, sectors/cluster:1
FATs:2, sectors/FAT:3781
volumeID:61cdcedb, label:''
File system was created.

LUKS Closing... Done.
Releasing /dev/loop1... Done.
Additional passphrases

Sometimes you have to share sensitive data between several persons...

LUKS provide up to 8 slots to setup passphrase. From an user prospective there are ability to decrypt your image with 8 different and indepentent passphrases. So your do not need to have shared passphrase. It is enough to remove/replace disclosured/compromissed passphrase to stay safe.

Add a new passphrase
luksoid passphrase-add my-sensitive-luks.img
Checking for free loop device... Done.

Attaching the file '/data/my-sensitive-luks.img' to /dev/loop0... Done.

LUKS Adding new passphrase (that will use for generate new key)...

Enter any existing passphrase:
Enter new passphrase for key slot:
Verify passphrase:

LUKS Adding passphrase done.

Releasing /dev/loop0... Done.
Remove a passphrase
luksoid passphrase-remove my-sensitive-luks.img
Checking for free loop device... Done.

Attaching the file '/data/my-sensitive-luks.img' to /dev/loop0... Done.

LUKS Removing passphrase...

Enter passphrase to be deleted:

LUKS Removing passphrase done.

Releasing /dev/loop0... Done.

Support

Development

Build and debug

docker build --tag theanurin/luksoid --file docker/Dockerfile . 

Tag summary

Content type

Image

Digest

sha256:285b9e6e9

Size

7.1 MB

Last updated

about 19 hours ago

docker pull theanurin/luksoid