Dear all:
I have some questions about DH in crypto
1. can we assign different generator in DH, since the default is 2, 3 or 5.
2. the p is randomly generated from BN_generate_prime_ex in
dh_buildtin_genparams.
   if I have a p already, can I directly pass to DH*ret instead of
randomly generating it?

3. if the answers of above are no, can I use RSA as replacement, since
in Rsa_test.c, I see we directly assign all the prime we need.
    in RSA, C ≡ M^e mod n and in Diffie-Hellman, X= g^x (mod p).
it seems what I only have to do is replacing M as g, n as p, and
generate a random number x, right?

4. in rsa_test.c, we use        num = RSA_public_encrypt(plen, ptext_ex, ctext, 
key,
                                 RSA_PKCS1_PADDING);
     to do the encryption.
But each time I run the program with key1, the content of ctext is different.
In the program, we set p,n,e, and ptext is the same. Why I got
different ctext each time?
appreciate your help,
miloody
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to