Modification Detection Code calculation
The Modification Detection Code (MDC) calculation method defines a one-way cryptographic function.
A one-way cryptographic function is a function in which it is easy to compute the input into output (a digest) but very difficult to compute the output into input. MDC uses DES encryption only and a default key of X'5252 5252 5252 5252 2525 2525 2525 2525'.
The MDC Generate verb
supports four versions of the MDC calculation method that you specify
by using one of the keywords shown in Table 1. All versions use
the MDC-1 calculation.
Keyword | Version of the MDC calculation |
---|---|
MDC-2, PADMDC-2 | Specifies two encipherments for each 8-byte input data block. These versions use the MDC-2 calculation procedure described in Table 2. |
MDC-4, PADMDC-4 | Specifies four encipherments for each 8-byte input data block. These versions use the MDC-4 calculation procedure described in Table 2. |
When the keywords PADMDC-2 and PADMDC-4 are
used, the supplied text is always padded as follows:
- If the total supplied text is less than 16 bytes in length, pad bytes are appended to make the text length equal to 16 bytes. A length of zero is allowed.
- If the total supplied text is a minimum of 16 bytes in length, pad bytes are appended to make the text length equal to the next-higher multiple of eight bytes. One or more pad bytes are always added.
- All appended pad bytes, other than the last pad byte, are set to X'FF'.
- The last pad byte is set to a binary value equal to the count of all appended pad bytes (X'01' - X'10').
Use the resulting pad text in the Table 2. The MDC Generate verb
uses these MDC calculation methods. See MDC Generate (CSNBMDG) for
more information.
Calculation | Procedure |
---|---|
MDC-1 |
|
MDC-2 |
|
MDC-4 |
|
Notation:
|