From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.saout.de (Postfix) with ESMTP for ; Wed, 2 Dec 2009 15:29:56 +0100 (CET) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2ETtYA018367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 09:29:55 -0500 Received: from [10.34.32.183] (mazybook.englab.brq.redhat.com [10.34.32.183]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB2ETsbX021934 for ; Wed, 2 Dec 2009 09:29:55 -0500 Message-ID: <4B1679E2.7090902@redhat.com> Date: Wed, 02 Dec 2009 15:29:54 +0100 From: Milan Broz MIME-Version: 1.0 References: <0954E174030B6244A7ECC2EC68CFD97E023F8972@EDCEXMAIL03.eu.trendnet.org> <20091202122036.GB1643@tansi.org> <0954E174030B6244A7ECC2EC68CFD97E023F8A62@EDCEXMAIL03.eu.trendnet.org> In-Reply-To: <0954E174030B6244A7ECC2EC68CFD97E023F8A62@EDCEXMAIL03.eu.trendnet.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] Mechanics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 12/02/2009 02:51 PM, julie_nuckey@trendmicro.co.uk wrote: > I really want to know if it possible for the password/key to be exposed in the process > of transferring it from user mode to kernel mode, or if it could remain in memory as > a result, that's why I'm asking about the mechanics of what happens between cryptsetup > (user mode) and dm-crypt (kernel mode). - passphrase (or password) is processed only in userspace, never sent in open form to kernel - all communication (configuration) of dm-crypt device (the mapped keyslot is temporary dmcrypt device also) is through dm-ioctl calls - you must provide key (part of mapping table) in this call in text format (see "dmsetup table --showkeys) for dm-crypt to configure requested crypto mapping that key is basically (simplified) 1) hashed passphrase in plain mode or 2) LUKS PKBKDF2 derived key for mapping keyslot area (for temporary keyslot device) or 3) master key for real LUKS device mapping (read and un-obfuscated from keyslot area) Just to add: - only root can use dm-ioctl and only root can use cryptsetup for these operations - cryptsetup locks its memory to prevent swapping sensitive data - all sensitive data are erased before returning memory (both in kernel and userspace) > In "plain" mode the password must be passed to the kernel, Not exactly. It is hashed passphrase sent to kernel dm-crypt. > but in LUKS mode, the > password is used to decrypt the master key which is in the kernel. If cryptsetup is > user mode only, what exactly does the kernel mode decryption of the master key? Can't > be dm-crypt as this doesn't know anything about LUKS. cryptsetup (userspace) creates temporary dm-crypt mapping over keyslot area with derived key generated from passphrase (see above), then read this new dm-crypt device to get data (and applies AF over it to get master key candidate) Please read the LUKS documentation and source for exact description (and archive of this list) http://code.google.com/p/cryptsetup/wiki/Specification Milan -- mbroz@redhat.com