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.
Anything 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.
Using 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 cases
Public/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:
- Public Key Crypto - refers to as asymmetric cryptography because one of two keys is made public
- Private Key Crypto - refers to symmetric cryptography where the one and only key must be kept private
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:
digital signature - the server's certificate is signed by a Certificate Authority (or it's self-signed) - this proves that some higher power (like GoDaddy) verified this information and asserts its truthfulness. That information has not been tampered with, and you can prove it by hashing the certificate information, and comparing it to the CA's signature after it has been decrypted with the CA's public key.
encryption - the client uses the server's certificate to encrypt and send information needed for setting up the session.
identification - the fact that the server could decrypt the client's information proves that it posses the private key. Proof of private key gives evidence that you are, indeed, talking to the server that the CA certified.
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.