Hello,
> Last year, you wrote that 
> If you add to server initialization routine something like:
> >       RSA *rsa;
> >       rsa=RSA_generate_key(512,RSA_F4,NULL,NULL);
> >       if (!SSL_CTX_set_tmp_rsa(SSL_context,rsa)){
> >               ExitPostmaster(1);
> >       }
> >       RSA_free(rsa);
If I remember correctly this initialization was performed to use
export restricted algorithms.
If RSA ephemeral key is set, then this key is used for key
exchange (encryption of client generated pre_master_secret, in this
case RSA 512 bits long). And your certified RSA key is used for signing.
In this case you may have 2048 RSA key (certified) and use export
restricted algorithms (up to 512 RSA key for encryption).

> So this routine is only called  one time ???
Yes.

> Cost ??
RSA key generation is not such time-consuming in the comparision
to DH (for example).

> So FOR ALL OF THE
> SESSION, THE SAME temp rsa above is used to  encrypted the
> pre_master_secret  from client to server and decrypted.
All SSL object created from this SSL_context inherits this
ephemeral key.

>  But because of
> pre_master_secret, client_random and server_random are different for
> each sessions, so the symmetric encryption is different for each
> session. Is this correctly what I am thinking ?? 
Yes.

> How about
> RSA_generate_key(1024,RSA_F4,NULL,NULL) ??
2048 is better.

RSA ephemeral key gives you forward secrecy, when this key is cleared
(for example when application exits) past session (recorded for example)
can not be decrypted because there is no RSA key.
When you use your certified RSA key and when this key is compromised
all previous session may be decrypted (I mean: session with key exchange
using this, compromised RSA key).

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to