I really don't know much about HTTPS. But I always hear people saying that it is 100% safe and bullet proof.
My question is: Is that true or even possible.

I mean there are lots of tools that allow you to read the internet traffic of all other devices that are in the same network as you.
So how do certificates and encryption help to make this bullet proof?

Wouldn't it always be possible to decrypt the HTTPS packets just like the client does?
I mean there must be some kind of key that both parties (Client and Server) must be aware of to be able to en/decrypt data properly, so whoever creates the key has to send it to the other party. Shouldn't a network sniffer be able to pick that up?

  • 3
    Look up Diffie-Helfman key exchange.
    – KnightOfNi
    Jun 30, 2014 at 14:18
  • Unless the key that is sent is also encrypted :)
    – schroeder
    Jun 30, 2014 at 14:24
  • @KnightOfNi Okay I will look that up. @ schroeder So let's say the server generates a key that is used to encrypt/decrypt traffic. The server would have to send this key to the client. If the key is already encrypted and the client can decrypt it to use it, then why shouldn't the hacker be able to do the same?
    – Forivin
    Jun 30, 2014 at 14:30
  • @Forivin No, because the client (in fact, anyone (!)) is able to encrypt any message in such a way that only the server can decrypt it. It doesn't matter if a bad guy gets his hands on such a message, because only the intended recipient can decrypt it. Furthermore, the client doesn't need any special knowledge to create such an encrypted message, because anyone in the world with the server's public key can do it. The server's public key is, of course, publicly available to all potential clients.
    – apsillers
    Jun 30, 2014 at 16:55

3 Answers 3


Well, in the real world it actually is possible to perform a man in the middle attack on SSL, called ssl stripping. This is the easiest example. It hinges on the fact that the majority of traversal to HTTPS pages happens as the result of a redirect from an insecure plain HTTP.

This is the type of a attack you are describing when you ask if it would be possible to decrypt a packet just like a client - the answer is yes, by putting yourself in between the client and server and negotiating your own SSL connection with each of them. while this attack is old and easy to mitigate, it's still very dangerous and direct. Here's the talk where the attack was first presented - http://vimeo.com/50018478

A different form of MITM attack but just an example of how these kind of attacks can effect me and you: https://productforums.google.com/forum/#!topic/gmail/3J3r2JqFNTw/discussion and http://googleonlinesecurity.blogspot.co.uk/2011/08/update-on-attempted-man-in-middle.html

There are also a whole suite of attacks at the different components that make up TLS/SSL, such as the RC4 stream cipher. More here: https://www.isecpartners.com/media/106031/ssl_attacks_survey.pdf

EDIT: for an excellent technical description of how SSL actually works, which puts all my above post in context, see here: How does SSL/TLS work?

EDIT: Above where i said it was possible to mitigate MITM against SSL, i didnt give a resource, making that a bad answer :( See here for more details on how SSL can be made more robust: What is certificate pinning?

FINAL EDIT: This is also an excellent answer to your original question https://stackoverflow.com/questions/14907581/ssl-and-man-in-the-middle-misunderstanding


Why can't someone decrypt HTTPS traffic? It sends a secret "encryption secret" inside "Public Key cryptography".

So to answer your question, you'll need to understand

  1. Encryption
  2. Public Key Cryptography.

Most encryption comes from the innovation of the One Time Pad, which has limitations that you will learn about as you study the OTP. There are many ways to make a OTP "better", and each has different costs and benefits.

Next you need to get familiar with Public Key Cryptography. The assumption behind this is that is that is uses very, very hard math that even the best computers today can't crack.

One of the very hard math problems in use today is called RSA. There are more formulas to choose from, but to learn more, you can keep it simple with a pen and paper example.

So the short answer is that math protects the encryption key that is sent to the recipient. If a 3rd party observer were to see that communication, they would need amazingly powerful computers to figure out that key... and by then, (in 30, 50, or more years) that information is worthless.


The "key that both parties must be aware of" (also known as session key) is derived from a so called pre-master-secret (random number) which is exchanged using public key cryptography. A certificate is just a digitally signed public key with some extra information. With this public key, the client is able to encrypt messages that only the server can decrypt using the corresponding private key.

  • The session key is not exchanged. It is calculated independently by both peers via a key agreement protocol.
    – user207421
    Mar 21, 2017 at 4:09
  • @EJP Yes, you´re right. I edited the answer accordingly.
    – asquared
    Mar 21, 2017 at 14:31

Not the answer you're looking for? Browse other questions tagged .