Migrating from 57xx-CR1

IBM dropped support of IBM® Cryptographic Support for AS/400® (5722-CR1) in V6R1. This topic helps you migrate your CR1 applications to the Cryptographic Services APIs.

Before reading this topic, you might want to review the information in the following topics:

This topic contains many references to Cryptographic Services APIs. Note that in V6R1 all the key management functions can be accomplished not only through the Cryptographic Services APIs, but also through the Cryptographic Services set of CL commands, and through the Cryptographic Services Key Management function in IBM Systems Director Navigator for IBM i.

General Functional Differences

PIN functions
The Cryptographic Services APIs do not support the CR1 PIN functions. CR1 supports the 3624 PIN calculation method. It is possible to code the 3624 PIN calculation method using the Cryptographic Services APIs. To do so, implement the "PIN Generation Algorithm" described in Chapter 4 of the Cryptographic Support/400 guide, replacing the CR1 APIs with Cryptographic Services APIs as described below. However, a better solution would be to use a cryptographic coprocessor and the Common Cryptographic Architecture API set, which supports many PIN calculation methods and PIN block formats. For more information, see 4764 Cryptographic Coprocessor.
Key management
Both CR1 and the Cryptographic Services APIs implement key management using a key hierarchy. At the top, a clear master key is securely stored. Other keys can be stored in a database file where the key values are encrypted under the master key. However, note the following differences in key management between CR1 and the Cryptographic Services APIs:
Master key variants
Master key variants are values that are exclusive-OR'd into the master key value prior to encrypting or decrypting a key. Master key variants are used to limit how the encrypted key can be used. Both CR1 and the Cryptographic Services APIs use master key variants. However, the values of the variants and how they are used are completely different.

CR1 uses master key variants to limit cross-domain keys to either export, import, or PIN protection operations. The CR1 master key variants are the following:

Sending cross-domain key Eight bytes of hexadecimal 88.
Receiving cross-domain key Eight bytes of hexadecimal 22.
PIN cross-domain key Eight bytes of hexadecimal 44.

Cryptographic Services APIs use master key variants to limit master key encrypted keys to any combination of encrypt, decrypt, MAC, and sign operations.

Migrating Keys

If you have not already established a Cryptographic Services APIs master key, do so using the Load Master Key Part and Set Master Key APIs.

Write a program that performs the following steps to migrate your keys from the CR1 cross-domain key table to a Cryptographic Services APIs keystore file.

  1. Create a keystore file using the Create Keystore API.

  2. Get the CR1 master key value.
  3. Create a key context token for each variant of the CR1 master key.
  4. Erase the master key value, the three new key values, and any key part values from program storage.

  5. Create a DES algorithm context token using the Create Algorithm Context API.
  6. Read each record of the cross-domain key table and import the key value to your keystore file.
  7. Use the Write Key Record API to import the key value to the keystore file.

To migrate CR1 master key encrypted keys not stored in the cross-domain key table, your program should perform the following steps.

  1. Get the CR1 master key value.
  2. Create a key context token for the CR1 master key.
  3. Erase the master key value and any key part values from program storage.

  4. Create a DES algorithm context token using the Create Algorithm Context API.
  5. Import the CR1 master key encrypted keys.

    For each CR1 master key encrypted key, use the Import Key API to re-encrypt the key under a Cryptographic Services APIs master key.

Migrating Programs

Use the following list to determine how to replace CR1 APIs with Cryptographic Services APIs.

Add Cross-Domain Key (CL, ADDCRSDMNK)
Replace with Notes:
Change Cross-Domain Key (CL, CHGCRSDMNK)
Replace with Notes:
Change Master Key (CL, CHGMSTKK)
Replace with Notes:
Cipher Data (CL, CPHDTA; OPM, QCRCIPHR)
Replace with Notes:
Encrypt Cipher Key (CL, ENCCPHK; OPM, QCRENCKY)
Replace with
Encipher From Master Key (CL, ENCFRMMSTK; OPM, QCRENCFR)
Replace with Notes:
Encipher To Master Key (CL, ENCTOMSTK; OPM, QCRENCTO)
Replace with Notes:
Generate Cipher Key (CL, GENCPHK; OPM, QCRGENKY)
Replace with Notes:
Generate Cross-Domain Key (CL, GENCRSDMNK)
Replace with Notes:
Generate Message Authentication Code (CL, GENMAC; OPM, QCRGENMA)
Replace with Notes:
Generate PIN (CL, GENPIN; OPM, QCRGENPN)
Replace with Notes:
Remove Cross-Domain Key (CL, RMVCRSDMNK)
Replace with Notes:
Set Master Key (CL, SETMSTK)
Replace with
Translate PIN (CL, TRNPIN; OPM, QCRTRNPN)
Replace with Notes:
Verify Master Key (CL, VFYMSTK)
Replace with Notes:
Verify PIN (CL, VFYPIN; OPM, QCRVFYPN)
Replace with Notes:


[ Back to top | Cryptographic Services APIs | APIs by category ]