Brian Lewis | 24 Jun 2010 19:31
Favicon

ElGamal, EME-PKCS1-v1_5


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?

Thank you.

Marko Kreen | 24 Jun 2010 21:52
Picon

Re: ElGamal, EME-PKCS1-v1_5


On 6/24/10, Brian Lewis <brian <at> 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

--

-- 
marko

Brian Lewis | 24 Jun 2010 22:10
Favicon

Re: ElGamal, EME-PKCS1-v1_5


On Thursday, 24.06.10 at 22:52, Marko Kreen wrote:
> On 6/24/10, Brian Lewis <brian <at> 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?

Daniel A. Nagy | 24 Jun 2010 23:17

Re: ElGamal, EME-PKCS1-v1_5

Hello,

Brian Lewis wrote:
> 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?

You should use the length of ElGamal p.

--

-- 
Daniel


Gmane