Documentation Technical Details PIM

# PIM

PIM stands for "Personal Iterations Multiplier". It is a parameter that was introduced in VeraCrypt 1.12 and whose value controls the computational parameters used by the header key derivation function. This value can be specified through the password dialog or in the command line.

The exact meaning of PIM depends on the key derivation function (KDF) being used:

### PBKDF2-HMAC Key Derivation

When PBKDF2-HMAC is used, the PIM value controls the number of iterations as follows:

- For system encryption that doesn't use SHA-512 or Whirlpool: Iterations = PIM x 2048
- For system encryption that uses SHA-512 or Whirlpool: Iterations = 15000 + (PIM x 1000)
- For non-system encryption and file containers: Iterations = 15000 + (PIM x 1000)

### Argon2id Key Derivation

When Argon2id is used, the PIM value controls both memory cost and time cost parameters:

- Memory Cost (m_cost) in MiB:
  m_cost(pim) = min(64 MiB + (pim - 1) * 32 MiB, 1024 MiB)
  The memory cost increases by 32 MiB for each increment of PIM, starting from 64 MiB, and is capped at 1024 MiB when PIM reaches 31 or higher.
- Time Cost (t_cost) in iterations:
  If PIM ≤ 31: t_cost(pim) = 3 + floor((pim - 1) / 3)
  If PIM > 31: t_cost(pim) = 13 + (pim - 31)
  The time cost increases by 1 iteration for every 3 increments of PIM when PIM ≤ 31, and by 1 iteration per PIM increment when PIM > 31.
- Parallelism: Fixed at 1 thread for all cases.

Argon2id Examples:

- For PIM = 12: Memory Cost = 416 MiB, Time Cost = 6 iterations
- For PIM = 31: Memory Cost = 1024 MiB, Time Cost = 13 iterations
- For PIM = 32: Memory Cost = 1024 MiB, Time Cost = 14 iterations

If no PIM value is specified, VeraCrypt will use the default parameters used in versions prior to 1.12 for PBKDF2-HMAC (see Header Key Derivation). For Argon2id, default parameters are equivalent to PIM = 12:

- PBKDF2-HMAC defaults:

- For system partition encryption (boot encryption) that uses SHA-256, BLAKE2s-256 or Streebog, 200000 iterations are used which is equivalent to a PIM value of 98.
- For system encryption that uses SHA-512 or Whirlpool, 500000 iterations are used which is equivalent to a PIM value of 485.
- For non-system encryption and file containers using PBKDF2-HMAC, 500000 iterations are used which is equivalent to a PIM value of 485.

- Argon2id defaults: Memory Cost = 416 MiB, Time Cost = 6 iterations (equivalent to PIM = 12)

Prior to version 1.12, the security of a VeraCrypt volume was only based on the password strength because VeraCrypt was using a fixed number of iterations.
With the introduction of PIM, VeraCrypt has a multi-dimensional security space for volumes based on the combination (Password, PIM, Key Derivation Function). This provides more flexibility for adjusting the desired security level while also controlling the performance of the mount/boot operation.

### PIM Usage

It is not mandatory to specify a PIM.
When creating a volume or when changing the password, the user has the possibility to specify a PIM value by checking the "Use PIM" checkbox which in turn will make a PIM field available in the GUI so a PIM value can be entered.
The PIM is treated like a secret value that must be entered by the user each time alongside the password. If the incorrect PIM value is specified, the mount/boot operation will fail.
Using high PIM values leads to better security thanks to the increased number of iterations but it comes with slower mounting/booting times.
With small PIM values, mounting/booting is quicker but this could decrease security if a weak password is used.
During the creation of a volume or the encryption of the system, VeraCrypt forces the PIM value to be greater than or equal to a certain minimal value when the password is less than 20 characters. This check is done in order to ensure that, for short passwords, the security level is at least equal to the default level provided by an empty PIM.
The PIM minimal value for short passwords is 12 for Argon2id volumes, 98 for system encryption that doesn't use SHA-512 or Whirlpool, and 485 for PBKDF2-HMAC in the other cases. For password with 20 characters and more, the PIM minimal value is 1. In all cases, leaving the PIM empty or setting its value to 0 will make VeraCrypt use the default KDF parameters as explained in section Header Key Derivation.
Motivations behind using a custom PIM value can be:

- Add an extra secret parameter (PIM) that an attacker will have to guess
- Increase security level by using large PIM values to thwart future development of brute force attacks.
- Speeding up booting or mounting through the use of a small PIM value (less than 12 for Argon2id volumes, less than 98 for system encryption that doesn't use SHA-512 or Whirlpool, and less than 485 for PBKDF2-HMAC in the other cases)

The screenshots below show the step to mount a volume using a PIM equal to 231:

### Changing/clearing the PIM

The PIM of a volume or for system encryption can be changed or cleared using the change password functionality. The screenshots below shows an example of changing the PIM from the empty default value to a value equal to 3 (this is possible since the password has more than 20 characters). In order to do so, the user must first tick "Use PIM" checkbox in the "New" section to reveal the PIM field.

Normal volume case

#####

System encryption case

Next Section >>