detect the RSA public key from encrypted text we have a service who has a list of public keys got from clients (for example 1000 public keys. not too many)
service gets an encrypted message from one of clients. this message is encryped with a public key and defenitly service has that key.
can service find out which public key is used to encrype that data?
for more information (you can ignore it): service must broadcast data between all the clients (each one has a pair of RSA keys and service has their public keys). clients must send message to each other with no clue for tracking on service.
for example client A wants to send a message to client B. A encrypts the message with Bs public key and sends it to service. service broadcasts the message to all clients. but only one of the clients (it's B) can decrypt the message.
Maybe, but this approach depends on the distribution of the public key sizes.
Suppose that cm is the encrypted message, and ni is the modulus for customer i.

If cm &gt;= ni, then customer i cannot be the recipient of this particular message.
if cm is significantly smaller then ni (16-32 bits or so, depending on how certain you want to be) then it is possible (but unlikely) to have been sent to customer i.

So if there is a variety of key sizes, this may allow you to narrow down the list of possible senders. For example, if customer X has a 4096-bit key and all the others have 3072-bit keys, identifying messages from customer X would be easy.
On the other hand, if everyone has a 3072-bit key, you may be able to narrow the list of senders down some, but you would still have a fairly large list remaining.
One possible countermeasure is to add random high-order padding bits to the message to make the padded message larger than any modulus. In other words, if the largest modulus is (decimal) 1000000, then 1234 might become 9351234, while 12345 might become 7412345.  Each recipient can remove high-order bits until the message is smaller than their modulus, then try decrypting the message.