IBM 2 Computer Hardware User Manual


 
Encipher CCA Release 2.54
Encipher (CSNBENC)
Platform/
Product
OS/2 AIX Win NT/
2000
OS/400
IBM 4758-2/23 X X X X
The Encipher verb uses the DES algorithm and a secret key to encipher data. This
verb returns data called ciphertext.
The returned ciphertext can be as many as eight bytes longer than the plaintext
due to padding. Ensure the ciphertext variable is large enough to receive the
returned data.
Performance can be enhanced by aligning the start of the plaintext and ciphertext
variables on four-byte boundaries.
DATA, CIPHER, and ENCIPHER key-types can be used. Both single-DES and
triple-DES are performed based on the length of the key. For additional information
about the ciphering verbs, see “Ensuring Data Confidentiality” on page 6-1.
Restrictions
The text_length variable is restricted to a maximum value of 32MB - 8 bytes and to
64MB - 8 bytes in the OS/400 environment.
The installed Function Control Vector regulates the maximum data ciphering
capability to one of CDMF, single-DES, or triple-DES.
Format
CSNBENC
return_code Output Integer
reason_code Output Integer
exit_data_length In/Output Integer
exit_data In/Output String exit_data_length bytes
key_identifier In/Output String 64 bytes
text_length In/Output Integer
plaintext Input String text_length bytes
initialization_vector Input String 8 bytes
rule_array_count Input Integer zero, one, two, or three
rule_array Input String
array
rule_array_count * 8 bytes
pad_character Input Integer
chaining_vector In/Output String 18 bytes
ciphertext Output String updated text_length bytes
Parameters
For the definitions of the return_code, reason_code, exit_data_length, and exit_data
parameters, see “Parameters Common to All Verbs” on page 1-11.
key_identifier
The key_identifier parameter is a pointer to a string variable containing an
internal key-token or the key label of an internal key-token record in key
storage.
6-8 IBM 4758 CCA Basic Services, Release 2.54, February 2005