What is the probability to get the same public key twice?

when I encrypt a message using somebody's public key, what are the chances other person has generated the same key independently? Is it safe to identify a user with its public key?

The key pair (public, private key) is generated by choosing random probably prime numbers using a pseudo-random number generator.
The quality of the pseudo-random number generator determines the probability of having two people with the same public-private key pair. Usually pseudo-random number generators (like the JCE SecureRandom) use some entropy sources, like the real-time clock, the time elapsed between keystrokes, bits of the screen, etc.)
If you use true hardware random number generators (like the used in crypto hardware like RSA smartcards and HSM (Hardware Security Modules), or the hardware RNG available in some Intel chipsets for the Pentium !!! and 4), you will have a probability much closer to the minimum theoretical probability.
Use hardware random number generators and crypto hardware if you really are concerned about the probability of having matching keypairs.

Similar Messages

Maybe you are looking for