In RSA for p = 5 and q = 11 find out public key and private key from given p and q

Improve Article

Save Article

RSA algorithm is an asymmetric cryptography algorithm which means, there should be two keys involve while communicating, i.e., public key and private key. There are simple steps to solve problems on the RSA Algorithm.

Example-1:

  • Step-1: Choose two prime number
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Lets take
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
  • Step-2: Compute the value of
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    It is given as,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Here in the example,

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

  • Step-3: Find the value of
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    (public key)
    Choose
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    , such that
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    should be co-prime. Co-prime means it should not multiply by factors of
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and also not divide by
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Factors of

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    are,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    so
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    should not multiply by
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and should not divide by 20.

    So, primes are 3, 7, 11, 17, 19…, as 3 and 11 are taken choose

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    as 7

    Therefore,

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

  • Step-4: Compute the value of
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    (private key)
    The condition is given as,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    where y is the value of
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    .

    To compute the value of

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    ,

    1. Form a table with four columns i.e., a, b, d, and k.
    2. Initialize a = 1, b = 0, d =
      In RSA for p = 5 and q = 11 find out public key and private key from given p and q
      , k = – in first row.
    3. Initialize a = 0, b = 1, d =
      In RSA for p = 5 and q = 11 find out public key and private key from given p and q
      ,
      In RSA for p = 5 and q = 11 find out public key and private key from given p and q
      in second row.
    4. From the next row, apply following formulas to find the value of next a, b, d, and k, which is given as

    As soon as,

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    , stop the process and check for the below condition

    if 
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    if
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    For a given example, the table will be,

    abdk
    1 0 20
    0 1 7 2
    1 -2 6 1
    -1 3 1

    As in the above table

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    , stop the process and check for the condition given for the
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    To verify that

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    is correct, the above condition should satisfy, i.e.
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    . Hence
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    is correct.

  • Step-5: Do the encryption and decryption
    Encryption is given as,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Decryption is given as,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    For the given example, suppose

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    , so
    Encryption is
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Decryption is

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

    Therefore in the final,

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    ,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    ,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    ,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    ,
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q

Example-2: GATE CS-2017 (Set 1)
In an RSA cryptosystem, a particular A uses two prime numbers p = 13 and q =17 to generate her public and private keys. If the public key of A is 35. Then the private key of A is?

  1. In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
  2. Compute
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    and
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
  3. In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    (public key)
  4. Compute
    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    (private key)
    abdk
    1 0 192
    0 1 35 5
    1 -5 17 2
    -2 11 1

    In RSA for p = 5 and q = 11 find out public key and private key from given p and q
    (private key)


What is the formula of public and private key in RSA?

RSA algorithm uses the following procedure to generate public and private keys: Select two large prime numbers, p and q. Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption. If n = p x q, then the public key is .

What is P and q in RSA encryption?

The Mathematics behind RSA. In RSA, we have two large primes p and q, a modulus N = pq, an encryption exponent e and a decryption exponent d that satisfy ed = 1 mod (p - 1)(q - 1). The public key is the pair (N,e) and the private key is d. To encrypt a message M, compute. C = Me mod N.

What is private key in RSA algorithm?

The RSA algorithm is an asymmetric cryptography algorithm; this means that it uses a public key and a private key (i.e two different, mathematically linked keys). As their names suggest, a public key is shared publicly, while a private key is secret and must not be shared with anyone.

Is private key same as RSA private key?

If you mean the plain textbook RSA where P=Cdmodn (decryption with private key d) and S=Mdmodn (signature generation), then yes, they are the same.