| iMatix home page
| << | < | > | >>
Version 2.11



#include "sflcryp.h"
crypt_encode (
    byte *buffer,                       /*  Data to encrypt, in-place        */
    word  buffer_size,                  /*  Amount of data to encrypt        */
    int   algorithm,                    /*  What type of encryption          */
    const byte *key)                    /*  Encryption key                   */


Encrypt a buffer with the specified algorithm and specified key. Returns TRUE if the buffer is encrypted sucessfully. The buffer is encrypted in-place. The algorithm can be one of:
CRYPT IDEA Use IDEA encryption.
CRYPT MDC Use MDC encryption.
CRYPT DES Use DES encryption.
CRYPT XOR Use XOR encryption.
The minimum buffer size, and key size depends on the algorithm:
CRYPT IDEA Buffer is at least 8 bytes long, key is 16 bytes.
CRYPT MDC Buffer is at least 8 bytes long, key is 8 bytes.
CRYPT DES Buffer is at least 32 bytes long, key is 16 bytes.
CRYPT XOR Buffer is at least 16 bytes long, key is 16 bytes.
Use crypt decode() with the same algorithm and key to decrypt the buffer. The buffer size must be a multiple of the minimum size shown above. If you specify a buffer size of zero the function does nothing but returns TRUE. For portability, the buffer size is limited to 64k.

Source Code - (sflcryp.c)

    return (crypt_data (buffer, buffer_size, algorithm, key, TRUE));

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation