Random Nonce
A random nonce is a randomly generated number (IV or tweak) that can be used only once in cryptographic operations. It plays a crucial role in preventing replay attacks and ensuring the integrity of communication. The random nonce ensures the ciphertext is unique each time even for the same plaintext.
Note
It is recommended to use random nonce for higher security.
Random nonce is configured when creating protection policy.
Supported Algorithms
Application Data Protection provides support of random nonce in the following algorithms:
| AES/CBC/PKCS5Padding | AES/CBC/NoPadding |
| AES/GCM | AES/CTR |
| FPE/AES | FPE/FF1v2 |
| FPE/FF3 | FPE/FF3-1 |
Types of Random Nonce
Following are the types of random nonce:
Internal: The nonce generated during protect is returned with the ciphertext. The structure of ciphertext is as follows: version header + prefix + nonce + ciphertext. Internal random nonce works with internal and disabled protection policies.
External: The nonce generated during protect is returned in a separate field depending on the chosen connector type. External nonce works with external and disabled protection policies.
Disable: In this case, nonce is not returned with the ciphertext. Disable nonce can be used with internal, external, or disabled protection policy.
Important Notes
-
For AES algorithms, IV is randomly generated. To skip generating IV randomly, don't configure random nonce.
-
For FPE variants, tweak is randomly generated. To skip generating tweak randomly, don't configure random nonce.