LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-14-2015, 01:19 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
Encrypt/Decrypt filesystem when booting/shutting down?


Essentially, I have Slackware 14.1 as my server OS. I do not keep anything mission critical or super secret/important but I like following/learning neat security practices just for the hell of it. I do not mind/don't really want the files to be encrypted/decrypted on the fly as that might hamper performance (I like to run video game servers on here and want the best performance possible) but I would like something that leaves the disks/filesystems encrypted when shutting down the computer, then decrypts when its time to boot up. (Although if the system is improperly shutdown....I guess the encryption would never happen...)

Is there such a solution available for Slackware?

One bad thing I just noticed about what I want is that if something ever happens to the OS in which I need to use a LiveCD or something, I would be stuck as everything is encrypted?
 
Old 08-14-2015, 03:27 PM   #2
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
The last time I used luks and dm-crypt, it was on a 733 MHz Coppermine Pentium III lappie... and the performance hit on that box was unnoticeable, less than 1 percent.

You are NOT going to notice any performance hit at all, unless you keep the crazy notion of encrypting gigabytes of storage in one big hit when you shut down, and decrypting gigabytes of storage in one big hit when you start up.

And another thing: where are you going to keep all the plaintext that you decrypted at startup? On the disk, where, like you said anyone will be able to read it just by cutting the power?

Just do it the same way everybody else does.

Last edited by 55020; 08-14-2015 at 03:28 PM.
 
Old 08-14-2015, 04:59 PM   #3
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Check out the documentation on the subject on the Slackware installation media (boot disk) or at one of the mirrors where you download Slackware.
Code:
README_CRYPT.TXT
There are also other helpful README files there.

I was able to build a fully encrypted system (except /boot) with RAID just following the information found there and reading the relevant man pages.

There is probably other helpful information on this at docs.slackware.com.

With LUKS the encryption is self contained on the encrypted disk/partition so you can recover by unlocking the partition and mounting the file system elsewhere (where LUKS is supported). You should try this to prove it to yourself that it works.

EDIT: Depending upon the version of Slackware you are using, the mkinitrd command may require the -L (lvm) option even if you are not using the volume manager. Since I use both RAID and LUKS together I don't remember if this was required for RAID or for LUKS.

Last edited by TracyTiger; 08-14-2015 at 05:31 PM. Reason: Remembered mkinitrd -L issue
 
1 members found this post helpful.
Old 08-14-2015, 05:11 PM   #4
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Altiris View Post
(Although if the system is improperly shutdown....I guess the encryption would never happen...)
Explaining differently what 55020 wrote ...
If you use LUKS the data on an encrypted partition remains always encrypted on the disk. The data is always encrypted when written to the disk and decrypted when read.

There is no mass encryption/decryption on startup/shutdown.
 
Old 08-15-2015, 02:44 AM   #5
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
A lot of "recent" (last four years or so) CPUs has AES instruction set built in, reducing the miniscule performance hit even further. Run `grep -w aes /proc/cpuinfo` to see if your CPU has AES support.
 
Old 08-17-2015, 05:08 PM   #6
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 974

Rep: Reputation: 238Reputation: 238Reputation: 238
Hi, I don't want to hijack this thread but... after looking at the mentioned documentation, many things are not clear to me, being a newbie to encryption...

What is peoples experience with using encryption on:
1) GPT-formatted discs with an EFI/elilo set-up? Would the /boot/efi partition be the one to store the non-encrypted stuff?
2) on a set-up where / is divided over several discs/partitions (say to prevent /tmp or /var/log overflowing the disc-space or to keep them separate on the data hdd and away from the SSD that contains the rest of the distribution)
3) where institutions require, for Windows systems, the use of a TPM (Trusted Platform Module) chip to enable hardware encryption. Would complete-disc encryption via LVM + LUKS be sufficient?
4) in the case of very large data-files (>10 GB) that are analysed by means of a couple of python-scripts, would encryption markedly slow this down (say on a i7 processor that has aes built in and with 16GB RAM available) or not?
5) would using described disc-encryption make things easier when one has been using TrueCrypt before (and ending up deleting all these sections because access failed for some reason or another)

Could one cover these scenarios with a LVM + LUKS set up?

Last edited by brobr; 08-17-2015 at 05:13 PM.
 
Old 08-17-2015, 11:08 PM   #7
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by brobr View Post
Could one cover these scenarios with a LVM + LUKS set up?
Quote:
2) on a set-up where / is divided over several discs/partitions (say to prevent /tmp or /var/log overflowing the disc-space or to keep them separate on the data hdd and away from the SSD that contains the rest of the distribution)
You can slice & dice the disks/partitions/volumes almost anyway you want regarding encryption. I have some encrypted systems with only 3 partitions (root boot & swap) and one fully encrypted server that has a dozen different file systems mounted. Some systems have hard disks, some SSD, and some both. Most have RAID.

I've previously used LVM with encryption but I'm not currently using LVM so I may have forgotten some important LVM limitations regarding encryption.

Quote:
4) in the case of very large data-files (>10 GB) that are analysed by means of a couple of python-scripts, would encryption markedly slow this down (say on a i7 processor that has aes built in and with 16GB RAM available) or not?
Speed/Performance is, of course, relative. On my daily use system I have a 45GB file (in an encrypted partition) that acts as the complete file system for MSWIN7 in VirtualBox. The disk access performance is fine for me for programs I run interactively on it. (Note that 45GB is tight. I should have bought a larger SSD to accommodate a larger VirtualBox "disk".) The main performance hit is not the encryption, but in using a file that pretends to be a file system.

I usually suggest that people test their application & measure the performance for themselves instead of guessing. I think that you'll find that performance loss due to encryption/decryption for most applications is barely measurable.

Quote:
5) would using described disc-encryption make things easier when one has been using TrueCrypt before (and ending up deleting all these sections because access failed for some reason or another)
I don't have any experience with TrueCrypt so I can't compare with LUKS. For my limited use of computers (half of which run 24/7), I've not had any problems with LUKS encryption. {typing quietly so the nearby computers don't notice}

With LUKS you need to backup the LUKS Header in case the originals become corrupted. You can assure that you will never be able to access data on a LUKS encrypted disk by just simply "overwriting header and key-slot area" (from cryptsetup man page). I also store decrypted backups of the data in multiple bank safe deposit boxes.

It's funny that I used to do just the opposite. A couple of decades ago, before all this Internet hocus pocus, the locally-accessed server disk files were unencrypted but the offsite storage backup tapes in locked & security sealed metal cases were encrypted.

-----------

It's easy to experiment. Just create one or more expendable partitions, secure with LUKS, add filesystems/volumes and experiment. Deal with full system encryption later.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to encrypt / decrypt passwords in a file vicosobase Linux - Newbie 3 08-14-2012 03:07 PM
encrypt/decrypt from linux console ReshmiS Linux - Newbie 3 02-09-2010 01:00 AM
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 09:16 AM
How to use kgpg to encrypt and decrypt emails? ginda Linux - Security 6 03-16-2005 09:42 PM
2048-bit encrypt/decrypt help Nappa Slackware 1 11-20-2003 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration