# Difference between Private key and Public key

Cryptography is the science of secret writing with the intention of keeping the data secret. Cryptography is classified into symmetric cryptography, asymmetric cryptography, and hashing.

**Private Key****:** In the Private key, the same key (secret key) is used for encryption and decryption. In this key is symmetric because the only key is copied or shared by another party to decrypt the cipher text. It is faster than public-key cryptography.

**Public Key****:** In a Public key, two keys are used one key is used for encryption and another key is used for decryption. One key (public key) is used to encrypt the plain text to convert it into cipher text and another key (private key) is used by the receiver to decrypt the cipher text to read the message. Now, we see the difference between them:

S.NO | Private Key | Public Key |
---|---|---|

1. | The private key is faster than the public key. | It is slower than a private key. |

2. | In this, the same key (secret key) and algorithm are used to encrypt and decrypt the message. | In public-key cryptography, two keys are used, one key is used for encryption, and the other is used for decryption. |

3. | In private key cryptography, the key is kept a secret. | In public-key cryptography, one of the two keys is kept a secret. |

4. | The private key is Symmetrical because there is only one key that is called a secret key. | The public key is Asymmetrical because there are two types of keys: private and public keys. |

5. | In this cryptography, the sender and receiver need to share the same key. | In this cryptography, the sender and receiver do not need to share the same key. |

6. | In this cryptography, the key is private. | In this cryptography, the public key can be public and a private key is private. |

7. | It is an efficient technology. | It is an inefficient technology. |

8. | It is used for large amounts of text. | It is used for only short messages. |

9. | There is the possibility of losing the key that renders the systems void. | There is less possibility of key loss, as the key is held publicly. |