#include "sflcryp.h"
Bool
crypt_decode (
byte *buffer, /* Data to decrypt, in-place */
word buffer_size, /* Amount of data to decrypt */
int algorithm, /* What type of decryption */
const byte *key) /* Decryption key */
Synopsis
Decrypt a buffer that was produced by crypt encode(). You
must (obviously, I reckon) use the same algorithm and key as
was used to encrypt the data. Returns TRUE if the buffer is
decrypted okay. 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. |
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.
Source Code - (sflcryp.c)
{
return (crypt_data (buffer, buffer_size, algorithm, key, FALSE));
}
| << | <
| > | >>
|
Copyright © 1996-2000 iMatix Corporation |