-->

Openssl : What does RSA n e d p q parameters repre

2020-07-24 04:49发布

问题:

What are the parameters n, e, d, p, q represent in below RSA structure for openssl ?

struct rsa_st
    {
    /* The first parameter is used to pickup errors where
     * this is passed instead of aEVP_PKEY, it is set to 0 */
    int pad;
    long version;
    const RSA_METHOD *meth;
    /* functional reference if 'meth' is ENGINE-provided */
    ENGINE *engine;
    BIGNUM *n;
    BIGNUM *e;
    BIGNUM *d;
    BIGNUM *p;
    BIGNUM *q;
    BIGNUM *dmp1;
    BIGNUM *dmq1;
    BIGNUM *iqmp;
    /* be careful using this if the RSA structure is shared */
    CRYPTO_EX_DATA ex_data;
    int references;
    int flags;

    /* Used to cache montgomery values */
    BN_MONT_CTX *_method_mod_n;
    BN_MONT_CTX *_method_mod_p;
    BN_MONT_CTX *_method_mod_q;

    /* all BIGNUM values are actually in the following data, if it is not
     * NULL */
    char *bignum_data;
    BN_BLINDING *blinding;
    BN_BLINDING *mt_blinding;
    };

回答1:

as you can see from the openssl official page, their numbers with specific roles in calculating the ciphertext, OpenSSL official documentation

I suggest you to take a gander at it, Bye!

EDIT 2018-07-27: update url Linuxatico



回答2:

These are the parameters for the RSA algorithm:

p and q are two large prime numbers, and n is computed by p*q. e is the public exponent, d is the multiplicative inverse of e mod (p-1)(q-1).

The private key is the pair (p, q). The public key is the pair (n, e)

You can learn more about it here.



回答3:

In Linux, man 3 rsa will give you a detailed explanation.