From owner-freebsd-security@FreeBSD.ORG Fri Dec 16 19:19:36 2005 Return-Path: X-Original-To: freebsd-security@freebsd.org Delivered-To: freebsd-security@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33B1816A41F for ; Fri, 16 Dec 2005 19:19:36 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB11443D5D for ; Fri, 16 Dec 2005 19:19:29 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A92FE52C39; Fri, 16 Dec 2005 20:19:25 +0100 (CET) Received: from localhost (dkc150.neoplus.adsl.tpnet.pl [83.24.6.150]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 77F8550F93; Fri, 16 Dec 2005 20:19:18 +0100 (CET) Date: Fri, 16 Dec 2005 20:18:28 +0100 From: Pawel Jakub Dawidek To: Robert Blacquiere Message-ID: <20051216191828.GA56737@garage.freebsd.pl> References: <20051211123346.GK98018@bombur.guldan.demon.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: <20051211123346.GK98018@bombur.guldan.demon.nl> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r535 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-security Subject: Re: geli or gbde encryption of slices X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 19:19:36 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 11, 2005 at 01:33:46PM +0100, Robert Blacquiere wrote: +> Hello, +>=20 +> I was playing around with geli an gbde after last EuroBSDCon.=20 +> I liked the idea of encrypting my data which resides in /home/$user. +> Since this is a "single" user laptop i intended to encrypt the +> whole /home partition. Well no problems with that. But i wanted +> the lockfile or keyfile on a seperate usb disc. Which would be +> mounted or used during boot of the system. I also used gshsec on +> the usb disc to even make things more difficult.=20 +>=20 +> Well here is what i found. You can't use a none mounted disc for=20 +> the keys, to take things further geli asks for the access passphrease +> before any filesystems except / is mounted. Gbde fails also because +> the system can't do interactivaly query for the passphrase.=20 Unfortunately we needed to make a choice here: allow to encrypt /usr/, etc. or allow for getting keys from more sources. You can still do what you want, but not via rc.d/geli directly. Geli(8) itself allows to use key from the raw device or anything else, rc.d/geli is the thing which is not such flexible. You may want to try adding some code to /etc/rc.local (which will take part of the key from passphrase, part from USB Pen Drive and part for gshsec(8) device): (cat /mnt/pendrive/keyfile.bin && dd if=3D/dev/shsec/key bs=3D64k count=3D= 1) | /sbin/geli attach -k /dev/stdin /dev/ad0s1e fsck_ffs -p /dev/ad0s1e.eli mount /dev/ad0s1e.eli /mnt/secure Assuming that /mnt/pendrive is already mounted (it should be if placed in /etc/fstab). +> I wanted to use a 3 way authentication for the slice, encrypted fs,=20 +> a usb key and passphrase. I can use geli without the usb key (keyfile). +> But that would render a possible bruteforce entry.=20 Even when you use passphrase only, geli(8) provides PKCS#5v2 to strength it. I'm using it with 131072 iterations, so it is 2^17 times harder to brute-force my passphrase and takes about 2-3 seconds to attach encrypted device on my laptop. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDoxMEForvXbEpPzQRAkS8AJ9kLdnFesPmZoQDCpCbAkcVBkr0WgCfV5b5 UM3hSEIKge0RIQ4KAPzF5WU= =FcDF -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+--