Re: ElGamal, EME-PKCS1-v1_5

Brian Lewis <brian@monetra.com> Thu, 24 June 2010 20:08 UTC

Received: from hoffman.proper.com (localhost [127.0.0.1]) by hoffman.proper.com (8.14.4/8.14.3) with ESMTP id o5OK8tvi090410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jun 2010 13:08:55 -0700 (MST) (envelope-from owner-ietf-openpgp@mail.imc.org)
Received: (from majordom@localhost) by hoffman.proper.com (8.14.4/8.13.5/Submit) id o5OK8tU6090409; Thu, 24 Jun 2010 13:08:55 -0700 (MST) (envelope-from owner-ietf-openpgp@mail.imc.org)
X-Authentication-Warning: hoffman.proper.com: majordom set sender to owner-ietf-openpgp@mail.imc.org using -f
Received: from mail.mainstreetsoftworks.com (mail.mainstreetsoftworks.com [216.155.111.4]) by hoffman.proper.com (8.14.4/8.14.3) with ESMTP id o5OK8sW1090402 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for <ietf-openpgp@imc.org>; Thu, 24 Jun 2010 13:08:55 -0700 (MST) (envelope-from brian@monetra.com)
Received: from localhost (shop.monetra.com [216.155.101.90]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mainstreetsoftworks.com (Postfix) with ESMTPSA id A9E1584402F; Thu, 24 Jun 2010 16:08:47 -0400 (EDT)
Date: Thu, 24 Jun 2010 16:10:26 -0400
From: Brian Lewis <brian@monetra.com>
To: Marko Kreen <markokr@gmail.com>
Cc: ietf-openpgp@imc.org
Subject: Re: ElGamal, EME-PKCS1-v1_5
Message-ID: <20100624201026.GL25604@brian.internal.monetra.com>
References: <20100624173119.GJ25604@brian.internal.monetra.com> <AANLkTilyE2RAaXxa2sfKgzY0xiGM6Y-5budUOJbTkdwd@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <AANLkTilyE2RAaXxa2sfKgzY0xiGM6Y-5budUOJbTkdwd@mail.gmail.com>
X-monetra-com-MailScanner-Information: Please contact the ISP for more information
X-monetra-com-MailScanner-ID: A9E1584402F.A3E16
X-monetra-com-MailScanner: Found to be clean
X-monetra-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-8.899, required 4.7, ALL_TRUSTED -1.80, BAYES_00 -2.60, USER_IN_WHITELIST -4.50)
X-monetra-com-MailScanner-From: brian@monetra.com
X-Spam-Status: No
Sender: owner-ietf-openpgp@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-openpgp/mail-archive/>
List-Unsubscribe: <mailto:ietf-openpgp-request@imc.org?body=unsubscribe>
List-ID: <ietf-openpgp.imc.org>

On Thursday, 24.06.10 at 22:52, Marko Kreen wrote:
> On 6/24/10, Brian Lewis <brian@monetra.com> wrote:
> >  I'm trying to generate a tag 1 (public-key encrypted session key)
> >  packet.
> >
> >  I'm using ElGamal, so the algorithm-specific fields are, according to
> >  http://tools.ietf.org/html/rfc4880#section-5.1,
> >  MPI g**k mod p
> >  MPI m * y**k mod p
> >
> >  So I need m = EME-PKCS1-v1_5(...). According to
> >  http://tools.ietf.org/html/rfc3447#section-7.2.1, PS is k - mLen
> >  - 3 random nonzero bytes, where k is the length of RSA n in bytes. But I
> >  don't have RSA n. I have ElGamal p, g, and y.
> >
> >  In EME-PKCS1-v1_5, what is k if I'm using ElGamal?
>
> mod p ~ mod n

I don't understand. Could you elaborate?