[CFRG] Re: I-D Action: draft-irtf-cfrg-rsa-guidance-01.txt

Alicja Kario <hkario@redhat.com> Fri, 06 September 2024 10:59 UTC

Return-Path: <hkario@redhat.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CCD04C14F69A for <cfrg@ietfa.amsl.com>; Fri, 6 Sep 2024 03:59:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.253
X-Spam-Level:
X-Spam-Status: No, score=-2.253 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YDHZaTMsCtw5 for <cfrg@ietfa.amsl.com>; Fri, 6 Sep 2024 03:59:38 -0700 (PDT)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3FC11C151547 for <cfrg@ietf.org>; Fri, 6 Sep 2024 03:59:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725620377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xcQgZiM1p+9XdxLwMYejorRC7VdCq/jMzeFd/ymIkFc=; b=U5tHs++HQUqA/pE6KdNuXpsuB7i2pq0roBQ3f2ckYax+btDPSh5vjLZIdWUE5GzTzqmaRW 2kuM9xRjhyWUBPr6fN9ttfTU9+UQPX6RtbyFAeUeBNcZ6QpY2UdJKuwCVjnMs4KmJti6ss Db6PfQYBLZo4SG4qSiWZKqQWot/88Rk=
Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-JDWBLI2aPhyFd-7udaaA0g-1; Fri, 06 Sep 2024 06:59:36 -0400
X-MC-Unique: JDWBLI2aPhyFd-7udaaA0g-1
Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42c881282cfso15560665e9.2 for <cfrg@ietf.org>; Fri, 06 Sep 2024 03:59:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725620375; x=1726225175; h=content-transfer-encoding:user-agent:organization:references :in-reply-to:message-id:mime-version:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9yi3dsmg1SKNhLeDy070wG2EVea/1FPQVlb5ctuocPY=; b=Nu2u8wgBLNAe59syVe7MnnwwkPCBtzLBo+CwPTMSM7A/Wgqxaop6eF1Z/JR04bi7j/ r23vqsOFr8alNzasWEr3+KEmwJSlfJ3sTBhQfoHVmr4n+JmhEpMtciwuuTro97VYAWTk vt8aUKm/3JsU9/kGn36BrbFT6yx2wadSlfn4L6T9stdXi4ibsKB76bgzBenOYAFDTbsf oimX84uWoBdihNWcinguEIm3mY2uKLavvsceKHA5XYVSI7nKYQ+KmASwF+IVlfJsavra bBpaTS4vNHe+0c7fe599HULgT8Nxwsiwsu2zk/gghVmLqNaJhgOD+WK5q6qHnBGBgiLs BgCw==
X-Forwarded-Encrypted: i=1; AJvYcCVgLDpso91/p2hH7qzba0V5zsk6VGNEQjp8UgZ4M+WAMQUKqlgVIrvPAEXzVRbcwGIGtBtX@ietf.org
X-Gm-Message-State: AOJu0YzUnqJUtELQhIp5hXT+9ov/H+01nXoZunGJqMPxhVGRi7S9J4Rn xyaqlH1ULMzAXswGkAxCuS7PVJj/9BQv7KpWr9LWCQb8bn0sapOv5vZ9KRG8elS+0cLXZsU6ZxR nz23dpJaynJdiR99CJ7WbtGtSWfcVyDx628w311rjMDuPueJrRw==
X-Received: by 2002:a05:600c:3ca7:b0:428:f0c2:ef4a with SMTP id 5b1f17b1804b1-42c9f97caa0mr16468815e9.13.1725620374772; Fri, 06 Sep 2024 03:59:34 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IFBEEVna+Rdh5iz40ZtlwEWRwoJKvow4j6orRlHIItYLPX8pj2skO0nDgC3tTQ5WGeU3in38w==
X-Received: by 2002:a05:600c:3ca7:b0:428:f0c2:ef4a with SMTP id 5b1f17b1804b1-42c9f97caa0mr16468555e9.13.1725620374210; Fri, 06 Sep 2024 03:59:34 -0700 (PDT)
Received: from localhost (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca05c2845sm16846555e9.3.2024.09.06.03.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 03:59:30 -0700 (PDT)
From: Alicja Kario <hkario@redhat.com>
To: Phillip Hallam-Baker <phill@hallambaker.com>
Date: Fri, 06 Sep 2024 12:59:27 +0200
MIME-Version: 1.0
Message-ID: <797525b3-7d8e-4c5f-8532-78894c32ff7c@redhat.com>
In-Reply-To: <CAMm+Lwikkoc=kRp_yZbYzPb4sNfwwtXfNPrf9TCsFEJ8wCD+xA@mail.gmail.com>
References: <172538719711.1420249.4393971363081609427@dt-datatracker-68b7b78cf9-q8rsp> <02e9a51e-b938-49f2-b832-de4d3ec575ee@redhat.com> <CAMm+Lwh3DwF1GA=WUMEsXZ-Ho__AKB6R-kfkxF9=pRZxn3jZBw@mail.gmail.com> <dad51c80-4eb6-423a-af8f-9a99c86377be@redhat.com> <CAMm+Lwikkoc=kRp_yZbYzPb4sNfwwtXfNPrf9TCsFEJ8wCD+xA@mail.gmail.com>
Organization: Red Hat
User-Agent: Trojita/0.7-git; Qt/5.15.13; xcb; Linux; Fedora release 39 (Thirty Nine)
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: 6QGO2YYWA3QGXCKBU53USCPSA6XTLIRZ
X-Message-ID-Hash: 6QGO2YYWA3QGXCKBU53USCPSA6XTLIRZ
X-MailFrom: hkario@redhat.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: internet-drafts@ietf.org, i-d-announce@ietf.org, cfrg@ietf.org
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [CFRG] Re: I-D Action: draft-irtf-cfrg-rsa-guidance-01.txt
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/PhKwt4KMasmFrHS87QRAz28PJHc>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Owner: <mailto:cfrg-owner@irtf.org>
List-Post: <mailto:cfrg@irtf.org>
List-Subscribe: <mailto:cfrg-join@irtf.org>
List-Unsubscribe: <mailto:cfrg-leave@irtf.org>

On Friday, 6 September 2024 07:29:42 CEST, Phillip Hallam-Baker wrote:
> On Thu, Sep 5, 2024 at 2:03 PM Alicja Kario <hkario@redhat.com> wrote:
> On Thursday, 5 September 2024 19:21:39 CEST, Phillip Hallam-Baker wrote:
>> Very interesting. RSA will be with us for a long time...
>>
>> Have you considered key generation? Just adding a reference to 
>> FIPS 185-5 might be enough. I am currently trying to decide 
>> whether probabilistic or provable primes are the way to go. I 
>> have also noticed that keygen on my state of the art 2023 
>> machine is taking almost as long as it used to take in 1990. 
>> That is because we are using longer keys and we are doing a lot 
>> more checks - the auxiliary primes.
>
> RSA key generation is a very rare occurance, so it's easier to just
> do it offline, on a trusted system, than to work to make it side
> channel safe. So, no, I consider it out of scope.
>
> RSA is vulnerable to kleptography attacks.
>
> If we are going to do the job, we should do it right. 
> Kleptography is a real world attack.
>
> If you want to create a malicious HSM, you use the following:
>
> p1 = number(seed)
> p = nextPrime (p1)
> m1 = BytesToBigNum   (Encrypt (p, traitorKey)  + random)
>
> q1 = m1/p
> q = nextPrime (q1)
>
> Moti Yung is credited with the public discovery of this but 
> there is reason to believe it has been used in the wild.
>
> Having thought through the process of storing ML-DSA seeds, I 
> am convinced that storing the seed rather than the expanded key 
> is the correct move for security grounds even if the keys were 
> not gienormous. Giving the expanded key is an invitation to 
> kleptographic malice.
>
> RSA is no different, specifying the seed and a strong key 
> derivation mechanism offers superior security.

So the solution to protecting against backdoored systems, where
the attacker has a control over the rendom number generator, is
to use the output from the random number generator directly 
to deterministially generate the whole private key?
-- 
Regards,
Alicja (nee Hubert) Kario
Principal Quality Engineer, RHEL Crypto team
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 115, 612 00, Brno, Czech Republic