The PaddingMethod property allows you to determine how the library will perform padding in the last block of data being encrypted.
Enum | Value | Description |
---|---|---|
epmFIPS81 |
0 |
Use the FIPS81 (Federal Information Processing Standards 81) scheme (ISO10126). This padding scheme is the one adopted for the DES operation mode described in the FIPS81 document. It specifies that the last byte (least significant) contains the number of padding bytes including itself. The other padding bytes are set to random values. |
epmRandom |
1 |
With this scheme, each padding byte is set to a random value. This implies that the decryptor must know how many bytes there is in the decrypted stream. So if you are decrypting data that was padded with this scheme, you may obtain extra random characters at the end of your decrypted stream. If you know the size of the original plain text , you will be able to ignore the extra random characters. |
epmRFC1423 |
2 |
Use the RFC1423 (PKCS7) scheme. This padding scheme specifies that each padding byte is set to the number of padding bytes. For instance three padding bytes will each have the decimal value of 03. |
The FIPS81 and RFC1423 padding schemes imply that there will always be at least 1 padding byte. Hence, if a plain text is a multiple of the algorithm's block size, the last block to encrypt will be made entirely of padding bytes (it will contain 16 bytes of value 16). The random padding scheme may have no padding bytes at all.
epmFIPS81
Encrypt, Decrypt, ReadFile, WriteFile and ProcessFile