在编译过程中使用的工具下载地址:
http://download.csdn.net/download/qq_37477609/10255264 或者 Http://prog3.com/sbdm/download/detail/chenyujing1234/4448383(来源:PKCS11.7 + asm.zip + gzip.exe + MsVSVC ++ 1.52.7z )
首先,TrueCrypt配置文件
TrueCrypt是一款免费的开源加密软件,支持Vista Windows,7 / XP,OS X Mac,Linux等操作系统。TrueCrypt不需要生成任何文件就可以建立在硬盘上的虚拟磁盘上,
用户可以按照信来访问所有的虚拟磁盘文件,自动加密,需要通过密码访问。
TrueCrypt提供了多种加密算法,包括:AES-256,Blowfish(密钥448位),CAST5,Serpent,DES Triple,Twofish和其他功能也支持FAT32和NTFS分区,隐藏音量,启动热键等等..
主要特征:
(1)所有的加密都是基于分区的。
(2)所有的加密数据都是经过AES和其他加密算法后的结果是正确的。操作结果不能中断(除了穷举法)。
(3)创建一个加密的“ 虚拟磁盘文件 ”(类似于虚拟光盘,大小可以自定义
(4)加密单个分区或整个硬盘。
(5)加密Windows系统位于分区(启动Windows之前需要输入密码)
(6)加密过程自动,实时和透明在使用加密文件或分区之前输入密码,加载后使用加密分区以及普通分区。
(7)提供两级程序,以应付被迫告知密码(如抢劫)的情况。
7,1隐藏分区(涵盖密码学,隐写术),隐藏的操作系统
如图7所示,2 无法检测到TrueCrypt的分区(加密的数据被认为是随机数据)
(8)加密算法:AES-256,Serpent,Twofish。为了达到更好的加密效果,我们可以同时使用两种或三种加密算法。操作模式:XTS。
二,TrueCrypt编译器
从trucCrypt官方网站获取来源:Http://www.truecrypt.org/,现在最新的版本是
我们用这个版本作为例子来介绍在VS2008下编译的方法。
打开VS2008,得到以下内容:
1,首先编译Boot项目
1,1提示:
1>------ has started the build: Project: Boot, configuration: Win32 Release
1> is performing a build file project operation
1>makefile (13): error U1050: fatal Environment variable MSVC16_ROOT must point to the installation directory of MS Visual C++ 1.5
1>Stop.
1>makefile (13): error U1050: fatal Environment variable MSVC16_ROOT must point to the installation directory of MS Visual C++ 1.5
1>Stop.
查看makefile 文件,因为没有理由安装 C ++ Visual 1.5。
解决方案:下载并安装1.52c Ms-VC ++,如果我安装在C:\ MSVC中,那么新变量中的系统环境变量如下。
1,2再次编译或者错误:
1>------ has started the build: Project: Boot, configuration: Win32 Release
1> is performing a build file project operation
1>Aes_hw_cpu.asm
1>'nasm.exe'is not an internal or external command, nor a program that can be run
1> or batch file.
1>NMAKE: error U1077: fatal "nasm.exe": return to the code "0x1"
1>Stop.
解决方法:
从Internet 下载nasm.exe,并将其放在VS2008 安装路径下。
3,1再次编译并出错:
1>------ has started the build: Project: Boot, configuration: Win32 Release
1> is performing a build file project operation
1>Aes_hw_cpu.asm
1>AesSmall_x86.asm
1>..\..\..\crypto\aestab.c
1>Linking...
1>'gzip.exe'is not an internal or external command, nor a program that can be run
1> or batch file.
1>NMAKE: error U1077: fatal "gzip.exe": return to the code "0x1"
1>Stop.
解决方案:从Internet 下载gzip.exe,并将其放入VS2008 安装路径。
1,4再次成功了。
我们得到了它
2,编译Crypto项目
由于编译了Boot项目,我们已经解决了很多路径,在Crypto.lib成功之后,在这里可以非常顺利地编译Crypto。
3,编译Driver项目
3,1下载WDK7600.16385.1并安装
可以参考我的文章:XP Window驱动程序开发(二)搭建环境(VS2008 + WDK + DDKWzard)和例子)
3,2提示出现以下错误:
[纯] 查看纯文本
1>------ has started the build: Project: Driver, configuration: Win32 Debug
1> is performing a build file project operation
Building truecrypt.sys: Debug x86 1>------
Error: MS Build 1>BuildDriver.cmd: does not support building of projects stored in a path containing spaces.
Building truecrypt.sys: Debug x64 1>------
Error: MS Build 1>BuildDriver.cmd: does not support building of projects stored in a path containing spaces.
在没有空格的路径中解决项目问题。
3,3再次成功编译器。
我们得到了truecrypt.sys
4,编译Format项目
1,4提示以下错误:
2>------ has started the build: Project: Format, configuration: Win32 Debug
2> is compiling...
2>Dlgcode.c
2>d:\truecrypt7.1asource\common\securitytoken.h (34): error C1083: fatal can not be opened including the file: "pkcs11.h": such file or directory No
解决方法:
下载PKCS 11头文件,并将其添加到包含路径的格式下的C ++项目的路径中。(在包含原始C ++路径中的默认值是$(PKCS11_INC)
所以我们也可以在系统环境变量中定义PKCS11_INC的值作为PKCS 11的路径
2,4再次成功编译器
我们得到它TrueCryptFormat.exe
5,编译Mount项目
技巧和1,4的出现是一样的,解决方案也和4,1一样。
再次成功编译器。
6,编译安装项目
6,1提示出现以下错误
2>Setup.c
2>d:\truecrypt7.1asource\setup\setup.c (135): C2065: error "PKEY_AppUserModel_ID": the declaration of the identifier
解决方法:
修改7.1A源代码安装.h在TrueCrypt 文件中的安装项目中添加
Add by gc---*/ /*---region
Wtypes.h "#include"
PROPERTYKEY PKEY_AppUserModel_ID const = {
{
(unsigned long) 2009, /*unsigned long / Data1;
(unsigned short) 12, /*unsigned short / Data2;
(unsigned short) 23, /*unsigned short / Data3;
0x44,0x55,0x55,0x55,0x55,0x55,0x55,0x55
/*GUID fmtid * /},;
(DWORD) PID_FIRST_USABLE /*DWORD * PID;
};
/*---endregion---*/
在文件的开头添加。
__cplusplus #ifdef
Extern "C" {
#endif
在一条线后面可以。
6,2再次成功了
花了两个小时,所以我们把整个工程解决方案编译并庆祝。
我们可以在Debug目录中看到目标文件:
三,查看操作效果
运行目标目录Truecrypt.exe,如果允许防火墙运行,请参阅主界面:
转载于:http://prog3.com/sbdm/blog/chenyujing1234/article/details/7777369