This archive contains the source code of VeraCrypt. It is based on original TrueCrypt 7.1a with security enhancements and modifications. Important ========= You may use the source code contained in this archive only if you accept and agree to the license terms contained in the file 'License.txt', which is included in this archive. Note that the license specifies, for example, that a derived work must not be called 'TrueCrypt' or 'VeraCrypt' Contents ======== I. Windows Requirements for Building VeraCrypt for Windows Instructions for Building VeraCrypt for Windows Instructions for Signing and Packaging VeraCrypt for Windows II. Linux and Mac OS X Requirements for Building VeraCrypt for Linux and Mac OS X Instructions for Building VeraCrypt for Linux and Mac OS X Mac OS X specifics III. FreeBSD and OpenSolaris IV. Third-Party Developers (Contributors) V. Legal Information VI. Further Information I. Windows ========== Requirements for Building VeraCrypt for Windows: ------------------------------------------------ - Microsoft Visual C++ 2008 SP1 (Professional Edition or compatible) - Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads) - Microsoft Windows SDK for Windows 7 (configured for Visual C++) - Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1) - RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20 header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20) - NASM assembler 2.08 or compatible - gzip compressor IMPORTANT: The 64-bit editions of Windows Vista and later versions of Windows, and in some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not allow the VeraCrypt driver to run without an appropriate digital signature. Therefore, all .sys files in official VeraCrypt binary packages are digitally signed with the digital certificate of the IDRIX, which was issued by Thawt certification authority. At the end of each official .exe and .sys file, there are embedded digital signatures and all related certificates (i.e. all certificates in the relevant certification chain, such as the certification authority certificates, CA-MS cross-certificate, and the IDRIX certificate). Keep this in mind if you compile VeraCrypt and compare your binaries with the official binaries. If your binaries are unsigned, the sizes of the official binaries will usually be approximately 10 KB greater than sizes of your binaries (there may be further differences if you use a different version of the compiler, or if you install a different or no service pack for Visual Studio, or different hotfixes for it, or if you use different versions of the required SDKs). Instructions for Building VeraCrypt for Windows: ------------------------------------------------ 1) Create an environment variable 'MSVC16_ROOT' pointing to the folder 'MSVC15' extracted from the Visual C++ 1.52 self-extracting package. Note: The 16-bit installer MSVC15\SETUP.EXE cannot be run on 64-bit Windows, but it is actually not necessary to run it. You only need to extract the folder 'MSVC15', which contains the 32-bit binaries required to build the VeraCrypt Boot Loader. 2) If you have installed the Windows Driver Development Kit in another directory than '%SYSTEMDRIVE%\WinDDK', create an environment variable 'WINDDK_ROOT' pointing to the DDK installation directory. 3) Copy the PKCS #11 header files to a standard include path or create an environment variable 'PKCS11_INC' pointing to the directory where the PKCS #11 header files are installed. 4) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2008. 5) Select 'All' as the active solution configuration. 6) Build the solution. 7) If successful, there should be newly built VeraCrypt binaries in the 'Release' folder. Instructions for Signing VeraCrypt for Windows: ------------------------------------------------ The folder "Signing" contains a batch file (sign.bat) that will sign all VeraCrypt components using a code signing certificate present on the certificate store and also build the final installation setup. The batch file suppose that the code signing certificate is issued by Thawt. This is the case fo
/*
Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2017 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
#ifndef TC_HEADER_Main_Main
#define TC_HEADER_Main_Main
#include "System.h"
#include "Platform/Platform.h"
#include "Core/Core.h"
#include "Main/StringFormatter.h"
#define MAX_PIM_DIGITS 7 // Maximum allowed digits in a PIM (enough for maximum value)
#define MAX_PIM_VALUE 2147468 // Maximum value to have a positive 32-bit result for formula 15000 + (PIM x 1000)
#define MAX_BOOT_PIM_DIGITS 5 // Maximum allowed digits in a PIM for boot (enough for 16-bit value)
#define MAX_BOOT_PIM_VALUE 65535
#endif // TC_HEADER_Main_Main