有没有办法从TrueCrypt磁盘读取文件到内存中的文件?
问题描述:
我需要从未安装的TrueCrypt磁盘加载文件到内存中。有没有办法以编程方式做到这一点? TrueCrypt是否提供API?有没有办法从TrueCrypt磁盘读取文件到内存中的文件?
我相信最适合尝试的方法是安装卷(当然提示用户输入密码),打开文件,然后卸载卷。有没有办法自动完成这一切?
我在Windows Vista上。我有C#,Python和Perl随时可用。
答
你不能使用System.Diagnostics.Process中的true crypt command line吗?
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();
}
}
}
谢谢,这工作。 – MiffTheFox 2009-08-22 11:41:15
请注意,将密码硬编码到.NET程序集中可以使得通过反编译提取pw变得容易。如果安全性问题,您应该考虑混淆您的代码。 – galaktor 2009-08-22 11:50:10
@galaktor - 我通过省略/ p选项来解决该问题,允许用户直接将密码输入到TrueCrypt中。 – MiffTheFox 2009-11-09 00:16:37