VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Password.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-07-27 02:36:23 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:21:43 +0100
commit1c11ee428d9e06be1440133f6d1163ce6c709410 (patch)
treed593910f3e6e3d2441bfd4bfe25d6e58c508a0b0 /src/Common/Password.c
parent97154aaf51efe787dd1678c8e1baeeb65ce46fe1 (diff)
downloadVeraCrypt-1c11ee428d9e06be1440133f6d1163ce6c709410.tar.gz
VeraCrypt-1c11ee428d9e06be1440133f6d1163ce6c709410.zip
Add option in select the number of passes for volume header over-writing. By default, it is set to 3 but it can be increased to 256 passes (which can lead to a delay of many hours for a single password change operation).
Diffstat (limited to 'src/Common/Password.c')
-rw-r--r--src/Common/Password.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Password.c b/src/Common/Password.c
index ca86f9c4..c23bd4fa 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -119,7 +119,7 @@ BOOL CheckPasswordLength (HWND hwndDlg, HWND hwndItem)
return TRUE;
}
-int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, HWND hwndDlg)
+int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, int wipePassCount, HWND hwndDlg)
{
int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR;
char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
@@ -323,7 +323,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
while (TRUE)
{
- /* The header will be re-encrypted PRAND_DISK_WIPE_PASSES times to prevent adversaries from using
+ /* The header will be re-encrypted wipePassCount times to prevent adversaries from using
techniques such as magnetic force microscopy or magnetic force scanning tunnelling microscopy
to recover the overwritten header. According to Peter Gutmann, data should be overwritten 22
times (ideally, 35 times) using non-random patterns and pseudorandom data. However, as users might
@@ -335,7 +335,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
of the header to differ substantially and in a random manner from the versions written during the
other passes. */
- for (wipePass = 0; wipePass < PRAND_DISK_WIPE_PASSES; wipePass++)
+ for (wipePass = 0; wipePass < wipePassCount; wipePass++)
{
// Prepare new volume header
nStatus = CreateVolumeHeaderInMemory (FALSE,
@@ -353,7 +353,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
cryptoInfo->RequiredProgramVersion,
cryptoInfo->HeaderFlags,
cryptoInfo->SectorSize,
- wipePass < PRAND_DISK_WIPE_PASSES - 1);
+ wipePass < wipePassCount - 1);
if (ci != NULL)
crypto_close (ci);