I have a two set of key {36,77} and {50,117},
How can validate if it is a valid RSA public keys? Is there any simple method?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityI have a two set of key {36,77} and {50,117},
How can validate if it is a valid RSA public keys? Is there any simple method?
That depends on exactly what you mean by a "valid RSA public key"; in general, it is difficult to validate a public key without the corresponding private key (unless the public key is obviously bad).
If you mean that there is a corresponding private key $d$ such that $(M^e)^d = M \mod N$ for all messages $M$, then there are two conditions; if both are met, then there will always be such a $d$:
$e$ is relatively prime to $\phi(N)$; if $N$ has k distinct prime factors $p_1$, $p_2$, ..., $p_k$ then $\phi(N) = (p_1-1)(p_2-1)...(p_k-1)$
$N$ is squarefree; that is, there is no integer $n > 1$ such that $n^2$ is a divisor of $N$. Or, in other words, all the prime factors of $N$ must be distinct.
Note that there are varients of RSA for which a public key might not meet these assumptions; they deal with the fact that $M^e$ might not have a unique inverse in various ways.
As for how to determine whether a public key meets these criteria, well, neither critieria is feasible to verify for a large key. On the other hand, it is easy to note by inspection that your examples do not; they both have an even value of $e$, and even numbers are never relatively prime to $\phi(N)$ (which is also even). In addition, your second example has $N=117$, which is not square-free (as it has a divisor of $3^2$).
On the other hand, a "valid RSA public key" might mean a key that meets the above constraints, and is secure. This implies that $e>1$ (easy to validate), and $N$ is hard to factor. If $N$ is large enough to be not easily factored, this also is hard to validate.
Thirdly, by a "valid RSA public key", you might mean "all of the above, and in addition, someone knows the private key". The only way you can accertain that is to work with the person who is supposed to know the private key (and, for example, have a Zero Knowledge Proof that they do indeed know the factorization of $N$).