Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.125.188.123 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796310475; b=ElSW2vVaYsHVbAfP+Vt12vNnm82V1HnPVBToxqAeRjlLFnNOPQNxx7cZGfvWTUg/1s3t cy2KC7/ZeVZepFI3aOeYXu7UgaOUrPcSetGmCxRt0fTaYRKRQAHGtOS0ttLPUU314W4Uu yXqxwOMNMuHSKxPVlWxIHzrIswm2SvMP7NBWBIC4S5J9eQstylV/UaftV58/rvwKs8Y/S 3JDCGzDkyhKpxKPD8d9ez8ZPjyZfbyAsDSSKGDx1/2Z79E5FPbHU+n61BwjUZXpLC4xhm I5zOmBavzlYqKi4XKE25keWWUNyfO/JUfB8IhpPMYKx4ijQyK9hEZJkhBhU7idZZLfA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796310475; h=DMARC-Filter:Received:DKIM-Signature:Received: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: References:Content-Language:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=5Tqd/fgFtJXyo4K0DU5VMfJC1HKWcLcDPaJmZS1J30o=; b=0Db1/6SNMBK+VcDyWHI0lc8rIoLXzyyHkTvruwfNvxWl/XAEGh5Mg+k+7Rs/VNZ0x1GA T/21Z2uUx0yInIyo4VlmzZ3xNfckob7oyJ54a3x/c5Vhv1uLKo8M41Ln9YlComd19mNnI BHJmSQS4ZzSfF2sJ9RP6ciTs9ga8pI8IMhD9w4nTjmDCpgqwgNBZrHSKPFbvHVaLgTFUv YrHAmOCZOCg67VcCozK1jUHMbqGYGQe3xxGp9TVZG2hNivYjLCXXzJyCp5CynXfS1pirZ 3fRxqK4rYMrhLAVu+k+39wMKCKgid2UEIa8n4SjfvfN+I4fWfQMUUEcY/s3kaZL9YjA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20251003 header.b=ZFezNU3D; arc=none smtp.remote-ip=185.125.188.123 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E77606A322 for ; Thu, 3 Dec 2026 15:07:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 32E77606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key, unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20251003 header.b=ZFezNU3D Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 63AC83F7C4 for ; Thu, 3 Dec 2026 15:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20251003; t=1796310472; bh=5Tqd/fgFtJXyo4K0DU5VMfJC1HKWcLcDPaJmZS1J30o=; h=Message-ID:Date:MIME-Version:Subject:References:From:To: In-Reply-To:Content-Type; b=ZFezNU3DJID84SEGSXpIuY9Dyo3E/kEZC70RL3byy2v33UQhjx60JPFw6JS8TuQCr EqHL9XPcRCDm5tJ7C1FuweyjluPsLPPEDnjOeHIC/b01zEbIEYAaRnGzfnFgsKeV6S uBsZTdnl7ArrN9PkgQs1SRopZtka59L06HQJxCcOwDdqE7tpYDXrpCEKGwDLcDoFor vfOJieJGaEh8aFYJA4e0S0PyLoZDlUD1SN/c/XhSon4/UeJZBbqdtMjbMgVzk6uZkY DmdhdS6fRy543vIByat2Xr74UIGbDqNfqI+5XbYV7bgh03JpCTlfTlnFlD3Sm0K33/ v/qdeCqjfh6PQiulVSY1NIEHp2hN79ir1L9Dro56+rG5Xfkv6NbSJ3f9ElzioRyo+l AlULsUn21ubk2+oc963AvTqOPa8q6waMKpNnjVhVu8rb3gdvsG+bOupj8OaUgb0YMl NzzowNEBUEKwaHH1GBDKB1M6c3Ud+HPQVzxBUPGt8e63I1GvomqZobAsSUMhceDy1i VHdtGWMg2yYVQQhYxcUpezQban85hWDXmXbiHuBzFHlk6eeosJk3MiKy2Fum3uffJ0 pubKjkyllqmUaeDvxiQwmuTU2RNE/iHMjDNdNvFnz+vrc5Cjm1SONr32OuwUE72EYh ZBxQAI25/+/QyViK2uLl+KN4= Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4ad3d35e899so117625085e9.1 for ; Thu, 03 Dec 2026 07:07:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796310471; x=1796915271; h=content-transfer-encoding:content-type:in-reply-to:to:from :content-language:references:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5Tqd/fgFtJXyo4K0DU5VMfJC1HKWcLcDPaJmZS1J30o=; b=NrMehaVYwqIH5kppQ46HPyHkl4smwwwRO3XDeZIWI1NnFjkYFq80wU/hho6I8AdF+F MsJMMloVFqdJ6107xCp5kefnNzWSCWfYyCUjTwTNWrzk4YeZQkSHGJyB3Hz5mAf0XJ3s IRU7JkD5YiY8XBFDKCTVosU87IvLYE5MnYqcN9v3ihO5jwnqwHbbQwfs7Z4K4S1EZngd y78PqEaBGNgwUM9aylaGrrmAts85jYdEsSTfMRMaZIeAuSUMZp9fc9w5IruOhGiOR8bm e6lHscrGhJCxjZWkpBcw8zm8JRj/vf/QfwpkubKcS/dLpTcXKUw9QMboPvkV/LK+ahKH eMlw== X-Gm-Message-State: APuU4Z9m/2gvoTbUztRU/HAazgqhaM4eLG2RbHv8eXz0h/GEaRx/xSSI yQXqJQ2NbfCd63vr9x01pXjACWNIG5d0LjGSs0zMhgHPNlRY04Jh9Ge3lhTaXoCW6+QvXXpr2uC wIx2XUvX2OruPBhVNmSgDuVPqcOA1kKyKoXUsSd8N0bPXTw23vXD486X/l2zsRYgC6PS2ptf5Wp 9YgENEFIAleWk= X-Gm-Gg: AZFdTZfipU9efoQt5KAw9FY16q/A8NZBjgWKXbey2QiXo2nmOOUui8VJ7sfHVVvZHIx 351Kr1xGUfz61078iVspax7+9xJa7r4IO/XSOqJxOeQWTVMziOLYBfi7NjZi0Iqe8xxNQPab0QA v9noH40nl7BcBi5vijgwnHCECYoAVy341C/oW0d7H2h5s39Fw1HeIQ0p30wmN7hd6Pu2Sws3cge MnDlsWaZRuZ58suXlQlenRTnOVel8jmM34yv/+OzJkUjGJYhwYL0qr7cAQXz6GEj7PierNiy2+a 2NtZg1W3lQB8FDSj7KbZkxmbFpQ6ngPM5Pl6F7WtCcAUkR/topbaG98iLDRCB0OBs5AEzL4AK78 7THTHFn0+IhuwhyJ+20PDiRXVpJTJDcI6xRPYfp3mte3syTS3rOZgoeE9l3u7K1Rpl0d2m1BBjF oDWAh3bL8Kb3YXqk0JW4OgiZmLhtROYaFZ4Tw= X-Received: by 2002:a05:600c:8210:b0:4a1:dbdf:17a8 with SMTP id 5b1f17b1804b1-4bb887e25e8mr844001175e9.2.1796310471243; Thu, 03 Dec 2026 07:07:51 -0800 (PST) X-Received: by 2002:a05:600c:8210:b0:4a1:dbdf:17a8 with SMTP id 5b1f17b1804b1-4bb887e25e8mr844000635e9.2.1796310470841; Thu, 03 Dec 2026 07:07:50 -0800 (PST) Received: from ?IPV6:2a01:cb19:8f4f:fc00:9610:5aff:fe79:92f7? ([2a01:cb19:8f4f:fc00:9610:5aff:fe79:92f7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe0032c77sm88599425e9.2.2026.12.03.07.07.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 07:07:50 -0800 (PST) Message-ID: <5963a6a1-db5e-401b-a689-dae43ae78584@canonical.com> Date: Thu, 3 Dec 2026 16:07:49 +0100 X-Mailing-List: cryptsetup@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: reencryption with multi keyslots in batch mode References: Content-Language: en-US From: Frederic Hoerni To: cryptsetup@lists.linux.dev, Ondrej Kozina In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I'm answering on the mailing list to Ondrej's comment on my merge request: https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/958#note_4366192260 as the format might be more suitable here. Ondrej wrote: > Wouldn't it be easier to run the reencryption against a single LUKS2 > keyslot — cryptsetup reencrypt -S /dev/device — > and re-create the additional keyslots once the operation has finished? > Is there a particular use case I'm missing that genuinely requires > multiple LUKS2 keyslots to stay active for the duration of the > reencryption? There are some use cases where re-creating keyslots after re-encryption can be an issue. Use case 1: Volumes with keyslots held by different parties, typically the user's own passphrase, and a recovery key held by an organization's escrow. If re-encryption needs to drop the organization's recovery key first, then the process of adding it back after re-encryption can add extra work for the user, and a gap in availability. Use case 2: Unattended re-encryption on remote servers, with a passphrase sealed with a TPM and a recovery key. If the TPM-backed keyslot is dropped before re-encryption, any power outage during that time would require human attendance and would cause unavailability. We would like to support these use cases in Ubuntu, where we have a middleware that calls cryptsetup, and the user in not directly using cryptsetup. > [...] we can discuss a different approach — most likely built around a > repeatable --key-file option, which is already supported (in tcrypt > type). I agree that my initial patch might not be very elegant and we can do better. I'll be happy to rework the patch and follow your directions. I'm also thinking of another way to achieve the same feature with possibly less modifications and that would benefit to more than just re-encryption: add a kind of --key-encoding base64|hex option, where the keys are provided in base64 (or hex) and cryptsetup would unwrap them to the binary value. This would work well with newline-separated passphrases, which are already well supported. Kind regards, Frederic