I don't understand the real world usage scenarios of these cryptography methods. Can any one please explain how they work, with examples and also their usage in the real world?
|
|
Wikipedia has a good article on public/private-key cryptography. To summarize public/private-key cryptography is one concept, not two. The alternative to public/private-key cryptography is using symmetric cryptography which has one key per pair of communication partner. In asymmetric cryptography a person/computer has a keypair. One key is kept secret and called private key. The other one is given to communication partners. Anything that is encrypted using the public key can only be decrypted using the matching private key. Symmetric cryptography is a lot simpler and more performant, but it does not scale to a large number of communication partners (10 people need 45 keys for each one to talk securely to every one else). So as a result both systems are often used in conjunction in the real world: The actual data is encrypted using a symmetric session key, which is only valid for one session. This key (or some information from which it can be derived) is transmitted using public/private-key cryptography at the beginning of the session. EncryptionAnything that is encrypted using a public key can only be decrypted by using the private key. The most common example is HTTPS. When you connect to an HTTPS server, it will send you a certificate. A certificate is just a public key with some identity information attached to it. Using this public key the browser can send information to the server that only the server can decrypt, using its private key. Building up on that, a symmetric session key is negotiated between the browser and the server, which is used to encrypt the traffic. SignaturesUsing a private key information can be signed and this signature can be verified by using the public key. The most common use case is to sign certificate to tell the world that you trust that certificate to contain correct identity information. There is a number of certification authorities out there which are by default trusted by the common browsers. Other use casesPublic/Private key cryptography can be used for many different things. The standard example is email, but this is not really widespread because it's too complicated for average computer users. Smartcards are a better example: They store the private key and have a little processor that can do the encryption and signing. So the private key never leaves the device. |
|||||||||||||
|
|
I like Hendrik's answer, but figured I'd throw in some more stuff that won't fit in a comment. Common term usage:
General Usage: Symmetric crypto is generally quite fast, so it is readily used in time sensitive applications - for example, session encryption between two points. TLS/SSL uses it this way. Symmetric crypto has a big drawback - everyone/everything using it has to have that private key, and the private key must be transported carefully or else it will loose the value of its privacy. So Symmetric crypto can NOT be used for proof of identity or signature. That's always been the big value add of asymmetric crypto, where you can keep your private key and distribute the public key to everyone else. The big obvious example (as Hendrick said) is server certificates on an HTTPS session. If you're watching carefully, asymmetric crypto is actually used in a number of ways in that single case:
But - once all the up front work of the SSL/TLS handshake is done, the server's asymmetric keys are obsolete - the two computers are talking using symmetric cryptography. Asymmetric crypto, when used purely for encryption, tends to be slower than symmetric crypto, so most of the time a system will take a hybrid approach and use asymmetric for things only asymmetric crypto can do (identification) and it will fall back on symmetric crypto for things where time is a factor. |
|||||||||||
|
