Take the 2-minute tour ×

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;
share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

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!


share|improve this answer
I forgot there's also this: RFC 3447 –  linuxatico May 9 '12 at 8:27
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer


