So this video explains how https works. What I don’t get is what if a hacker in the middle pretended to be the server and provided me with the box and the public key. wouldn’t he be able to decrypt the message with his private key? I’m not a tech expert, but just curious and trying to learn.

  • NeoNachtwaechter@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    It is possible and it has been done.

    You need to get your “hacker” key signed/certified by an official CA. Which is not that difficult with some of them because they are doing it for money.

    • Cras@feddit.uk
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      You don’t really ‘need to’ in a world where a good proportion of people will happily click ‘continue anyway’ when they get any sort of certificate error

      • zeluko@kbin.social
        link
        fedilink
        arrow-up
        0
        ·
        6 months ago

        Thats why we have HSTS and HSTS preloading, so the browser refuses to allow this (and disabling it is usually alot deeper to find than a simple button to “continue anyways”)

      • NeoNachtwaechter@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        people will happily click ‘continue anyway’

        Not possible without a certificate. There will be no TLS connection, only an error message. No ‘click continue’.

        • ferret@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          6 months ago

          It is trivial for an attacker to make self-signed TLS certs, and you can absolutely just click “continue” on sites that use them when you get a warning from the browser

            • ferret@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              0
              ·
              6 months ago

              I am personally using firefox and referencing my own servers that use their own self-signed TLS certs that I have not bothered to load onto my pc because they aren’t public, but chromium-based browsers aren’t some outlier here

              • zeluko@kbin.social
                link
                fedilink
                arrow-up
                0
                ·
                6 months ago

                Your own servers probably also dont have HSTS enabled, or clicking continue will be disabled (if not overwritten in your browser-config)

                • ferret@sh.itjust.works
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  6 months ago

                  Reading the HSTS spec, it doesn’t work on first connection, and while most people are using websites they access more than once, that notably isn’t all web use.