0
votes

I was reading about the asymmetric key cryptography and got to know that it resolved the issue caused by symmetric key cryptography. (where the same key used for encryption and decryption and chances of stealing the key is higher).

In asymmetric key cryptography, we've two keys public and private. the public key is accessible to the outside while the other key is only known to that user. Now if I sent the message to some other person, So first I should know his public key and send the message with encrypted by his public key and message only decrypted by the other user using the private key.

But I've following doubts -

  • What if, when both users have the same private key. (Both users can read the sensitive information of each other)

  • Is the public key of every user unique?

3
Keys are generated randomly so the possibility that two keys are identical is very low. But if you encrypt with a key that happens to belong to some other person too, is this other person would also be able to decrypt the message.faester
I'm voting to close this question as off-topic because it is a pure cryptography (without coding) question and therefore should be posted on crypto.stackexchange.comRobert

3 Answers

0
votes

Normally, two users never have the same private key. If the same private key is present in multiple locations, then effectively this is the same user using multiple machines.

An example of a case where the same private key would be present in multiple locations is redundancy. If an organization maintains multiple equivalent servers for fault tolerance or load balancing, then they might use the same private keys on all of those servers. From a cryptographic point of view, the multiple servers would be a single ”user“.

Two distinct private keys have distinct public keys. Therefore public keys are also unique.

0
votes

Q: "What if, when both users have the same private key. (Both users can read the sensitive information of each other)"

A: No, not normally. The users would have to explicitly share the private key.

Discussion:
Users can share a public and/or private key if they choose to. Without explicit sharing generated asymmetric keys are assumed to be different if a secure method is used to generate them. The same applies to symmetric keys.

There are substantial differences between symmetric and asymmetric encryptions. Asymmetric encryption is slow and limited to encryption data with a size less then the key size, key sized tend to be larger, (RSA) 2048 or 4096 bits. Symmetric encryption is fast, in general (AES) has no data size limitations and small keys, 128 to 256 bits. They are often used together with the data encrypted with symmetric encryption and the symmetric encrypted with asymmetric encryption, this is known as hybrid encryption.

Note:
More studying is necessary to understand the different usages of symmetric and asymmetric keys. In general default to symmetric encryption and use asymmetric encryption when separate encryption and decryption keys are necessary.

More:
The statement "(where the same key used for encryption and decryption and chances of stealing the key is higher)" is incorrect, the chance of keys being stolen is based on how well they are protected.

0
votes

To answer both of your questions:

What if, when both users have the same private key. (Both users can read the sensitive information of each other)

In this case, both receivers would be able to decrypt ciphertexts, that were encrypted to their (shared) public key. However, as we will see shortly, this does not just happen.

Is the public key of every user unique?

Yes.

In asymmetric cryptography, key pairs are randomly generated.

Furthermore, the amount of different keypairs that can be generated is huge. Therefore, the probability of two people accidentally generating the same keypair is negligible.

In practice this means that, with overwhelming probability, all keys in existence will be different. I.e. all of them are unique.