views:

675

answers:

1

I need to load a file from an umounted TrueCrypt disk into memory. Is there any way to do this programatically? Does TrueCrypt offer an API?

The way I believe is best for attempting this would be to mount the volume (prompting the user for a password, of course), open the file, and then unmount the volume. Is there a way to do this all automatically?

I am on Windows Vista. I have C#, Python, and Perl readily available.

+3  A: 

Can you not use the true crypt command line from say System.Diagnostics.Process?

using System;
using System.Diagnostics;

namespace Test {

    class TrueCrypeStart
    {
        static void Main(string[] args)
        {

            string password = getPassword(...);
            Process tc= new Process();

            tc.StartInfo.FileName   = "TrueCrypt.exe";
            tc.StartInfo.Arguments = string.Format("/v \"{0}\" /p \"{1}\" /q", ...mount info ..., password); // for quiet!

            tc.Start();
        }
    }
}
Preet Sangha
Thank you, this worked.
MiffTheFox
Be aware that hardcoding the password into a .NET assembly could make it easy to extract the pw by decompiling it. You should consider obfuscating your code if security is an issue.
galaktor
@galaktor - I solved that problem by omitting the /p option, allowing the user to input the password themselves directly into TrueCrypt.
MiffTheFox