16

So I'm at place A, see this sign:

Secure Connection Failed

and I'm writing the fingerprints to a piece of paper (this website is just an example):

Certificate fingerprints

Ok. Then, I go to place B (other country, etc.) then I check this site. The sign (for the self-signed cert) shows up again, OK. But: I get my paper out, and check the fingerprint of the site. It's the same.

QUESTION: With checking the fingerprint of the website, could I be 100% sure that:

  • I'm visiting the same site (server) on the two places (so no one can produce this fingerprint on other server?, MiTM?)
  • I'm secure because the content of the HTTPS connection cannot be sniffed.

p.s.: I'm using private browsing with Firefox on my notebook. The server side is mine too, I generated the self-signed certs. The notebook side were rebooted in the meantime, so I have to click again that: "I accept the risk, proceed anyway"

3
  • You are browsing via your own server to a client??? Please expand. If you are placing a self-signed cert in the equation and a server sounds like you are the man in the middle.
    – zedman9991
    May 31, 2013 at 12:08
  • If you're sure that you received the correct fingerprint the first time (ie. you're 100% sure that there was no MitM when you wrote the fingerprint on a paper) and you received the same fingerprint in another network, then yes, your assumptions are correct.
    – Adi
    May 31, 2013 at 12:30
  • My notebook is the client and my server is the server. No VPN or SSH tunnel or anything, just browsing my server through the dangerous Internet. Jun 4, 2013 at 15:12

2 Answers 2

11

Yes. There is a small possibility of creating another cert with the same MD5 hash (an MD5 collision), there is basically no chance of 2 inputs having both the same MD5 and the same SHA1 hashes. This dual hash fingerprinting is used as evidence in court. You want to prove a file is the same file, or a HDD's contents didn't change while it was in Law Enforcement's hands, etc. this is how it is done.

5
9

Yes, you have the guarantee that the certificate is the right one. This relies on second preimage resistance of the involved hash functions.

Resistance to collisions of a hash function h is about the hardness of finding two distinct inputs x and x' such that h(x) = h(x'). Resistance to second preimages is almost the same, except that x is fixed: given a value x, it should be infeasible to find a value x', distinct from x, such that h(x) = h(x'). That's your case here: x is the real certificate, which you verify from "place A" and then you write down h(x) on your paper. The attacker will succeed only if he can build a fake certificate x' whose hash matches what you wrote on your paper. The attacker does not get to choose x or the value you wrote on your paper; he must work within these constraints.

The nuance is of some importance because though MD5 is thoroughly broken with regards to collisions (and SHA-1 has been weakened, in a still-theoretical way), MD5 resistance to second preimages is still extremely good (almost as good as the theoretical maximum, and way beyond what can be cracked with foreseeable technology). Hence your safety. You don't even need to use both MD5 and SHA-1; checking either one is sufficient.

Be sure, though, to check all hexadecimal digits. If you only check the first few of them, this makes the attacker's task much easier.

0

You must log in to answer this question.

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