VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/TextUserInterface.h
blob: 78874b8c2fa3a27a26ffb43f5a249ace67b54175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 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_TextUserInterface
#define TC_HEADER_Main_TextUserInterface

#include "System.h"
#include "Main.h"
#include "UserInterface.h"

namespace VeraCrypt
{
	class TextUserInterface : public UserInterface
	{
	public:
		TextUserInterface ();
		virtual ~TextUserInterface ();

		virtual FilePath AskFilePath (const wxString &message = wxEmptyString) const;
		virtual shared_ptr <KeyfileList> AskKeyfiles (const wxString &message = L"") const;
		virtual shared_ptr <VolumePassword> AskPassword (const wxString &message = L"", bool verify = false) const;
		virtual int AskPim (const wxString &message = L"") const;
		virtual ssize_t AskSelection (ssize_t optionCount, ssize_t defaultOption = -1) const;
		virtual wstring AskString (const wxString &message = wxEmptyString) const;
		virtual shared_ptr <VolumePath> AskVolumePath (const wxString &message = L"") const;
		virtual bool AskYesNo (const wxString &message, bool defaultYes = false, bool warning = false) const;
		virtual void BackupVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
		virtual void BeginBusyState () const { }
		virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), bool truecryptMode = false, shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const;
		virtual void CreateKeyfile (shared_ptr <FilePath> keyfilePath = shared_ptr <FilePath>()) const;
		virtual void CreateVolume (shared_ptr <VolumeCreationOptions> options) const;
		virtual void DeleteSecurityTokenKeyfiles () const;
		virtual void DoShowError (const wxString &message) const;
		virtual void DoShowInfo (const wxString &message) const;
		virtual void DoShowString (const wxString &str) const;
		virtual void DoShowWarning (const wxString &message) const;
		virtual void EndBusyState () const { }
		virtual void ExportSecurityTokenKeyfile () const;
		virtual shared_ptr <GetStringFunctor> GetAdminPasswordRequestHandler ();
		virtual void ImportSecurityTokenKeyfiles () const;
#ifndef TC_NO_GUI
		virtual bool Initialize (int &argc, wxChar **argv) { return wxAppBase::Initialize(argc, argv); }
#endif
		virtual void InitSecurityTokenLibrary () const;
		virtual void ListSecurityTokenKeyfiles () const;
		virtual VolumeInfoList MountAllDeviceHostedVolumes (MountOptions &options) const;
		virtual shared_ptr <VolumeInfo> MountVolume (MountOptions &options) const;
		virtual bool OnInit ();
#ifndef TC_NO_GUI
		virtual bool OnInitGui () { return true; }
#endif
		virtual int OnRun();
		virtual void RestoreVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
		static void SetTerminalEcho (bool enable);
		virtual void UserEnrichRandomPool () const;
		virtual void Yield () const { }

	protected:
		static void OnSignal (int signal);
		virtual void ReadInputStreamLine (wxString &line) const;
		virtual wxString ReadInputStreamLine () const;

		auto_ptr <wxFFileInputStream> FInputStream;
		auto_ptr <wxTextInputStream> TextInputStream;

	private:
		TextUserInterface (const TextUserInterface &);
		TextUserInterface &operator= (const TextUserInterface &);
	};

	extern wxMessageOutput *DefaultMessageOutput;
}

