Slashdot Mirror


How I Compiled TrueCrypt For Windows and Matched the Official Binaries

First time accepted submitter xavier2dc writes "TrueCrypt is a popular software enabling data protection by means of encryption for all categories of users. It is getting even more attention lately following the revelations of the NSA as the authors remain anonymous and no thorough security audit have yet been conducted to prove it is not backdoored in any way. This has led several concerns raised in different places, such as this blog post, this one, this security analysis [PDF], also related on that blog post from which IsTrueCryptAuditedYet? was born. One of the recurring questions is: What if the binaries provided on the website were different than the source code and they included hidden features? To address this issue, I built the software from the official sources in a careful way and was able to match the official binaries. According to my findings, all three recent major versions (v7.1a, v7.0a, v6.3a) exactly match the sources."

57 of 250 comments (clear)

  1. But can you trust xavier2dc? by Anonymous Coward · · Score: 5, Funny

    But can you trust xavier2dc? It's turtles all the way down.

    1. Re:But can you trust xavier2dc? by javajawa · · Score: 5, Interesting

      Then follow the same steps and compile it yourself. You should come to the same results.

      --

      Meh

    2. Re:But can you trust xavier2dc? by Impy+the+Impiuos+Imp · · Score: 5, Funny

      Yah, really.

      Wait! But what if I, myself, am an NSA stooge and don't realize it?

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    3. Re:But can you trust xavier2dc? by maxwell+demon · · Score: 2, Funny

      OK, but how do I compile xavier2dc? Is the source even available?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    4. Re:But can you trust xavier2dc? by mrchaotica · · Score: 2

      Step 1: download hacked_compiler.exe from xavier2dc.com...

      (I kid, but "Reflections on Trusting Trust" shows that it's possible...)

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    5. Re:But can you trust xavier2dc? by nani+popoki · · Score: 2

      Ken Thompson once presented a hack where he modified the C compiler to insert a backdoor in the generated code for the UNIX login code (and only that one specific module!). So trusting the compiler to do what you say is NOT an "of course".

    6. Re:But can you trust xavier2dc? by paiute · · Score: 5, Funny

      OK, but how do I compile xavier2dc? Is the source even available?

      Step 1: Find his mother

      --
      If Slashdot were chemistry it would look like this:Cadaverine
    7. Re:But can you trust xavier2dc? by tippe · · Score: 5, Funny

      Lets give him the Voight-Kampff test and find out...

    8. Re:But can you trust xavier2dc? by Shoten · · Score: 4, Insightful

      Then follow the same steps and compile it yourself. You should come to the same results.

      I think you're kind of missing his two points. One, he's joking. But two, he's also serious...yes, that is what someone can do. But will they? Probably not. I'm willing to bet that 80% minimum of those who read TFA will simply accept it as canon and move on with it a fact in their minds that the two do match. And beyond that, they will keep it as a fact in their minds even for future releases, which haven't been validated in this way. So that's really the challenge here.

      And even worse, think about all the TrueCrypt users who don't have the technical ability to compile binaries, much less do it in a very specific way? Ultimately, someone has to be trusted, and trust is a web rather than something that flows from a single fountain when it comes to society.

      --

      For your security, this post has been encrypted with ROT-13, twice.
    9. Re:But can you trust xavier2dc? by amicusNYCL · · Score: 4, Funny

      One, he's joking. But two, he's also serious.

      You just blew my mind.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    10. Re:But can you trust xavier2dc? by bondsbw · · Score: 2, Funny

      What if the NSA injected a Ken Thompson hack into our human compilers? Our DNA may have an NSA backdoor!

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    11. Re: But can you trust xavier2dc? by NatasRevol · · Score: 2

      Unfortunately, yes he does.

      --
      There are two types of people in the world: Those who crave closure
    12. Re:But can you trust xavier2dc? by TangoMargarine · · Score: 3, Funny

      Yes. They give you a couple complex calculus problems and if you get them right, you're a robot.

      --
      Unity? Screw that: XFCE. Slashdot Beta? Screw that: SoylentNews. Australis? Screw that: Pale Moon. UX developers DIAF
    13. Re:But can you trust xavier2dc? by Grog6 · · Score: 5, Funny

      If there's DNA on your Backdoor, you've just been rooted!

      (sorry; but this IS /.) :)

      --
      Truth isn't Truth - Guliani
    14. Re:But can you trust xavier2dc? by Applekid · · Score: 4, Funny

      Ken Thompson once presented a hack where he modified the C compiler to insert a backdoor in the generated code for the UNIX login code (and only that one specific module!). So trusting the compiler to do what you say is NOT an "of course".

      And how can I trust the cpu to actually execute the code as compiled and not insert it's own microcode into the process? And how can I trust the memory chips that hold my data to not clandestinely copy it off someplace else?

      No no, the only solution is to catch the butterflies whose wings flapped and waterboard them to learn the truth.

      --
      More Twoson than Cupertino
    15. Re:But can you trust xavier2dc? by RawsonDR · · Score: 2

      Yah, really.

      Wait! But what if I, myself, am an NSA stooge and don't realize it?

      You'll need to provide us with your source code. We'll review, then recompile. If the output matches then we know we can trust (both of) you.

    16. Re:But can you trust xavier2dc? by bobbied · · Score: 2

      Until you personally have inspected the source code for everything down to the BIOS and microcode in your hardware there will always be a chance there is a backdoor.

      BUT, it all depends on how far away you go with your trust. Don't trust the application? Build from source. Don't trust the build chain? Build it from source. Don't trust your OS? Build it from source using your built compiler... On and on, until you have literally built everything yourself. The good news is that the farther you get away from the application, the less likely there will be a issue with trusting so the lower risk it becomes. But if you simply MUST then you are going to be building a lot of stuff.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    17. Re:But can you trust xavier2dc? by omtinez · · Score: 2

      On that line of thought, trying to replicate the binaries takes a whole new meaning

    18. Re:But can you trust xavier2dc? by IndustrialComplex · · Score: 5, Funny

      You'll need to provide us with your source code.

      I'll provide you my source code, but just remember, you asked for it. So no complaining to the police when it is delivered.

      --
      Out of modpoints but really liked a post? 1BDkF6TtmmeZ3yqXbz9yhdYVqRYnwFoXDj
    19. Re:But can you trust xavier2dc? by jonfr · · Score: 2

      Just run Windows ME and then you never have to worry about NSA.

  2. Little Let Down by Anrego · · Score: 5, Interesting

    I was kinda hoping he'd built some elaborate timing setup to somehow match the exact timestamps and compile speed as the official binaries were built with.

    This is still a great analysis though, and the detail provided is a fun read and useful insight into the general mindset and method of how this kind of analysis is done.

    1. Re:Little Let Down by IamTheRealMike · · Score: 5, Informative

      He did as much as was necessary to establish trust and no more.

      I just want to say to Xavier - thanks. Great work.

    2. Re:Little Let Down by wonkey_monkey · · Score: 3, Insightful

      He did as much as was necessary to establish trust and no more.

      Or so he has led you to believe...

      --
      systemd is Roko's Basilisk.
    3. Re:Little Let Down by Anonymous Coward · · Score: 4, Insightful

      Everything in that link only applies to secondary volumes, it doesn't appear to apply if you've encrypted your system volume.
      Also, everything being talked about has little to do with windows, and more to do with the pointers/shortcuts external applications make to the "hidden" encrypted filesystem.
      Linux would likely have the same number of "Hey! Look! An encrypted filesystem over there!" red flags.

  3. Re:And why should we trust you? by asmkm22 · · Score: 5, Insightful

    He provides pretty clear instructions on how to duplicate the process he used. He's not just saying "I did it and it's safe, trust me."

  4. Re:"According to my findings" by Zerth · · Score: 4, Insightful

    You don't have to trust this person, they've given you the exact steps to do it yourself.

  5. Ugh, not "a software" again. by jabberw0k · · Score: 3, Informative

    "TrueCrypt is a popular software enabling data protection...

    No, TrueCrypt is a popular piece of software. You don't have "a hardware" or "a clothing" or "an information" — and likewise you cannot have "a software."

    1. Re:Ugh, not "a software" again. by freeze128 · · Score: 2

      I'm just glad that they don't call it a "Progrum".

    2. Re:Ugh, not "a software" again. by ZombieBraintrust · · Score: 2, Insightful

      I don't think you can have a "piece" of software. You don't have half of TrueCrypt or a 3rd of it. Should be "TrueCrypt is popular software enabling data protection"

    3. Re:Ugh, not "a software" again. by Desler · · Score: 2

      Even better that it's not a "pogrom".

    4. Re:Ugh, not "a software" again. by geekoid · · Score: 4, Informative

      The plural of datum is data.
      The singular of data is datum.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  6. Re:Umm... by Qzukk · · Score: 2

    At this point it means that if you go through the source code and understand it, you know what the truecrypt binaries are doing, because you can be pretty sure (modulo built-in compiler exploits affecting both your and their compiler the same way) their binaries match the source code.

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  7. submitter told you how to check it yourself by raymorris · · Score: 4, Insightful

    TFA painstakingly explained how you can check it yourself. I'm sure several people will, including enough people that I trust enough. Especially given that there is zero evidence of a backdoor. Nobody is claiming there is a backdoor, so it's a question if yyou trust the testers more than you trust - nobody.

    1. Re:submitter told you how to check it yourself by mlts · · Score: 5, Informative

      I would say that TC is above almost all security software in that the source is available at all. There are a lot of utilities out there that there is no source available for unless one is a large government.

      TC at least has a level playing field. China might have the source code, but at least you do too.

  8. Re:But can you trust Microsoft Visual C++ by shawn(at)fsu · · Score: 4, Insightful

    If you're that worried about a ken thompson attack (which this topic always devolves in to) then why even use a computer at all?

    --
    500 dollar reward for tip(s) leading to the arrest of the person(s) who stole my sig.
  9. that's not even wrong... by Thud457 · · Score: 3

    You're not quite 40 YEARS behind the times....


    I think this whole NSA brouhaha will make some people start taking auditability a little more seriously.
    Which means documenting the whole tool chain used and all options used. Of course, that only helps if you have access to the source. SUX to be you, Microsoft.

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

    1. Re:that's not even wrong... by tepples · · Score: 2

      You also need the source for the chips themselves.

      Not if the diverse double compiling process includes other CPU architectures. For one thing, there exists a C compiler that runs on an Apple IIGS computer with a 65816 CPU, which doesn't have enough gates to hold a Ken Thompson backdoor.

    2. Re:that's not even wrong... by Score+Whore · · Score: 2

      What the hell are you talking about? The 65816 in the IIGS has more capacity/capability than the machines Ken Thompson did his work on. What it primarily lacks is an MMU.

  10. Re:'Now we know version v7.1a is not backdoored' by asmkm22 · · Score: 2

    He made very clear that he didn't audit the source code. Only that the binaries match the source code.

  11. Re:Now for extra credit by Thud457 · · Score: 4, Funny

    Define the universe.
    Give two examples. ;-)

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

  12. Re:But can you trust Microsoft Visual C++ by Dishevel · · Score: 5, Funny

    I don't. I build all of code in hardware. That is rendered in MineCraft.

    --
    Why is it so hard to only have politicians for a few years, then have them go away?
  13. Re:Can you trust the compiler? by surmak · · Score: 4, Interesting

    The compiler (and support stack) is a MS compiler, and MS is already owned by "the man", so as Kernighan demonstrated you still can't trust it.

    The disassembler he used is not. So it is (at least theoretically) possible to see if there is a back door. The compiler has a very low-level view of what it is doing. In order to add a back door, it would need to recognize when it is compiling TC. This could be a much more difficult technical problem than what Kernighan did to login, and, if discovered, would be devastating to MS from a PR standpoint.

  14. Re:Can you trust the compiler? by godrik · · Score: 2

    Well, you can't trust any software you do not have the source code of. So of course you can not trust the MS compiler.

  15. Re:And why should we trust you? by Anonymous Coward · · Score: 2, Funny

    I'm a little suspect of this ./configure --enable-backdoor option.

  16. Re:what about the source? by Desler · · Score: 3, Interesting

    Do you have the attention span of a gnat? What you ask about is covered In the second sentence of the summary.

  17. Did same, found same by Anonymous Coward · · Score: 5, Interesting

    I did the exact same thing as in TFA a few days earlier and ended up finding the exact same variations and causes for those variations.
    My conclusion was also identical, binaries are indeed coming from the provided sources and can be trusted if no further backdoor is found in the sources themselves.

    A cryptographic and coding oriented audit is still much required.

  18. Diverse double compiling by tepples · · Score: 5, Informative

    And how can I trust the cpu to actually execute the code as compiled and not insert it's own microcode into the process?

    By using free compilers and ensuring clean binaries using diverse double compiling. (Thud457 mentioned it, and we discussed it a week ago.) Essentially what you do is bootstrap the compiler (compile the compiler's source code with your existing compiler binary, then recompile it with itself) on several different brands of compiler. If the binaries resulting from all bootstraps match, then either none of them have a backdoor or they all have the same backdoor. The more compilation processes you use, the less likely it will be that they all have the same backdoor. To exclude CPU microcode bugs that target a particular compiler, you could try running some of the bootstraps in an emulator such as DOSBox or bootstrap them as cross-compilers on another CPU architecture.

    1. Re:Diverse double compiling by Stuarticus · · Score: 3, Funny

      I see the flaw their.

      --
      If you think someone isn't free to have a different definition of "freedom" you may be a tyrant.
  19. Sarah Conner? by dutchwhizzman · · Score: 2

    Is his mothers name Sarah Conner?

    --
    I was promised a flying car. Where is my flying car?
  20. Obligatory Ken Thompson Lecture by SplawnDarts · · Score: 2, Informative
  21. Re:And who are you? by nurb432 · · Score: 2

    It was a joke. Apparently not a successful one.

    --
    ---- Booth was a patriot ----
  22. Won't stop the NSA produced FUD by Anonymous Coward · · Score: 2, Interesting

    The NSA wages a massive psychological warfare campaign in yearly psy-ops that are budgeted at multiple billions of dollars. Telling people that good, cheap, easy solutions are 'bad' is very very effective. Most people are very easily manipulated, when messages are regularly inserted into their media of choice.

    Take one real-life NSA project:
    - years ago, the US government passed laws insisting that ALL mobile phones in the USA could be location tracked using ANY viable technology solution. In reality, this means cell tower 'triangulation' methods, where the mobile network providers ensure that ANY phone visible to more than one tower has its precise position noted multiple times per minute. This process does NOT require any form of GPS chip, or for the phone to be 'in use'.

    - the law, created for the benefit of the full surveillance activities of the NSA, was described to the sheeple at the time as 'assisting' the authorities in locating 911 callers who, for some reason, couldn't give their current location.

    - for several years afterwards, TV dramas and Hollywood films built the location tracking nature of ALL mobile phones into their plots.

    - then, the NSA decided that it wanted the American sheeple to FORGET this functionality, and contacted all the major media companies, requesting they no longer reminded viewers that their phones are effectively location tracking bugs. The excuse was that criminals would use their phones without regard for self-incrimination, if TV and films stopped reminded them of the risks represented by mobile phone use.

    - now, for almost FIVE YEARS, most TV shows and films, if having characters with mobile phones, specifically state to the audience that phone location tracking is HARD, unlikely, and can only be done under very restricted circumstances. The TV show 'Shameless' (US remake) has a supposedly expert hacker kid STATE that mobile phones cannot be location tracked. The recent movie "The Call" states that only phones with GPS chips can be location tracked.

    The NSA is in the game of perceived truths. The NSA has the money and influence to contact ANY mainstream media organisation, and have them carry an NSA designed form of propaganda.

    Commercial encryption solutions don't just ALL contain NSA back-doors, they also prohibit the concept of 'plausible deniability'. Truecrypt doesn't tie the concept of password entry to the package that is to be decrypted. You cannot accurately say "this is a truecrypt data block". Commercial encryption products, on the other hand, bind the password process with the encrypted data, denying a user the ability to deny the use of encryption. NSA FUD shills suggest the government do NOT need proof of encryption when demanding passwords, but this is laughable. Legally, you CANNOT demand something you have no proof exists. With the use of Truecrypt, the government needs to collect pre-existing data about its use (say, like the fact the suspect has been witnessed STATING he/she keeps certain encrypted data on the suspect computer). A commercial encryption package, on the other hand, even without back-doors, still works to alert any third party where exactly encryption is active on the computer.

  23. Backdoor in the source? by kbg · · Score: 3, Insightful

    But did this guy check why the Windows version writes mysterious random bytes in the header but not in the Linux version?

  24. Compiler can not be trusted by kbg · · Score: 5, Interesting

    There is one problem with his findings. In order to compile TrueCrypt you have to use Microsoft Visual C++ compiler, which is made by Microsoft from a closed source. If I was the NSA I would but the backdoor in the compiler and it would get injected into the binary whenever TrueCrypt was compiled.

    1. Re:Compiler can not be trusted by grub · · Score: 2

      Not just that, you need a very old Microsoft Visual C++: V 1.52

      Why so old? Weaknesses or backdoored? TINFOIL HAT!

      --
      Trolling is a art,
    2. Re:Compiler can not be trusted by xavier2dc · · Score: 3, Informative

      Visual C++ 1.52c is the last version that could generate 16-bit code, which is needed to compile part of the boot loader for full disk/system encryption. The other solution would have been to write all the thing in assembly (or replaced the portion with the pre-compiled code instead), but that wouldn't have made more people happy to reverse-engineer more assembly, would it?

  25. Re:Generic problem to solve? by ledow · · Score: 2

    Include source with the binary, in a non-executable section.

    On first run, the machine builds the source (running as a very limited user) and compares the result against the rest of the binary. If it doesn't match, it simply ignores the binary supplied, replaces it with the new compiled version and signs it with a key unique to your own computer/compiler.

    Of course, there are myriad problems here (not least that commercial software will never be released in that format), but that's the only way "to be sure". If in doubt, recompile from source. This is just an automation.

    We already have the tools. PE and ELF already have sections we could use for this. We already do a lot of "multiple architectures stored in a single binary" magic (e.g. for MacOS, ELF allows you to do similar, etc.). We already have most of this in things like Software Restrictions policies, Authenticode, etc. it's just a case of going that one step further.

    There's no reason that open-source software couldn't adopt a standard that - if you wish - you can just run the binary "as-is" (and it just ignores the source sections and works as currently), but if you have a system with the right option turned on, before a single byte of a program is executed it is compiled as a limited users from the source contained within it (in a way that produces constant binaries - it's not hard, we just prefer to debug with relevant build dates, etc. - this could be easily standardised to produce "consistent" builds if compiled on the same versions), checked against the resulting binary and/or just overwriting the binary (sometimes you'll have a newer compiler - swell - just ignore the "old" signed binary and replace with one generated from the binary's source contained within itself), signing the result and then "whitelisting" that particular signed binary. It only needs to be done once per executable per computer, won't take that long even for the largest software, and you get a "free" copy of the source too.

    And while you're there, if you want to turn it off and just trust the binary (with source, and a message inside it detailing the checksum of that source, say, signed by FireFox Inc. or whatever), then you can just add that cert to your systems trusted lists and not worry about having to recompile every app.

    To be honest, I don't get why open-source security distributions aren't already doing it. It would also solve an awful lot of "custom Makefile" problems that never get resolved. I spent hours the other week getting SDL to compile on ARM - sure, someone somewhere has done that for me but it's a pain in the arse involving editing Makefiles, changing options, patching configure scripts, etc. because "nobody ever does that, just use the binary".