Friday, October 21, 2016

Yes, we can validate the Wikileaks emails

Recently, WikiLeaks has released emails from Democrats. Many have repeatedly claimed that some of these emails are fake or have been modified, that there's no way to validate each and every one of them as being true. Actually, there is, using a mechanism called DKIM.

DKIM is a system designed to stop spam. It works by verifying the sender of the email. Moreover, as a side effect, it verifies that the email has not been altered.

Hillary's team uses "hillaryclinton.com", which as DKIM enabled. Thus, we can verify whether some of these emails are true.

Recently, in response to a leaked email suggesting Donna Brazile gave Hillary's team early access to debate questions, she defended herself by suggesting the email had been "doctored" or "falsified". That's not true. We can use DKIM to verify it.

Secretary Clinton, since 1976, we have executed 1,414 people in this country. Since 1973, 156 who were convicted have been exonerated from the death row.

It's not a smoking gun, but at the same time, it both claims they got questions in advance while having a question in advance. Trump gets hung on similar chains of evidence, so it's not something we can easily ignore.

Anyway, this post isn't about the controversy, but the fact that we can validate the email. When an email server sends a message, it'll include an invisible "header". They aren't especially hidden, most email programs allow you to view them, it's just that they are boring, so hidden by default. The DKIM header in this email looks like:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;

d=hillaryclinton.com; s=google;

h=from:mime-version:references:in-reply-to:date:message-id:subject:to

:cc;

bh=EHIyNFKU1g6KhzxpAJQtxaW82g5+cTT3qlzIbUpGoRY=;

b=JgW85tkuhlDcythkyCrUMjPIAjHbUVPtgyqu+KpUR/kqQjE8+W23zacIh0DtVTqUGD

mzaviTrNmI8Ds2aUlzEFjxhJHtgKT4zbRiqDZS7fgba8ifMKCyDgApGNfenmQz+81+hN

2OHb/pLmmop+lIeM8ELXHhhr0m/Sd4c/3BOy8=

How do you verify this is true. There are a zillion ways with various "DKIM verifiers". I use the popular Thunderbird email reader (from the Mozilla Firefox team). They have an addon designed specifically to verify DKIM. Normally, email readers don't care, because it's the email server's job to verify DKIM, not the client. So we need a client addon to enable verification.

Downloading the raw email from WikiLeaks and opening in Thunderbird, with the addon, I get the following verification that the email is valid. Specifically, it validates that the HillaryClinton.com sent precisely this content, with this subject, on that date.

Let's see what happens when somebody tries to doctor the email. In the following, I added "MAKE AMERICA GREAT AGAIN" to the top of the email.

As you can see, we've proven that DKIM will indeed detect if anybody has "doctored" or "falsified" this email.

I was just listening to ABC News about this story. It repeated Democrat talking points that the WikiLeaks emails weren't validated. That's a lie. This email in particular has been validated. I just did it, and shown you how you can validate it, too.

Btw, if you can forge an email that validates correctly as I've shown, I'll give you 1-bitcoin. It's the easiest way of solving arguments whether this really validates the email -- if somebody tells you this blogpost is invalid, then tell them they can earn about $600 (current value of BTC) proving it. Otherwise, no.

DKIM signs messages with a key that is stored in the DNS system. In order to forge the DKIM header they would also have to somehow modify the record on the DNS server or intercept and replace the key in transit so that the receiving email servers and in this case Rob's email client verify the message with the doctored key.

Using the DKIM signatures as proof of authenticity assumes the hillaryclinton.com mail server hasn't been compromised and the DKIM private key remains private, no?

Compromising hillaryclinton.com would certainly not be worth doing for 1 BTC, but it seems worth explicitly mentioning as a possible way of inserting an email into the archives that would appear legitimate by this method of verification.

h=from:mime-version:references:in-reply-to:date:message-id:subject:to :cc;Does this means that the from and to addresses are not part of the hash.? I think one can set the in-reply-to address manually. Could one then have an account on the system (plausible since they can dump the mail spool), send it from another account on the system to some other address and then change these later without invalidating the signature?

So, isn't RSA1024 basically broken at this point when we are talking about state level actors like Russia?

RSA put out a note in 2003 stating that an estimated $10M hardware setup could sieve the whole keyrange for 1024bit in under a year. I'd assume most intelligence agencies have something laying around to do this?

twopigames while it is true RSA said this, it also appears they were a bit too optimistic in their predictions on the progress of cracking technology. Sure, the Russians could have broken 1024 bit RSA without it being public knowledge. But I think it is unlikely. There is definitely no way a $10,000,000 purpose-built machine could do it in a year.

Looking at the RSA numbers challenge on Wikipedia, the biggest factorization (which is the only hard step in RSA to being able to calculate the private key) is of a 768 bit number. And that was done by some legends in the field. 1024 bit numbers are probably still safe even from governments, but they are phased out now because better too early than too late.

It does raise a chilling prospect, though. Many people worry that HRC's using a home server was problematic in that it could have exposed classified information to unauthorized parties. But as she was using 1024 bit RSA for her DKIM, we must also ask ourselves about the possibility emails were sent as her -- as Secretary of State -- and DKIM authenticated all because of her using that home server.

First, I don't particularly believe any of the emails are manipulated....:)

I thought RSA ended the challenge in 2007?

Is it outside the realm of likely that the NSA and therefore the Russia version would be capable of breaking 1024bit RSA in a somewhat time efficient manner. Wouldn't it only require a rainbow type lookup table for the sieve once you calculate it once? You've got to remember, the NSA has an insane amount of computing power laying around (I'm drawing conclusions about the Russians simply because I don't have a frame of reference for them).

