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.
In Private key, the same key (secret key) is used for encryption and decryption. In this key is symmetric because the only key is copy or share by another party to decrypt the cipher text. It is faster than the public key cryptography.
In 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 for encrypt the plain text to convert it into cipher text and another key (private key) is used by receiver to decrypt the cipher text to read the message.
Now, we see the difference between them:
|S.NO||Private Key||Public Key|
|1.||Private key is faster than public key.||It is slower than private key.|
|2.||In this, the same key (secret key) and algorithm is used to encrypt and decrypt the message.||In public key cryptography, two keys are used, one key is used for encryption and while the other is used for decryption.|
|3.||In private key cryptography, the key is kept as a secret.||In public key cryptography, one of the two keys is kept as a secret.|
|4.||Private key is Symmetrical because there is only one key that is called secret key.||Public key is Asymmetrical because there are two types of key: private and public key.|
|5.||In this cryptography, sender and receiver need to share the same key.||In this cryptography, sender and receiver does not need to share the same key.|
|6.||In this cryptography, the key is private.||In this cryptography, public key can be public and private key is private.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Private and Public IP addresses
- Difference between Public and Private in C++ with Example
- Difference Between Public Cloud and Private Cloud
- Difference between Public and Private blockchain
- Know your public and private IP addresses
- Public Key Encryption
- Difference Between Virtual Private Network (VPN) and Proxy
- Difference between Virtual Private Network (VPN) and Multi-Protocol Label Switching (MPLS)
- Public vs Protected in C++ with Examples
- Difference between Primary key and Unique key
- Difference between Super Key and Candidate Key
- Difference between Primary Key and Foreign Key
- Difference between Primary key and Super key
- Types of Virtual Private Network (VPN) and its Protocols
- Private VLAN
- Private Browsing
- Port Address Translation (PAT) mapping to Private IPs
- What is APIPA (Automatic Private IP Addressing)?
- Private Branch Exchange (PBX)
- Difference between Primary and Candidate Key
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : MU KUL