Apple Network Setup manual OTCfgEncrypt, OTCfgDecrypt

Models: Network Setup

1 184
Download 184 pages 5.56 Kb
Page 93
Image 93
OTCfgEncrypt

C H A P T E R 3

Network Setup Reference

OTCfgEncrypt

Encrypts data.

SInt16 OTCCfgEncrypt (const UInt8 *key.

UInt8 *data,

SInt16 dataLen);

key

On input, a pointer to a Pascal string containing the encryption

 

key. For Remote Access password, the encryption key is a user

 

name.

data

On input, a pointer to an array of bytes that contains data that is

 

to be encrypted. Usually, the data is a password. On output,

 

data contains the encrypted password.

dataLen

On input, a value of type SInt16 that specifies the number of

 

bytes in the data array.

function result The length of the encrypted data.

DISCUSSION

The OTCfgEncrypt function encrypts the contents of the data parameter using the key specified by the key parameter. For sample code, see Listing 2-17 in Chapter 2, “Using Network Setup.”

Note

The OTCCfgEncrypt function is available in Network Setup version 1.1 and later.

OTCfgDecrypt

Decrypts data.

SInt16 OTCCfgDecrypt (const UInt8 *key.

UInt8 *data,

SInt16 dataLen);

Network Setup Functions

93

Page 93
Image 93
Apple Network Setup manual OTCfgEncrypt, OTCfgDecrypt