Let's assume for argument sake 'they' aren't able to break RSA 1024. We agree that it's simple to fake an DKIM if you have the private key (otherwise why bother factoring the key at all).

It would be infinitely easier to break into the server and grabbing a copy of the private key used to generate the DKIM sig. Given that the state departments' servers were hacked during the same time-frame that HRC was using a private email server; I doubt her servers were more secure than the state dept ones. This has its own chilling consequences, due to the classified nature of some of her emails that were stored on that server, but honestly, is it worse than the state department servers being hacked?

All we really know is that the messages in question are signed by an entity that possesses the private key in question, which is literally all that DKIM is meant to prove.

Anyway, my whole point, there are other plausible options here, especially when we throw in the whole idea that a state actor might be behind the overall disclosures. Personally, I don't think this is the case, but hey, it's plausible, isn't it?

Right, so there's this thing called email spoofing which is used in conjunction with man-in-the-middle attacks to intercept an email in transit, modify it, then send it on its way, all while still being "verified" as unaltered. This type of cyber attack is actually quite common and well documented. So while I see the merit in trying to validate or disprove claims of tampering, it's not actually easily ascertained by DKIM as you are claiming.

So David D. Let me get this straight. You're suggesting that there was possibly a man-in-the-middle attack on the hillaryclinton.com mail server that intercepted all 19,000+ emails, modified them and sent them on their way systematically. What's more likely? That an email was captured after being sent, forwarded to a person in a foreign country with malicious intent, they read the email, then decided to modify the email to inflict the most damage to the Clinton campaign and then forwarded the modified email on to John Podesta without anyone knowing that the email was modified? Remember, both Podesta and Clinton admit that the emails were stolen. The manpower to make such modifications would be massive!

Or are these just the authentic emails from Podesta's account. (Occam's Razor)

But I don't see any DKIM headers on any of the emails sent by John Podesta. Also, it appears that the DKIM header is stripped out of any reply. Couldn't you then forge an email from hillaryclinton.org by crafting it as a reply by John Podesta to a non-existent email?

There's no reason to believe that HillaryClinton.com has been hacked. (Don't confuse it with ClintonEmail.com.) Also, even if Russia did get into the server (implausible), it doesn't mean they could get permissions to the DKIM private key, which is probably locked down tight.

I tried to do what you said and verify the emails myself because I don't like blindly trusting. I got thunderbird, but i didn't set up an email address in it. I got the DKIM verifyer add on and download the email you suggested. It just says "validating..." for seemingly ever. Does it take a long time to process? Or is something wrong?

Where is the private key stored? If it is stored on the sending server (Hillary.com) then couldn't the russians hack into that server and read the private key? Once that was done then the emails could be completely fabricated and signed and no one would know the difference.What am i missing?

Faking these emails would NOT require a huge NSA/KGB level effort. All you need is an email with the fake content, a DKIM signed email (with any content) between the target email addresses, and a pair of accessible addresses using DKIM signatures.

Take an email with the fake content and send it between the pair of accessible addresses with DKIM signing turned on. This way DKIM provides the new body and subject content signature. Next, in a hex or binary editor (like ht) open the email between the targeted source/destination email address pair. Now, add the fake subject line and email body content. Finally, replace the first 32 symbols of the full message signature with the newly created body/subject signature from the fake email. Voila, you have a forged email that looks legitimate.

This is assuming that emails between Mr. Podesta and Sec. Clinton were signed using DKIM. If Sec. Clinton’s server only used DKIM to confirm an email came from Mr. Podesta as is standard, all the forger would need to do is combine the headers from a real email with fake message content.

This forgery is so easily accomplished it is hard to see how one could claim otherwise without some political motivation.

Actually, DKIM does a one way hash of the entire contents, so any changes in the content would cause a invalid test.So, regardless of your political beliefs, this would not work. DKIM signs the email by encrypting the one way hash of the content. So this is wrong.

You need to generate a private and a public key for each of the domains for which you wish to sign mail. The private key is stored away on your server, while the public key gets published in your domain's DNS records so that receiving mail servers can verify your DKIM-signed mail." here - https://www.howtoforge.com/set-up-dkim-domainkeys-identified-mail-working-with-postfix-on-centos-using-opendkim So if the private key resides on the MX, and the MX is compromised, what is to stop those who sucked stuff off the MX from being able to forge messages? And what if I just change this and host the private key on my host... then go back and erase the evidence I was in the MX editing files? /etc/opendkim/TrustedHosts –- a list of servers to "trust" when signing or verifying ---- just asking

The only real way to edit or fabricate these emails is to hack into the server and get the private key, a very tall order. But difficulties don't stop there. The Russians would then have to have a staff of English speakers who are very knowledgeable about Hillary and her staff. That would be hugely labor intensive and risky, given the massive scrutiny that these emails get. A dumb mistake would be inevitable and give the lie to the entire enterprise. I think people have to accept these are authentic.

What would be the best possible way to undermine the Wikileaks releases? The answer is simple. Find one doctored or fabricated email that can be proven to be so. This would be game over for Wikileaks. They would lose credibility completely. Podesta has said they don't have time to authenticate the emails. This is his way of admitting that they are authentic. If they thought they were not authentic they would devote massive resources to prove at least one was fabricated or edited. This would be the nuclear weapon that would vaporize Wikileaks forever. Certainly that would justify the effort and resources. So, we can assume Podesta believes they are authentic. No one would be dumb enough to let the opportunity slip away. Clearly, any discussion of cyptrographic subtleties is beside the point and a waste of time.