#endif // TC_HEADER_Main_TextUserInterface
">>Dynamic VeraCrypt container is a pre-allocated NTFS sparse file whose physical size (actual disk space used) grows as new data is added to it. Note that the physical size of the container (actual disk space that the container uses) will not decrease when files are deleted on the VeraCrypt volume. The physical size of the container can only <em>increase </em>up to the maximum value that is specified by the user during the volume creation process. After the maximum specified size is reached, the physical size of the container will remain constant.<br> <br> Note that sparse files can only be created in the NTFS file system. If you are creating a container in the FAT file system, the option <em>Dynamic </em>will be disabled (&ldquo;grayed out&rdquo;).<br> <br> Note that the size of a dynamic (sparse-file-hosted) VeraCrypt volume reported by Windows and by VeraCrypt will always be equal to its maximum size (which you specify when creating the volume). To find out current physical size of the container (actual disk space it uses), right-click the container file (in a Windows Explorer window, not in VeraCrypt), then select <em>Properties </em>and see the Size on disk value.</p> <p>WARNING: Performance of dynamic (sparse-file-hosted) VeraCrypt volumes is significantly worse than performance of regular volumes. Dynamic (sparse-file-hosted) VeraCrypt volumes are also less secure, because it is possible to tell which volume sectors are unused. Furthermore, if data is written to a dynamic volume when there is not enough free space in its host file system, the encrypted file system may get corrupted.</p> <h3>Cluster Size</h3> <p>Cluster is an allocation unit. For example, one cluster is allocated on a FAT file system for a one- byte file. When the file grows beyond the cluster boundary, another cluster is allocated. Theoretically, this means that the bigger the cluster size, the more disk space is wasted; however, the better the performance. If you do not know which value to use, use the default.</p> <h3>VeraCrypt Volumes on CDs and DVDs</h3> <p>If you want a VeraCrypt volume to be stored on a CD or a DVD, first create a file-hosted VeraCrypt container on a hard drive and then burn it onto a CD/DVD using any CD/DVD burning software (or, under Windows XP or later, using the CD burning tool provided with the operating system). Remember that if you need to mount a VeraCrypt volume that is stored on a read-only medium (such as a CD/DVD) under Windows 2000, you must format the VeraCrypt volume as FAT. The reason is that Windows 2000 cannot mount NTFS file system on read-only media (Windows XP and later versions of Windows can).</p> <h3>Hardware/Software RAID, Windows Dynamic Volumes</h3> <p>VeraCrypt supports hardware/software RAID as well as Windows dynamic volumes.</p> <p>Windows Vista or later: Dynamic volumes are displayed in the &lsquo;Select Device&rsquo; dialog window as \Device\HarddiskVolumeN.</p> <p>Windows XP/2000/2003: If you intend to format a Windows dynamic volume as a VeraCrypt volume, keep in mind that after you create the Windows dynamic volume (using the Windows Disk Management tool), you must restart the operating system in order for the volume to be available/displayed in the &lsquo;Select Device&rsquo; dialog window of the VeraCrypt Volume Creation Wizard. Also note that, in the &lsquo;Select Device&rsquo; dialog window, a Windows dynamic volume is not displayed as a single device (item). Instead, all volumes that the Windows dynamic volume consists of are displayed and you can select any of them in order to format the entire Windows dynamic volume.</p> <h3>Additional Notes on Volume Creation</h3> <p>After you click the &lsquo;Format&rsquo; button in the Volume Creation Wizard window (the last step), there will be a short delay while your system is being polled for additional random data. Afterwards, the master key, header key, secondary key (XTS mode), and salt, for the new volume will be generated, and the master key and header key contents will be displayed.<br> <br> For extra security, the portions of the randomness pool, master key, and header key can be prevented from being displayed by unchecking the checkbox in the upper right corner of the corresponding field:<br> <br> <img src="Beginner's Tutorial_Image_023.gif" alt="" width="338" height="51"><br> <br> Note that only the first 128 bits of the pool/keys are displayed (not the entire contents).<br> <br> You can create FAT (whether it will be FAT12, FAT16, or FAT32, is automatically determined from the number of clusters) or NTFS volumes (however, NTFS volumes can only be created by users with administrator privileges). Mounted VeraCrypt volumes can be reformatted as FAT12, FAT16, FAT32, or NTFS anytime. They behave as standard disk devices so you can right-click the drive letter of the mounted VeraCrypt volume (for example in the &lsquo;<em>Computer</em>&rsquo; or &lsquo;<em>My Computer</em>&rsquo; list) and select &lsquo;Format&rsquo;.<br> <br> For more information about creating VeraCrypt volumes, see also the section <a href="Hidden%20Volume.html"> <em>Hidden Volume</em></a>.</p> <p>&nbsp;</p> <p><a href="Favorite%20Volumes.html" style="text-align:left; color:#0080c0; text-decoration:none; font-weight:bold.html">Next Section &gt;&gt;</a></p> </div> </div> </body></html>