Reverse engineering secret key in RSA encryption with the help of signature Consider the following:  


$i$th message, $m_i$, in its original state.
$i$th message, $M_i$, encrypted message $m_i$ using public key.
Public key, $p$, in a $b$-bit RSA encryption setup. We can access it at all times.
Secret key, $s$.
Signature, signed by $s$. We will denote it as $sg$.


The scenario is such that we are presented with an encrypted message $M$, the public key with which it was encrypted, and the message $m$, which has been decrypted using the secret key and returned to its original state.
We also have a signature, signed as $sg$.

I understand that given simply $m_i$, $M_i$, and $p$, it is not possible to work backwards to obtain $s$. However, would it be possible to work backwards and obtain the secret key $s$ given enough instances of corresponding messages?
Suppose we are given pairs of messages, $(m_1, M_1), (m_2, M_2), \ldots (m_n, M_n)$, then would we get anywhere nearer towards obtaining the secret key (or maybe even increase our chances for a bruteforce search) as we approach a certain $n$? In that case how high an $n$ are we talking about?

Now consider we can vary $n$ to as much as we want. $n \rightarrow \infty$ Essentially, we have been given a frontend for the RSA implementation such that we can give it a message and it will return the encrypted message to us, as many times as we want but will not reveal $s$ (obviously). In this case, will we be able to reverse engineer $s$?

I have recently got to know about asymmetric encryption and these questions are a part of understanding it better, so I would appreciate it if anyone can offer some valuable insights!
In RSA, assuming knowledge of the public key but not the private key, analyzing any number of triplets of matching message, encrypted message, and signature $(m,M,sg)$, does not help (as far as we know) towards recovering the private key $s$ (nor an equivalent). That's regardless of the sensible padding or RSA variant used (as long as neither the padding nor choice of $m$, $M$, or $sg$ directly leak information about the private key, e.g. in some supposedly truly random padding field that really is not).

In fact, the stronger hypothesis that one with knowledge of the public key also temporarily can use a black box containing the private key $s=(N,d)$ that freely allows computing the raw RSA private key function $x\to x^d\bmod N$ for any $x$ (which in turn allows decrypting or signing any message), does not (as far as we know) help in any way towards finding a private key, nor factorizing $N$, nor otherwise building a black box independent of the original one computing the raw RSA private key function $x\to x^d\bmod N$ for random $x$ with sizable odds.

There is no proof of that; proving (or disproving) it is an open research problem.

Note: as pointed in another answer, access to a "frontend for the RSA implementation such that we can give it a message and it will return the encrypted message" demonstrably does not help, for it is possible to perform the same using the public key, with cost growing slower than $O(b^3)$. However, the question mentions that we are also given some signature, and we lack a proof that this does not help.



All the attacks on RSA that we know:


decipher or sign messages without finding a private key (only if improper use of RSA is made, e.g. poor encryption or signature padding);
or find a private key from the public key (typically, by computing a private exponent from the public exponent and the factors of the public modulus $N$, recovered by factorization, because $N$ was too small or its factors improperly chosen);
or extract the/a private key using some information leak.